kondoSerialservo krs6003rhv

Dependents:   quad_spider_nhk2019_04

Files at this revision

API Documentation at this revision

Comitter:
kenken0721
Date:
Wed May 01 03:47:13 2019 +0000
Parent:
2:a1e245feb5a2
Commit message:
kondo

Changed in this revision

SerialServo.cpp Show annotated file Show diff for this revision Revisions of this file
SerialServo.h Show annotated file Show diff for this revision Revisions of this file
--- a/SerialServo.cpp	Sun Mar 17 11:24:38 2019 +0000
+++ b/SerialServo.cpp	Wed May 01 03:47:13 2019 +0000
@@ -33,3 +33,13 @@
     transmission();//送信
 }
 
+void SerialServo::speed(char id,int spe){
+    int temp1 = SUB_SP_COMMND;
+    int temp2 = spe;
+    tx_data[0] = ICS_PARA_WRITE_COMMND | id;
+    tx_data[1] = (unsigned char)temp1;
+    tx_data[2] = (unsigned char)temp2;
+    transmission();//送信
+}
+
+
--- a/SerialServo.h	Sun Mar 17 11:24:38 2019 +0000
+++ b/SerialServo.h	Wed May 01 03:47:13 2019 +0000
@@ -14,7 +14,7 @@
     SerialServo(PinName TX, PinName RX);
     void init();
     void move(char id,int pos);
-    
+    void speed(char id,int spe);//0~127
 private :
     Serial ser;
     unsigned char tx_data[3];