Test program to play motion with XBus servos.

Dependencies:   XBusServo mbed

This is just a working sample. This code will play motion with XBus servos. This is not finished :-). Tested only on KL25Z.

これは単なる動作サンプルです。 XBusサーボを使ってモーションの再生を行います。 まだまだ未完です(^_^;) KL25Z上でのみ動作確認しています。

Files at this revision

API Documentation at this revision

Comitter:
sawa
Date:
Wed Nov 05 08:47:14 2014 +0000
Parent:
1:4b239aea14f4
Commit message:
add error check at init

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 4b239aea14f4 -r ca608c24a14e main.cpp
--- a/main.cpp	Wed Nov 05 07:36:23 2014 +0000
+++ b/main.cpp	Wed Nov 05 08:47:14 2014 +0000
@@ -136,8 +136,13 @@
     }
 
     // initialize XBus Servos
-    for (counter = 0; counter < kMaxServoNum; counter++)
-        gXBus.addServo(servoChannel[counter], kXbusServoNeutral);
+    for (counter = 0; counter < kMaxServoNum; counter++) {
+        result = gXBus.addServo(servoChannel[counter], kXbusServoNeutral);
+        if (result != kXBusError_NoError) {
+            gXBus.stop();
+            return result;
+        }
+    }
 
     return kXBusError_NoError;
 }