Eurobot2012_Primary
Dependencies: mbed Eurobot_2012_Primary
front_arms.h@26:0995f61cb7b8, 2012-10-17 (annotated)
- Committer:
- narshu
- Date:
- Wed Oct 17 22:22:47 2012 +0000
- Revision:
- 26:0995f61cb7b8
- Parent:
- 23:1901cb6d0d95
Eurobot 2012 Primary;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
narshu | 21:15da49f18c63 | 1 | #ifndef _FRONT_ARMS_H |
narshu | 21:15da49f18c63 | 2 | #define _FRONT_ARMS_H |
narshu | 21:15da49f18c63 | 3 | |
narshu | 21:15da49f18c63 | 4 | #include "mbed.h" |
narshu | 23:1901cb6d0d95 | 5 | #include "Servo.h" |
narshu | 21:15da49f18c63 | 6 | |
narshu | 21:15da49f18c63 | 7 | #define LEFT_ARM_PIN p21 |
narshu | 21:15da49f18c63 | 8 | #define RIGHT_ARM_PIN p24 |
narshu | 21:15da49f18c63 | 9 | |
narshu | 21:15da49f18c63 | 10 | Servo leftServo(LEFT_ARM_PIN); |
narshu | 21:15da49f18c63 | 11 | Servo rightServo(RIGHT_ARM_PIN); |
narshu | 21:15da49f18c63 | 12 | |
narshu | 23:1901cb6d0d95 | 13 | void ArmsOpen(void) { |
narshu | 23:1901cb6d0d95 | 14 | leftServo.SetPosition(1900); |
narshu | 23:1901cb6d0d95 | 15 | rightServo.SetPosition(1000); |
narshu | 23:1901cb6d0d95 | 16 | } |
narshu | 23:1901cb6d0d95 | 17 | void ArmsClose(void) { |
narshu | 23:1901cb6d0d95 | 18 | leftServo.SetPosition(1000); |
narshu | 23:1901cb6d0d95 | 19 | rightServo.SetPosition(1900); |
narshu | 21:15da49f18c63 | 20 | } |
narshu | 21:15da49f18c63 | 21 | |
narshu | 23:1901cb6d0d95 | 22 | void ArmsEnable(void) { |
narshu | 23:1901cb6d0d95 | 23 | leftServo.Enable(1000,20000); |
narshu | 23:1901cb6d0d95 | 24 | rightServo.Enable(1000,20000); |
narshu | 21:15da49f18c63 | 25 | } |
narshu | 21:15da49f18c63 | 26 | |
narshu | 7:f9c59a3e4155 | 27 | #endif // _FRONT_ARMS_H |