T Arai / Futaba_servo140922
Revision:
0:5387fecc249c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Futaba485.h	Sat Dec 26 14:12:18 2015 +0000
@@ -0,0 +1,22 @@
+#ifndef MBED_FUTABA_SERVO_H
+#define MBED_FUTABA_SERVO_H
+
+#include "mbed.h"
+
+class Futaba {
+private:
+    Serial _device;         // tx, rx
+    DigitalOut _REDE; //transmitt enable or disenable
+
+public:
+    Futaba(PinName tx ,PinName rx, PinName REDE);
+    void init();
+    void setTmax(unsigned char ID, unsigned char data);
+    void torqueOn (unsigned char ID);
+    void torqueOff (unsigned char ID);
+    void setPosition (unsigned char ID, int data);
+    void setPosition_long123 (int data1,int data2, int data3); //ID 1~3
+    void setTslope(unsigned char ID, unsigned char CW, unsigned char CCW);//00H~FFH 0deg~255deg
+};
+
+#endif
\ No newline at end of file