Clare Coleman / Mbed 2 deprecated UTCSBootcamp

Dependencies:   MMA8451Q mbed

Committer:
ccoleman
Date:
Thu Aug 22 20:50:08 2013 +0000
Revision:
0:2010bcffbae0
Child:
1:8408853a700c
Wrapped Freescale Cup code.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ccoleman 0:2010bcffbae0 1 #ifndef CAR_API_0yx22l34755
ccoleman 0:2010bcffbae0 2 #define CAR_API_0yx22l34755
ccoleman 0:2010bcffbae0 3
ccoleman 0:2010bcffbae0 4 /******************************** Init and Finish ********************************/
ccoleman 0:2010bcffbae0 5 void init();
ccoleman 0:2010bcffbae0 6
ccoleman 0:2010bcffbae0 7 void finish();
ccoleman 0:2010bcffbae0 8
ccoleman 0:2010bcffbae0 9 /******************************** Wheels and Motor ********************************/
ccoleman 0:2010bcffbae0 10
ccoleman 0:2010bcffbae0 11 /* turn the car. turnAngle should be between [-1,1] */
ccoleman 0:2010bcffbae0 12 void turn(float turnAngle);
ccoleman 0:2010bcffbae0 13
ccoleman 0:2010bcffbae0 14 /** move forward with the given power, turn angle, for a specified time */
ccoleman 0:2010bcffbae0 15 void move(float power, float seconds);
ccoleman 0:2010bcffbae0 16
ccoleman 0:2010bcffbae0 17 /** move forward with the given powers for each wheel, turn angle, for a specified time */
ccoleman 0:2010bcffbae0 18 void move(float leftWheelPower, float rightWheelPower, float seconds);
ccoleman 0:2010bcffbae0 19
ccoleman 0:2010bcffbae0 20 /** lock the wheels*/
ccoleman 0:2010bcffbae0 21 void parkingBrake();
ccoleman 0:2010bcffbae0 22
ccoleman 0:2010bcffbae0 23 /******************************** INPUTS AND OUTPUTS ********************************/
ccoleman 0:2010bcffbae0 24 /** check to see if the car is crashing into something */
ccoleman 0:2010bcffbae0 25 bool checkIsCrashing();
ccoleman 0:2010bcffbae0 26
ccoleman 0:2010bcffbae0 27 /** Return the line direction
ccoleman 0:2010bcffbae0 28 line to the left of center. return [-1,0
ccoleman 0:2010bcffbae0 29 line to the right of center. return (0,1]
ccoleman 0:2010bcffbae0 30 line in center. return 0
ccoleman 0:2010bcffbae0 31 */
ccoleman 0:2010bcffbae0 32 float lineDirection();
ccoleman 0:2010bcffbae0 33
ccoleman 0:2010bcffbae0 34 /* toggle led 0 */
ccoleman 0:2010bcffbae0 35 void toggleLED0();
ccoleman 0:2010bcffbae0 36
ccoleman 0:2010bcffbae0 37 /* toggle led 1 */
ccoleman 0:2010bcffbae0 38 void toggleLED1();
ccoleman 0:2010bcffbae0 39
ccoleman 0:2010bcffbae0 40 /* toggle led 2 */
ccoleman 0:2010bcffbae0 41 void toggleLED2();
ccoleman 0:2010bcffbae0 42
ccoleman 0:2010bcffbae0 43 /* toggle led 3 */
ccoleman 0:2010bcffbae0 44 void toggleLED3();
ccoleman 0:2010bcffbae0 45
ccoleman 0:2010bcffbae0 46 /** is Button B pressed */
ccoleman 0:2010bcffbae0 47 bool isButtonBPressed();
ccoleman 0:2010bcffbae0 48
ccoleman 0:2010bcffbae0 49 /** read Potentiometer 0. returns [-1,1] */
ccoleman 0:2010bcffbae0 50 float getPot0();
ccoleman 0:2010bcffbae0 51
ccoleman 0:2010bcffbae0 52 /** read Potentiometer 1. returns [-1,1] */
ccoleman 0:2010bcffbae0 53 float getPot1();
ccoleman 0:2010bcffbae0 54
ccoleman 0:2010bcffbae0 55 /** How much battery remains. returns [0,1] */
ccoleman 0:2010bcffbae0 56 float batteryLife();
ccoleman 0:2010bcffbae0 57
ccoleman 0:2010bcffbae0 58 /******************************** Changing Variables ********************************/
ccoleman 0:2010bcffbae0 59 /** set the base turn offset*/
ccoleman 0:2010bcffbae0 60 void setOffset(float _turnOffset);
ccoleman 0:2010bcffbae0 61
ccoleman 0:2010bcffbae0 62 /** get the base turn offset */
ccoleman 0:2010bcffbae0 63 float getOffset();
ccoleman 0:2010bcffbae0 64
ccoleman 0:2010bcffbae0 65 /** set the base crash sensitivity*/
ccoleman 0:2010bcffbae0 66 void setCrashSensitivity(float _sensitivity);
ccoleman 0:2010bcffbae0 67
ccoleman 0:2010bcffbae0 68 /** return the crash sensitivity */
ccoleman 0:2010bcffbae0 69 float getCrashSensitivity();
ccoleman 0:2010bcffbae0 70
ccoleman 0:2010bcffbae0 71 /** turn on debugging. prints each method call to the serial port*/
ccoleman 0:2010bcffbae0 72 void setDebug(bool _debug);
ccoleman 0:2010bcffbae0 73
ccoleman 0:2010bcffbae0 74
ccoleman 0:2010bcffbae0 75 #endif