The programme shows some of the features of the RenBuggyServo library in action.
Revision 1:1a5db4892449, committed 2014-03-13
- Comitter:
- Markatron
- Date:
- Thu Mar 13 07:31:28 2014 +0000
- Parent:
- 0:40e8ea905308
- Commit message:
- Finished adding functionality for use of an encoder.;
Changed in this revision
| RenBuggyServo.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/RenBuggyServo.lib Fri Mar 07 08:01:42 2014 +0000 +++ b/RenBuggyServo.lib Thu Mar 13 07:31:28 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/Renishaw/code/RenBuggyServo/#d388aed56112 +http://mbed.org/teams/Renishaw/code/RenBuggyServo/#01bc89d7ae8e
--- a/main.cpp Fri Mar 07 08:01:42 2014 +0000
+++ b/main.cpp Thu Mar 13 07:31:28 2014 +0000
@@ -9,7 +9,7 @@
#include "mbed.h"
#include "Car.h"
-Car myCar(P1_25, P1_24);
+Car myCar(P1_26, P1_24, 16, 16.65f, P0_7);
// Main entry point of application.
int main() {
@@ -28,16 +28,11 @@
myCar.configureMotor_us(MOTOR_PWM, MOTOR_PERIOD);
- // Drive the RenBuggy!
myCar.setDirection(0);
- wait(1);
- myCar.forwards();
- wait(4);
+
+ myCar.forwards(7);
myCar.setDirection(45);
- wait(8);
- myCar.setDirection(0);
- wait(4);
- myCar.setDirection(-45);
- wait(8);
- myCar.stop();
+ myCar.forwards(20);
+ myCar.setDirection(-30);
+ myCar.forwards(20);
}
\ No newline at end of file