mirror of
https://github.com/eclipse/upm.git
synced 2025-07-01 17:31:13 +03:00
grovemd: allow seperate directions for each DC motor
Signed-off-by: Jon Trulson <jtrulson@ics.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:

committed by
Mihai Tudor Panu

parent
d380658b40
commit
970d6a083f
@ -33,7 +33,8 @@ function start()
|
||||
{
|
||||
// set direction to CW and set speed to 50%
|
||||
console.log("Spin M1 and M2 at half speed for 3 seconds");
|
||||
my_MotorDriver_obj.setDirection(groveMotorDriver_lib.GroveMD.DIR_CW);
|
||||
my_MotorDriver_obj.setMotorDirections(groveMotorDriver_lib.GroveMD.DIR_CW,
|
||||
groveMotorDriver_lib.GroveMD.DIR_CW);
|
||||
my_MotorDriver_obj.setMotorSpeeds(127, 127);
|
||||
}
|
||||
}
|
||||
@ -44,7 +45,8 @@ function reverse()
|
||||
{
|
||||
// counter clockwise
|
||||
console.log("Reversing M1 and M2 for 3 seconds");
|
||||
my_MotorDriver_obj.setDirection(groveMotorDriver_lib.GroveMD.DIR_CCW);
|
||||
my_MotorDriver_obj.setMotorDirections(groveMotorDriver_lib.GroveMD.DIR_CCW,
|
||||
groveMotorDriver_lib.GroveMD.DIR_CCW);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user