Robo l minuscolo
Dependencies: X_NUCLEO_IHM04A1 mbed
Fork of HelloWorld_IHM04A1 by
Diff: main.cpp
- Revision:
- 5:4c1e581bbb8b
- Parent:
- 1:4d9b9123d9e1
- Child:
- 6:d5d776281222
--- a/main.cpp Tue May 17 12:56:07 2016 +0000 +++ b/main.cpp Wed Jun 15 12:51:03 2016 +0000 @@ -112,7 +112,7 @@ /* Code to be customised */ /************************/ /* Get the state of bridge A */ - uint16_t bridgeState = motor->CmdGetStatus(0); + uint16_t bridgeState = motor->GetBridgeStatus(0); if (bridgeState == 0) { @@ -126,7 +126,7 @@ } /* Get the state of bridge B */ - bridgeState = motor->CmdGetStatus(1); + bridgeState = motor->GetBridgeStatus(1); if (bridgeState == 0) { @@ -212,46 +212,46 @@ { printf("Run motor 0 at 20%% of the maximum speed\n"); /* Set speed of motor 0 to 20% */ - motor->SetMaxSpeed(0,20); + motor->SetSpeed(0,20); /* start motor 0 */ - motor->Run(0, FORWARD); + motor->Run(0, BDCMotor::FWD); } if (gStep > 1) { printf("Run motor 1 at 30%% of the maximum speed\n"); /* Set speed of motor 1 to 30 % */ - motor->SetMaxSpeed(1,30); + motor->SetSpeed(1,30); /* start motor 1 */ - motor->Run(1, FORWARD); + motor->Run(1, BDCMotor::FWD); } if (gStep > 2) { printf("Run motor 2 at 40%% of the maximum speed\n"); /* Set speed of motor 2 to 40 % */ - motor->SetMaxSpeed(2,40); + motor->SetSpeed(2,40); /* start motor 2 */ - motor->Run(2, FORWARD); + motor->Run(2, BDCMotor::FWD); } if (gStep > 3) { printf("Run motor 3 at 50%% of the maximum speed\n"); /* Set speed of motor 3 to 50 % */ - motor->SetMaxSpeed(3,50); + motor->SetSpeed(3,50); /* start motor 3 */ - motor->Run(3, FORWARD); + motor->Run(3, BDCMotor::FWD); } if (gStep > 0) { wait_ms(1000); - motor->CmdHardHiZ(0); - motor->CmdHardHiZ(1); - motor->CmdHardHiZ(2); - motor->CmdHardHiZ(3); + motor->HardHiZ(0); + motor->HardHiZ(1); + motor->HardHiZ(2); + motor->HardHiZ(3); wait_ms(1000); }