Curtis Sellier / Mbed 2 deprecated Project_Car_Curtis_Non_Tested

Dependencies:   Servo mbed

Files at this revision

API Documentation at this revision

Comitter:
csellier
Date:
Wed Nov 30 11:27:36 2016 +0000
Parent:
12:8ae6609a66bf
Commit message:
Almost Final Program non tested (Curtis version)

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 8ae6609a66bf -r bdb92f041eca main.cpp
--- a/main.cpp	Fri Oct 28 09:10:58 2016 +0000
+++ b/main.cpp	Wed Nov 30 11:27:36 2016 +0000
@@ -115,15 +115,18 @@
      //follow line
         if (LDRvalueright < VBORDER2 && LDRvalueleft > VBORDER1){ //ldr right is in the black and ldr left is in the white then turn right
             // turn right
-        
+             ServoRight.write(0.5);
+             ServoLeft.write(0.4);
             }
         if (LDRvalueright > VBORDER1 && LDRvalueleft < VBORDER2){   //ldr right is in the white and ldr left is in the black
-            //turn left   
-        
+            //turn left  
+            ServoRight.write(0.6);
+            ServoLeft.write(0.5);
             }
-        if LDRvalueright < VBORDER2 && LDRvalueleft < VBORDER2) {    //both ldr right and ldr left are in the black, continue ahead
+        if (LDRvalueright < VBORDER2 && LDRvalueleft < VBORDER2) {    //both ldr right and ldr left are in the black, continue ahead
             //go straight
-            
+            ServoRight.write(0.6);
+            ServoLeft.write(0.4);
             }