Dependents:   Serialservo_01 nhk_2018_undercarry_test08 nhk_2018_undercarry_test09 nhk_2018_undercarry_test10 ... more

Revision:
2:da6abd6afe26
Parent:
1:4caf52a715c2
--- a/Serialservo.h	Mon Nov 05 09:09:16 2018 +0000
+++ b/Serialservo.h	Fri Nov 23 08:38:33 2018 +0000
@@ -1,20 +1,29 @@
 #ifndef SERIALSERVO_H
 #define SERIALSERVO_H
 
+#define ICS_POS_CMD 0x80
+#define ICS_PARA_WRITE_COMMND 0xC0
+#define SUB_ST_COMMND 0x01
+#define SUB_SP_COMMND 0x02
+
 #include "mbed.h"
 
+
 class Serialservo{
 public  :    
-    Serialservo(PinName TX, PinName RX);
+    Serialservo(PinName TX, PinName RX, PinName Dout);
     void init();
-    void move(char id,int value);//0~270
-    void stretch(char id,int value);//0~127
-    void speed(char id,int value);//0~127
+    void move(char id,int pos);//0~270
+    void stretch(char id,int str);//0~127
+    void speed(char id,int spe);//0~127
     
 private :
     Serial ser;
-    unsigned char servoval;
+    DigitalOut switching;
+    unsigned char tx_data[3];
     long map(long x, long in_min, long in_max, long out_min, long out_max);
+    void flush();
+    void transmission();
 };
 
 #endif
\ No newline at end of file