![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
V1 of the ParallaxRobotShield library
Dependencies: ParallaxRobotShield-V1 mbed
main.cpp@0:c2377e4b3931, 2015-08-20 (annotated)
- Committer:
- omarrasheedk
- Date:
- Thu Aug 20 21:52:18 2015 +0000
- Revision:
- 0:c2377e4b3931
V1 of the ParallaxRobotShield library
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
omarrasheedk | 0:c2377e4b3931 | 1 | #include "mbed.h" |
omarrasheedk | 0:c2377e4b3931 | 2 | #include "ParallaxRobotShield.h" |
omarrasheedk | 0:c2377e4b3931 | 3 | |
omarrasheedk | 0:c2377e4b3931 | 4 | int main() |
omarrasheedk | 0:c2377e4b3931 | 5 | { |
omarrasheedk | 0:c2377e4b3931 | 6 | DigitalOut myled(PC_7); |
omarrasheedk | 0:c2377e4b3931 | 7 | ParallaxRobotShield Servo; |
omarrasheedk | 0:c2377e4b3931 | 8 | Servo.enable_right_motor(); |
omarrasheedk | 0:c2377e4b3931 | 9 | Servo.enable_left_motor(); |
omarrasheedk | 0:c2377e4b3931 | 10 | |
omarrasheedk | 0:c2377e4b3931 | 11 | // Commands |
omarrasheedk | 0:c2377e4b3931 | 12 | Servo.right(100); |
omarrasheedk | 0:c2377e4b3931 | 13 | Servo.right(100); |
omarrasheedk | 0:c2377e4b3931 | 14 | Servo.forward(100); |
omarrasheedk | 0:c2377e4b3931 | 15 | Servo.left(100); |
omarrasheedk | 0:c2377e4b3931 | 16 | Servo.left(100); |
omarrasheedk | 0:c2377e4b3931 | 17 | Servo.forward(100); |
omarrasheedk | 0:c2377e4b3931 | 18 | |
omarrasheedk | 0:c2377e4b3931 | 19 | |
omarrasheedk | 0:c2377e4b3931 | 20 | |
omarrasheedk | 0:c2377e4b3931 | 21 | |
omarrasheedk | 0:c2377e4b3931 | 22 | myled = !myled; |
omarrasheedk | 0:c2377e4b3931 | 23 | return 1; |
omarrasheedk | 0:c2377e4b3931 | 24 | } |