sornpraram xu / RMD
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers RMD.h Source File

RMD.h

00001 #ifndef RMD_H
00002 #define RMD_H
00003 
00004 #include "mbed.h"
00005 
00006 class RMD: public CAN{
00007     
00008     public:
00009         RMD(PinName rx, PinName tx);
00010 
00011         bool send_speed(int id, int speed);
00012         
00013         bool send_torque(int id, int torque);
00014         
00015         bool send_position(int id, int position, int speed);
00016 
00017         void read_pid();
00018 
00019         void int2byte(int num);
00020         
00021         void int2byte2(int pos, int speed);
00022         
00023         void status();
00024         
00025         int status_velocity();
00026         
00027         void status_position();
00028 
00029         char _data[4];
00030 
00031         char _data_sent[8];
00032 
00033         char _data_back[8];
00034 
00035         //void send_speed(int n);
00036 
00037         //unsigned char read_pid();
00038 
00039     private:
00040         unsigned char CANdata[6];   
00041         unsigned char CANsent[8];
00042         CANMessage msg;
00043         int freq;
00044         char id;
00045 };
00046 
00047 #endif