Class for Futaba Servo motor RS3xx series

Dependents:   Hobby_Humanoid_controlor

Files at this revision

API Documentation at this revision

Comitter:
syundo0730
Date:
Wed Sep 25 12:28:31 2013 +0000
Parent:
1:64e11d4c49ae
Commit message:
duplicate includion prohibited

Changed in this revision

RS300.cpp Show annotated file Show diff for this revision Revisions of this file
RS300.h Show annotated file Show diff for this revision Revisions of this file
diff -r 64e11d4c49ae -r 1ab1adf0915c RS300.cpp
--- a/RS300.cpp	Thu Sep 12 17:57:41 2013 +0000
+++ b/RS300.cpp	Wed Sep 25 12:28:31 2013 +0000
@@ -32,7 +32,7 @@
 {
     std::vector<uint8_t> dat;
     dat.push_back(0x01);
-    for (uint8_t i = 0; i < 10; ++i) send_packet(0x24, dat, 1, i);//adress, on, servo amount, id(all)
+    for (uint8_t i = 1; i < 10; ++i) send_packet(0x24, dat, 1, i);//adress, on, servo amount, id(all)
 }
 
 void RS300::off_all_servo()
diff -r 64e11d4c49ae -r 1ab1adf0915c RS300.h
--- a/RS300.h	Thu Sep 12 17:57:41 2013 +0000
+++ b/RS300.h	Wed Sep 25 12:28:31 2013 +0000
@@ -1,3 +1,6 @@
+#ifndef _RS300_H_2013_9_10_
+#define _RS300_H_2013_9_10_
+
 #include "mbed.h"
 
 #include <vector>
@@ -12,4 +15,6 @@
     void send_packet(uint8_t adr, std::vector<uint8_t> &data, uint8_t cnt, uint8_t id = 0x00, uint8_t flag = 0x00);
 private:
     Serial serial;
-};
\ No newline at end of file
+};
+
+#endif