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:
Jon Trulson
2015-03-18 12:20:19 -06:00
committed by Mihai Tudor Panu
parent d380658b40
commit 970d6a083f
4 changed files with 24 additions and 15 deletions

View File

@ -39,13 +39,13 @@ int main(int argc, char **argv)
// set direction to CW and set speed to 50%
cout << "Spin M1 and M2 at half speed for 3 seconds" << endl;
motors->setDirection(upm::GroveMD::DIR_CW);
motors->setMotorDirections(upm::GroveMD::DIR_CW, upm::GroveMD::DIR_CW);
motors->setMotorSpeeds(127, 127);
sleep(3);
// counter clockwise
cout << "Reversing M1 and M2 for 3 seconds" << endl;
motors->setDirection(upm::GroveMD::DIR_CCW);
motors->setMotorDirections(upm::GroveMD::DIR_CCW, upm::GroveMD::DIR_CCW);
sleep(3);
//! [Interesting]