mirror of
https://github.com/eclipse/upm.git
synced 2025-07-01 01:11:10 +03:00
uln200xa: C implementation and examples
Signed-off-by: Jon Trulson <jtrulson@ics.com>
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user