test
Dependencies: mbed ros_lib_kinetic nhk19mr2_can_info splitData SerialHalfDuplex_HM
KondoServoLibrary_old/KondoServo.h@50:36741e8ab197, 2019-03-11 (annotated)
- Committer:
- shimizuta
- Date:
- Mon Mar 11 10:38:07 2019 +0000
- Revision:
- 50:36741e8ab197
- Parent:
- 2:a92568bdeb5c
a
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
shimizuta | 2:a92568bdeb5c | 1 | #ifndef __KONDO_SERVO_H__ |
shimizuta | 2:a92568bdeb5c | 2 | #define __KONDO_SERVO_H__ |
shimizuta | 2:a92568bdeb5c | 3 | |
shimizuta | 2:a92568bdeb5c | 4 | #include "mbed.h" |
shimizuta | 2:a92568bdeb5c | 5 | #include "SerialHalfDuplex.h" |
shimizuta | 2:a92568bdeb5c | 6 | |
shimizuta | 2:a92568bdeb5c | 7 | typedef enum ServoMode{single = 0,multi = 1}s_mode; |
shimizuta | 2:a92568bdeb5c | 8 | typedef unsigned char u8; |
shimizuta | 2:a92568bdeb5c | 9 | |
shimizuta | 2:a92568bdeb5c | 10 | class KondoServo{ |
shimizuta | 2:a92568bdeb5c | 11 | protected: |
shimizuta | 2:a92568bdeb5c | 12 | unsigned int baudrate; |
shimizuta | 2:a92568bdeb5c | 13 | s_mode mode; |
shimizuta | 2:a92568bdeb5c | 14 | SerialHalfDuplex master; |
shimizuta | 2:a92568bdeb5c | 15 | |
shimizuta | 2:a92568bdeb5c | 16 | public: |
shimizuta | 2:a92568bdeb5c | 17 | void init(int baud); |
shimizuta | 2:a92568bdeb5c | 18 | void init(); |
shimizuta | 2:a92568bdeb5c | 19 | |
shimizuta | 2:a92568bdeb5c | 20 | void setSpeed(int id, u8 speed); |
shimizuta | 2:a92568bdeb5c | 21 | float readSpeed(int id); |
shimizuta | 2:a92568bdeb5c | 22 | int set_degree(int id,float degree); |
shimizuta | 2:a92568bdeb5c | 23 | void setID(u8 id); |
shimizuta | 2:a92568bdeb5c | 24 | u8 readID(); |
shimizuta | 2:a92568bdeb5c | 25 | ~KondoServo(); |
shimizuta | 2:a92568bdeb5c | 26 | KondoServo(PinName txPin,PinName rxPin, int quantity=2, unsigned int baud=115200); |
shimizuta | 2:a92568bdeb5c | 27 | |
shimizuta | 2:a92568bdeb5c | 28 | }; |
shimizuta | 2:a92568bdeb5c | 29 | #endif |