トランジスタ技術2015年6月号mbedラジコン・カーp176 リスト1 車体を駆動するmbedメイン・プログラム

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
YoshihitoShimada
Date:
Mon Jun 01 02:49:08 2015 +0000
Commit message:
motor test program

Changed in this revision

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 0eb36cd53c5e main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Jun 01 02:49:08 2015 +0000
@@ -0,0 +1,26 @@
+#include "mbed.h"
+
+PwmOut Rin(P0_8); 
+PwmOut Lin(P0_9);
+
+DigitalOut IN1(P0_11);
+DigitalOut IN2(P0_12);
+
+int main() {
+    Rin=0.5; Lin=0.5;   // Speed
+    IN1=0; IN2=1;       // Forward
+    wait(3);            // 3sec
+
+    Rin=0.2; Lin=0.8;   // Left Turn
+    wait(2);            // 2 sec
+
+    Rin=0.8; Lin=0.2;   // Right Turn
+    wait(2);            // 2 sec
+
+    Rin=0.7; Lin=0.7;   // Speed
+    IN1=1; IN2=0;       // Backward
+    wait(3);            // 3 sec
+    
+    IN1=1; IN2=1;       // Stop
+    while(1);
+}               
\ No newline at end of file
diff -r 000000000000 -r 0eb36cd53c5e mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Jun 01 02:49:08 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/4fc01daae5a5
\ No newline at end of file