a

Dependencies:   MotorDriver_SU mbed

Files at this revision

API Documentation at this revision

Comitter:
12f2030a
Date:
Thu Oct 16 14:29:37 2014 +0000
Commit message:
a

Changed in this revision

MotorDriver_SU.lib Show annotated file Show diff for this revision Revisions of this file
linetrace.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 47cd78404bd9 MotorDriver_SU.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MotorDriver_SU.lib	Thu Oct 16 14:29:37 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/NT32/code/MotorDriver_SU/#e6c391eb8fac
diff -r 000000000000 -r 47cd78404bd9 linetrace.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/linetrace.cpp	Thu Oct 16 14:29:37 2014 +0000
@@ -0,0 +1,35 @@
+#include "mbed.h"
+#include "MotorDriver_SU.h"
+
+DigitalIn sensor1();
+DigitalIn sensor2();
+DigitalOut led1();
+DigitalOut led2();
+MotorDriver_SU motor(MOTOR_DOUBLE);
+MotorDriver_SU lift(MOTOR_SINGLE);
+
+int main(){
+    while(1){
+        if(sensor1 == 0 && sensor2 == 0){
+            motor.Drive(0,CW,3000);
+            motor.Drive(1,CW,3000);
+            lift.Drive(0,CW,3000);
+            led1 = 1;
+            } 
+        else if(sensor1 == 0 && sensor2 == 1){
+                motor.Drive(0,CW,3000);
+                motor.Drive(1,CCW,1500);
+                led1 = 0;
+                } 
+        else if(snsor1 == 1 && sensor2 == 0){
+                    motor.Drive(0,CCW,1500);
+                    motor.Drive(1,CW,3000);
+                    led2 = 1;
+                    }
+        else if(sensor == 1 && sensor ==1){
+                    motor.Drive(0,CCW,3000);
+                    motor.Drive(1,CCW,3000);
+                    led2 = 0;
+                    }
+              }
+            }
\ No newline at end of file
diff -r 000000000000 -r 47cd78404bd9 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Oct 16 14:29:37 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/552587b429a1
\ No newline at end of file