Mechatronics Robotics / Mbed 2 deprecated robotV5

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Brobot.h Source File

Brobot.h

00001 /*
00002  * Brobot.h
00003  *
00004  */
00005 
00006 #ifndef BROBOT_H_
00007 #define BROBOT_H_
00008 
00009 #include <cstdlib>
00010 #include <mbed.h>
00011 
00012 /**
00013  * This is a device driver class to drive the robot autonomously
00014  */
00015 class Brobot
00016 {
00017 
00018 public:
00019     // constructors have same name as the class
00020     Brobot(PwmOut* left, PwmOut* right, int number);
00021     Brobot();  //empty constructor
00022     
00023 
00024  //   void        init(PwmOut* left, PwmOut* right, int number);
00025     void        turnleft();
00026     void        turnright();
00027     void        forward();
00028     void        back();
00029     void        stop();
00030     void        slow(float ammount);  // ammount is subtracted from current speeds
00031     void        rotate(float ammount); // values from -0.5 to 0.5
00032     
00033 private:
00034     PwmOut*     pwmL;
00035     PwmOut*     pwmR;
00036     int         number;
00037 };
00038 
00039 #endif /* BROBOT_H_ */