モータ出力例スイッチ付き ロボット製作セミナー演習

Dependencies:   TB6612FNG2 mbed

Revision:
0:e0b05fdd3b73
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Aug 10 03:27:49 2013 +0000
@@ -0,0 +1,23 @@
+#include "mbed.h"
+#include "TB6612.h"
+
+DigitalOut myled(LED1);
+TB6612 left(p21,p12,p11);
+TB6612 right(p22,p14,p13);
+DigitalIn sw(p29);
+
+int main() {
+
+    sw.mode(PullUp);
+    
+    while(sw==1);
+    
+    while(1) {
+        left = 100;
+        right = 100;
+        wait(2.0);
+        left = -100;
+        right = -100;
+        wait(2.0);
+   }
+}