Eurobot2012_Primary
Dependencies: mbed Eurobot_2012_Primary
Diff: front_arms.h
- Revision:
- 8:ffc7d8af2d5a
- Parent:
- 7:f9c59a3e4155
- Child:
- 21:15da49f18c63
--- a/front_arms.h Fri Apr 27 16:37:26 2012 +0000 +++ b/front_arms.h Fri Apr 27 18:36:54 2012 +0000 @@ -1,15 +1,22 @@ #ifndef _FRONT_ARMS_H #define _FRONT_ARMS_H -#include"mbed.h" +#include "mbed.h" #define LEFT_ARM_PIN p21 #define RIGHT_ARM_PIN p24 -Ser +Servo leftServo(LEFT_ARM_PIN); +Servo rightServo(RIGHT_ARM_PIN); -void frontArmsInit() { - +void setLeftArmPosition(float degrees) { + if(degrees < 90) degrees = 90; // If arm moves past this angle, robot will not fit in the perimeter constraint + leftServo.position(degrees); +} + +void setRightArmPosition(float degrees) { + if(degrees > 90) degrees = 90; // If arm moves past this angle, robot will not fit in the perimeter constraint + rightServo.position(degrees); } #endif // _FRONT_ARMS_H \ No newline at end of file