DRのPS3での操作用(アームの開閉をコントローラで制御可能)
Dependencies: mbed CalPID motorout ros_lib_melodic MotorController_AbsEC
Diff: KondoServoLibrary/KondoServo.h
- Revision:
- 0:83b2c6a67cce
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/KondoServoLibrary/KondoServo.h Thu Jul 08 03:46:29 2021 +0000 @@ -0,0 +1,29 @@ +#ifndef __KONDO_SERVO_H__ +#define __KONDO_SERVO_H__ + +#include "mbed.h" +#include "SerialHalfDuplex.h" + +typedef enum ServoMode{single = 0,multi = 1}s_mode; +typedef unsigned char u8; + +class KondoServo{ + protected: + unsigned int baudrate; + s_mode mode; + SerialHalfDuplex master; + + public: + void init(int baud); + void init(); + + void setSpeed(int id, u8 speed); + float readSpeed(int id); + int set_degree(int id,float degree); + void setID(u8 id); + u8 readID(); + ~KondoServo(); + KondoServo(PinName txPin,PinName rxPin, int quantity=2, unsigned int baud=115200); + +}; +#endif \ No newline at end of file