Eurobot2012_Primary
Dependencies: mbed Eurobot_2012_Primary
Diff: front_arms.h
- Revision:
- 21:15da49f18c63
- Parent:
- 8:ffc7d8af2d5a
- Child:
- 23:1901cb6d0d95
--- a/front_arms.h Mon Apr 30 20:22:06 2012 +0000 +++ b/front_arms.h Tue May 01 16:54:44 2012 +0000 @@ -1,22 +1,22 @@ -#ifndef _FRONT_ARMS_H -#define _FRONT_ARMS_H - -#include "mbed.h" - -#define LEFT_ARM_PIN p21 -#define RIGHT_ARM_PIN p24 - -Servo leftServo(LEFT_ARM_PIN); -Servo rightServo(RIGHT_ARM_PIN); - -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); -} - +#ifndef _FRONT_ARMS_H +#define _FRONT_ARMS_H + +#include "mbed.h" + +#define LEFT_ARM_PIN p21 +#define RIGHT_ARM_PIN p24 + +Servo leftServo(LEFT_ARM_PIN); +Servo rightServo(RIGHT_ARM_PIN); + +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