Library for the Shield Bot by SeeedStudio

Dependents:   Seeed_Bot_Shield Seeed_BlueBot_demo Seeed_BlueBot_demo_test1 LAB03_Oppgav1 ... more

Fork of SeeedShieldBot by Components

SeeedStudioShieldBot.h

Committer:
melse
Date:
2013-07-15
Revision:
1:5c40f2a5e1ac
Parent:
0:227158f56a11
Child:
2:118efce95f3c

File content as of revision 1:5c40f2a5e1ac:

#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 line_position();
        
        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;
};