BIPBIP CARRE

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
syasya
Date:
Tue Jun 06 09:35:06 2017 +0000
Commit message:
BIPBIP CARRE

Changed in this revision

carre1/main.cpp Show annotated file Show diff for this revision Revisions of this file
carre1/mbed.bld 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 929b9389852e carre1/main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/carre1/main.cpp	Tue Jun 06 09:35:06 2017 +0000
@@ -0,0 +1,63 @@
+#include "mbed.h"
+#define periode 0.0001
+#define tourne 0.81
+#define dist 2.27
+
+DigitalIn fdc(D2);
+DigitalIn jack(D3);
+AnalogIn captg(A1);
+AnalogIn capteg(A2);
+AnalogIn capted(A3);
+AnalogIn captd(A4);
+PwmOut motg(D6);
+PwmOut motd(D8);
+DigitalOut Smot1(D7);
+DigitalOut Smot2(D9);
+
+int main()
+
+{
+    int ic,dist=ic;
+    motg.period(periode);
+    motd.period(periode);
+
+    if(jack.read()==1) {
+
+        Smot1.write(1);
+        Smot2.write(1);
+
+        //roule
+
+        motd.pulsewidth(0.00007);
+        motg.pulsewidth(0.00007);
+        wait(dist);
+        motd.pulsewidth(0.00007);
+        motg.pulsewidth(0.0001);
+        wait(tourne);
+
+        motd.pulsewidth(0.00007);
+        motg.pulsewidth(0.00007);
+        wait(dist);
+        motd.pulsewidth(0.00007);
+        motg.pulsewidth(0.0001);
+        wait(tourne);
+
+        motd.pulsewidth(0.00007);
+        motg.pulsewidth(0.00007);
+        wait(dist);
+        motd.pulsewidth(0.00007);
+        motg.pulsewidth(0.0001);
+        wait(tourne);
+
+        motd.pulsewidth(0.00007);
+        motg.pulsewidth(0.00007);
+        wait(dist);
+        motd.pulsewidth(0.00007);
+        motg.pulsewidth(0.0001);
+        wait(tourne);
+
+        motd.pulsewidth(0.0001);
+        motg.pulsewidth(0.0001);
+        wait(100000);
+    }
+}
diff -r 000000000000 -r 929b9389852e carre1/mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/carre1/mbed.bld	Tue Jun 06 09:35:06 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/ad3be0349dc5
\ No newline at end of file
diff -r 000000000000 -r 929b9389852e main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Jun 06 09:35:06 2017 +0000
@@ -0,0 +1,59 @@
+#include "mbed.h"
+#define periode 0.0001
+#define tourne 0.81
+#define dist 2.27
+
+DigitalIn fdc(D2);
+DigitalIn jack(D3);
+PwmOut motg(D6);
+PwmOut motd(D8);
+DigitalOut Smot1(D7);
+DigitalOut Smot2(D9);
+
+int main()
+
+{
+    int ib,dist=ib;
+    motg.period(periode);
+    motd.period(periode);
+
+    if(jack.read()==1) {
+
+        Smot1.write(1);
+        Smot2.write(1);
+
+        //roule
+
+        motd.pulsewidth(0.00007);
+        motg.pulsewidth(0.00007);
+        wait(dist);
+        motd.pulsewidth(0.00007);
+        motg.pulsewidth(0.0001);
+        wait(tourne);
+
+        motd.pulsewidth(0.00007);
+        motg.pulsewidth(0.00007);
+        wait(dist);
+        motd.pulsewidth(0.00007);
+        motg.pulsewidth(0.0001);
+        wait(tourne);
+
+        motd.pulsewidth(0.00007);
+        motg.pulsewidth(0.00007);
+        wait(dist);
+        motd.pulsewidth(0.00007);
+        motg.pulsewidth(0.0001);
+        wait(tourne);
+
+        motd.pulsewidth(0.00007);
+        motg.pulsewidth(0.00007);
+        wait(dist);
+        motd.pulsewidth(0.00007);
+        motg.pulsewidth(0.0001);
+        wait(tourne);
+
+        motd.pulsewidth(0.0001);
+        motg.pulsewidth(0.0001);
+        wait(100000);
+    }
+}
diff -r 000000000000 -r 929b9389852e mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Jun 06 09:35:06 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/ad3be0349dc5
\ No newline at end of file