Eurobot2012_Primary
Dependencies: mbed Eurobot_2012_Primary
front_arms.h@21:15da49f18c63, 2012-05-01 (annotated)
- Committer:
- narshu
- Date:
- Tue May 01 16:54:44 2012 +0000
- Revision:
- 21:15da49f18c63
- Parent:
- 8:ffc7d8af2d5a
- Child:
- 23:1901cb6d0d95
Added support for both starting locs (except AI target mirroring)
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 | 21:15da49f18c63 | 5 | |
narshu | 21:15da49f18c63 | 6 | #define LEFT_ARM_PIN p21 |
narshu | 21:15da49f18c63 | 7 | #define RIGHT_ARM_PIN p24 |
narshu | 21:15da49f18c63 | 8 | |
narshu | 21:15da49f18c63 | 9 | Servo leftServo(LEFT_ARM_PIN); |
narshu | 21:15da49f18c63 | 10 | Servo rightServo(RIGHT_ARM_PIN); |
narshu | 21:15da49f18c63 | 11 | |
narshu | 21:15da49f18c63 | 12 | void setLeftArmPosition(float degrees) { |
narshu | 21:15da49f18c63 | 13 | if(degrees < 90) degrees = 90; // If arm moves past this angle, robot will not fit in the perimeter constraint |
narshu | 21:15da49f18c63 | 14 | leftServo.position(degrees); |
narshu | 21:15da49f18c63 | 15 | } |
narshu | 21:15da49f18c63 | 16 | |
narshu | 21:15da49f18c63 | 17 | void setRightArmPosition(float degrees) { |
narshu | 21:15da49f18c63 | 18 | if(degrees > 90) degrees = 90; // If arm moves past this angle, robot will not fit in the perimeter constraint |
narshu | 21:15da49f18c63 | 19 | rightServo.position(degrees); |
narshu | 21:15da49f18c63 | 20 | } |
narshu | 21:15da49f18c63 | 21 | |
narshu | 7:f9c59a3e4155 | 22 | #endif // _FRONT_ARMS_H |