Yosuke Kirihata / Mbed 2 deprecated Nucleo_roomba

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Roomba.h Source File

Roomba.h

00001 #include "mbed.h"
00002 //#include "Data.h"
00003 
00004 #ifndef __ROOMBA_H_INCLUDED__
00005 #define __ROOMBA_H_INCLUDED__
00006 
00007 
00008 /**
00009  * ルンバ制御クラス
00010  */
00011 class Roomba {
00012     public:
00013         struct Mode
00014         {
00015             enum EMode
00016             {
00017                 Off,
00018                 Passive,
00019                 Safe,
00020                 Full
00021             };
00022         };
00023 
00024         Roomba(PinName tx, PinName rx);
00025         
00026         bool mode(Roomba::Mode::EMode m);
00027         //Mode getMode();
00028         bool start();
00029         bool drive (int rightWheelVelocity, int leftWheelVelocity);
00030         bool battery(int* batteryCapacity);
00031 
00032     protected:
00033         Serial _s;
00034     
00035     private:
00036         Roomba::Mode::EMode _mode;
00037 };
00038 
00039 #endif