Eurobot2012_Primary

Dependencies:   mbed Eurobot_2012_Primary

Committer:
narshu
Date:
Fri Apr 27 18:36:54 2012 +0000
Revision:
8:ffc7d8af2d5a
Parent:
7:f9c59a3e4155
Child:
21:15da49f18c63
UI is working

Who changed what in which revision?

UserRevisionLine numberNew contents of line
narshu 7:f9c59a3e4155 1 #ifndef _FRONT_ARMS_H
narshu 7:f9c59a3e4155 2 #define _FRONT_ARMS_H
narshu 7:f9c59a3e4155 3
narshu 8:ffc7d8af2d5a 4 #include "mbed.h"
narshu 7:f9c59a3e4155 5
narshu 7:f9c59a3e4155 6 #define LEFT_ARM_PIN p21
narshu 7:f9c59a3e4155 7 #define RIGHT_ARM_PIN p24
narshu 7:f9c59a3e4155 8
narshu 8:ffc7d8af2d5a 9 Servo leftServo(LEFT_ARM_PIN);
narshu 8:ffc7d8af2d5a 10 Servo rightServo(RIGHT_ARM_PIN);
narshu 7:f9c59a3e4155 11
narshu 8:ffc7d8af2d5a 12 void setLeftArmPosition(float degrees) {
narshu 8:ffc7d8af2d5a 13 if(degrees < 90) degrees = 90; // If arm moves past this angle, robot will not fit in the perimeter constraint
narshu 8:ffc7d8af2d5a 14 leftServo.position(degrees);
narshu 8:ffc7d8af2d5a 15 }
narshu 8:ffc7d8af2d5a 16
narshu 8:ffc7d8af2d5a 17 void setRightArmPosition(float degrees) {
narshu 8:ffc7d8af2d5a 18 if(degrees > 90) degrees = 90; // If arm moves past this angle, robot will not fit in the perimeter constraint
narshu 8:ffc7d8af2d5a 19 rightServo.position(degrees);
narshu 7:f9c59a3e4155 20 }
narshu 7:f9c59a3e4155 21
narshu 7:f9c59a3e4155 22 #endif // _FRONT_ARMS_H