RMD-X Motor Library - Last Update V0.5 - On going...... Current available Function - read velocity - read all data - send velocity - send position
RMD.h@0:433e4ec5de88, 2020-11-04 (annotated)
- Committer:
- sornpraram
- Date:
- Wed Nov 04 09:20:53 2020 +0000
- Revision:
- 0:433e4ec5de88
- Child:
- 3:83fc10ac844c
0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sornpraram | 0:433e4ec5de88 | 1 | #ifndef RMD_H |
sornpraram | 0:433e4ec5de88 | 2 | #define RMD_H |
sornpraram | 0:433e4ec5de88 | 3 | |
sornpraram | 0:433e4ec5de88 | 4 | #include "mbed.h" |
sornpraram | 0:433e4ec5de88 | 5 | |
sornpraram | 0:433e4ec5de88 | 6 | class RMD: public CAN{ |
sornpraram | 0:433e4ec5de88 | 7 | |
sornpraram | 0:433e4ec5de88 | 8 | public: |
sornpraram | 0:433e4ec5de88 | 9 | RMD(PinName rx, PinName tx); |
sornpraram | 0:433e4ec5de88 | 10 | |
sornpraram | 0:433e4ec5de88 | 11 | bool send_speed(int id, int speed); |
sornpraram | 0:433e4ec5de88 | 12 | |
sornpraram | 0:433e4ec5de88 | 13 | bool send_torque(int id, int torque); |
sornpraram | 0:433e4ec5de88 | 14 | |
sornpraram | 0:433e4ec5de88 | 15 | bool send_position(int id, int position); |
sornpraram | 0:433e4ec5de88 | 16 | |
sornpraram | 0:433e4ec5de88 | 17 | void read_pid(); |
sornpraram | 0:433e4ec5de88 | 18 | |
sornpraram | 0:433e4ec5de88 | 19 | void int2byte(int num); |
sornpraram | 0:433e4ec5de88 | 20 | |
sornpraram | 0:433e4ec5de88 | 21 | void status(); |
sornpraram | 0:433e4ec5de88 | 22 | |
sornpraram | 0:433e4ec5de88 | 23 | status_velocity(); |
sornpraram | 0:433e4ec5de88 | 24 | |
sornpraram | 0:433e4ec5de88 | 25 | char _data[4]; |
sornpraram | 0:433e4ec5de88 | 26 | |
sornpraram | 0:433e4ec5de88 | 27 | char _data_sent[8]; |
sornpraram | 0:433e4ec5de88 | 28 | |
sornpraram | 0:433e4ec5de88 | 29 | char _data_back[8]; |
sornpraram | 0:433e4ec5de88 | 30 | |
sornpraram | 0:433e4ec5de88 | 31 | //void send_speed(int n); |
sornpraram | 0:433e4ec5de88 | 32 | |
sornpraram | 0:433e4ec5de88 | 33 | //unsigned char read_pid(); |
sornpraram | 0:433e4ec5de88 | 34 | |
sornpraram | 0:433e4ec5de88 | 35 | private: |
sornpraram | 0:433e4ec5de88 | 36 | unsigned char CANdata[4]; |
sornpraram | 0:433e4ec5de88 | 37 | unsigned char CANsent[8]; |
sornpraram | 0:433e4ec5de88 | 38 | CANMessage msg; |
sornpraram | 0:433e4ec5de88 | 39 | int freq; |
sornpraram | 0:433e4ec5de88 | 40 | char id; |
sornpraram | 0:433e4ec5de88 | 41 | }; |
sornpraram | 0:433e4ec5de88 | 42 | |
sornpraram | 0:433e4ec5de88 | 43 | #endif |