Clare Coleman / Mbed 2 deprecated UTCSBootcamp

Dependencies:   MMA8451Q mbed

Committer:
ccoleman
Date:
Thu Aug 22 21:11:14 2013 +0000
Revision:
1:8408853a700c
Parent:
0:2010bcffbae0
Child:
2:0a64af7ab7c6
Generated CarAPI documentation.

Who changed what in which revision?

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