Class for Futaba Servo motor RS3xx series
Dependents: Hobby_Humanoid_controlor
RS300.h@2:1ab1adf0915c, 2013-09-25 (annotated)
- Committer:
- syundo0730
- Date:
- Wed Sep 25 12:28:31 2013 +0000
- Revision:
- 2:1ab1adf0915c
- Parent:
- 0:6b230fd13b40
duplicate includion prohibited
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
syundo0730 | 2:1ab1adf0915c | 1 | #ifndef _RS300_H_2013_9_10_ |
syundo0730 | 2:1ab1adf0915c | 2 | #define _RS300_H_2013_9_10_ |
syundo0730 | 2:1ab1adf0915c | 3 | |
syundo0730 | 0:6b230fd13b40 | 4 | #include "mbed.h" |
syundo0730 | 0:6b230fd13b40 | 5 | |
syundo0730 | 0:6b230fd13b40 | 6 | #include <vector> |
syundo0730 | 0:6b230fd13b40 | 7 | |
syundo0730 | 0:6b230fd13b40 | 8 | class RS300 { |
syundo0730 | 0:6b230fd13b40 | 9 | public: |
syundo0730 | 0:6b230fd13b40 | 10 | RS300(PinName tx, PinName rx); |
syundo0730 | 0:6b230fd13b40 | 11 | void send_servo_pos(uint8_t id_s, std::vector<uint16_t> &pos); |
syundo0730 | 0:6b230fd13b40 | 12 | void on_all_servo(); |
syundo0730 | 0:6b230fd13b40 | 13 | void off_all_servo(); |
syundo0730 | 0:6b230fd13b40 | 14 | private: |
syundo0730 | 0:6b230fd13b40 | 15 | void send_packet(uint8_t adr, std::vector<uint8_t> &data, uint8_t cnt, uint8_t id = 0x00, uint8_t flag = 0x00); |
syundo0730 | 0:6b230fd13b40 | 16 | private: |
syundo0730 | 0:6b230fd13b40 | 17 | Serial serial; |
syundo0730 | 2:1ab1adf0915c | 18 | }; |
syundo0730 | 2:1ab1adf0915c | 19 | |
syundo0730 | 2:1ab1adf0915c | 20 | #endif |