Class for Futaba Servo motor RS3xx series
Dependents: Hobby_Humanoid_controlor
RS300.h@0:6b230fd13b40, 2013-09-11 (annotated)
- Committer:
- syundo0730
- Date:
- Wed Sep 11 18:29:27 2013 +0000
- Revision:
- 0:6b230fd13b40
- Child:
- 2:1ab1adf0915c
the first commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
syundo0730 | 0:6b230fd13b40 | 1 | #include "mbed.h" |
syundo0730 | 0:6b230fd13b40 | 2 | |
syundo0730 | 0:6b230fd13b40 | 3 | #include <vector> |
syundo0730 | 0:6b230fd13b40 | 4 | |
syundo0730 | 0:6b230fd13b40 | 5 | class RS300 { |
syundo0730 | 0:6b230fd13b40 | 6 | public: |
syundo0730 | 0:6b230fd13b40 | 7 | RS300(PinName tx, PinName rx); |
syundo0730 | 0:6b230fd13b40 | 8 | void send_servo_pos(uint8_t id_s, std::vector<uint16_t> &pos); |
syundo0730 | 0:6b230fd13b40 | 9 | void on_all_servo(); |
syundo0730 | 0:6b230fd13b40 | 10 | void off_all_servo(); |
syundo0730 | 0:6b230fd13b40 | 11 | private: |
syundo0730 | 0:6b230fd13b40 | 12 | 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 | 13 | private: |
syundo0730 | 0:6b230fd13b40 | 14 | Serial serial; |
syundo0730 | 0:6b230fd13b40 | 15 | }; |