tetsuya Ogata / Mbed 2 deprecated Enpra_practice06

Dependencies:   TA8428 mbed

Files at this revision

API Documentation at this revision

Comitter:
ogata_lab
Date:
Wed May 29 13:03:46 2013 +0000
Commit message:
first commit

Changed in this revision

TA8428.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r c6fc29c5ecd0 TA8428.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TA8428.lib	Wed May 29 13:03:46 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/ogata_lab/code/TA8428/#655b0ede301b
diff -r 000000000000 -r c6fc29c5ecd0 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed May 29 13:03:46 2013 +0000
@@ -0,0 +1,25 @@
+#include "mbed.h"
+#include "TA8428.h"
+
+DigitalIn sw01(p19);
+TA8428 driver(p21, p22);
+
+bool old_sw = false;
+bool direction_cw = true;
+
+int main() {
+    while(1) {
+      bool new_sw = sw01 == 0;
+      if (!old_sw && new_sw) {
+        direction_cw = !direction_cw;
+      }
+      old_sw = new_sw;
+      
+      if (direction_cw) {
+        driver.drive(0.5);
+      } else {
+        driver.drive(-0.5);
+      }
+    
+    }
+}
diff -r 000000000000 -r c6fc29c5ecd0 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed May 29 13:03:46 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/b3110cd2dd17
\ No newline at end of file