uln200xa: C implementation and examples

Signed-off-by: Jon Trulson <jtrulson@ics.com>
This commit is contained in:
Jon Trulson
2016-10-24 16:04:51 -06:00
parent 7e0862cecc
commit 58dfa9d95a
14 changed files with 499 additions and 270 deletions

View File

@ -32,7 +32,7 @@ int main ()
{
//! [Interesting]
// Instantiate a Stepper motor on a ULN200XA Dual H-Bridge.
// Instantiate a Stepper motor on a ULN200XA Darlington controller.
// This was tested with the Grove Gear Stepper Motor with Driver
@ -41,13 +41,13 @@ int main ()
upm::ULN200XA* uln200xa = new upm::ULN200XA(4096, 8, 9, 10, 11);
uln200xa->setSpeed(5);
uln200xa->setDirection(upm::ULN200XA::DIR_CW);
uln200xa->setDirection(ULN200XA_DIR_CW);
cout << "Rotating 1 revolution clockwise." << endl;
uln200xa->stepperSteps(4096);
cout << "Sleeping for 2 seconds..." << endl;
sleep(2);
cout << "Rotating 1/2 revolution counter clockwise." << endl;
uln200xa->setDirection(upm::ULN200XA::DIR_CCW);
uln200xa->setDirection(ULN200XA_DIR_CCW);
uln200xa->stepperSteps(2048);
// turn off the power