na
Fork of SeeedShieldBot by
Diff: SeeedStudioShieldBot.h
- Revision:
- 0:227158f56a11
- Child:
- 1:5c40f2a5e1ac
diff -r 000000000000 -r 227158f56a11 SeeedStudioShieldBot.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SeeedStudioShieldBot.h Mon Jul 15 13:16:09 2013 +0000 @@ -0,0 +1,48 @@ +#include "mbed.h" + +class SeeedStudioShieldBot { + public: + + // Create a shield bot object, using default settings for now... + SeeedStudioShieldBot(); + + void left_motor(float speed); + void right_motor(float speed); + + // Like the two above, but both at the same speed. + // Negative of either will do the same job as the other (hopefully...) + void forward(float speed); + void backward(float speed); + + // This will rotate both of the motors in opposite directions, at the same speed + void left(float speed); + void right(float speed); + + void disable_motor_a(); + void disable_motor_b(); + + void enable_motor_a(); + void enable_motor_b(); + + void stopAll(); + + // Need to do something to do with detected line... + + float get_sensors_overall_value(); + + DigitalIn rightSensor; + DigitalIn inRightSensor; + DigitalIn centreSensor; + DigitalIn inLeftSensor; + DigitalIn leftSensor; + + private: + PwmOut motor1A; + DigitalOut motor1B; + DigitalOut motor1En; + + // motor2A or motor2B need to be PWM, but the freedom board doesn't support it at the moment... + PwmOut motor2A; + DigitalOut motor2B; + DigitalOut motor2En; +}; \ No newline at end of file