Intermittent 4180 project

Dependencies:   4DGL-uLCD-SE Motordriver PinDetect RemoteIR mbed-rtos mbed

Fork of Menu4180 by Brandon Lasater

Files at this revision

API Documentation at this revision

Comitter:
coconnell7
Date:
Fri May 01 13:34:33 2015 +0000
Parent:
1:6a969b21c9de
Commit message:
Revised

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri May 01 11:33:30 2015 +0000
+++ b/main.cpp	Fri May 01 13:34:33 2015 +0000
@@ -23,6 +23,7 @@
 RemoteIR::Format format;
 
 DigitalOut led1(LED1); //LED1 used for debugging purposes
+DigitalOut led2(LED2);
 //Timer t; //Timer used to calculate automated driving distance
 
 //Globals
@@ -45,9 +46,14 @@
 // IR module in front of robot, stop motors if object detected
 void IRmod(void const *args){
     while(1){
-        if(IRout < 0.45f && IRout > 0.25f){
+        if(IRout > 0.35f ){
             OnOff = false;
+            led2 = 1;
         }   
+        else{
+            //OnOff = false;
+            led2 = 0;
+        }
     }
 }
 
@@ -96,13 +102,13 @@
                         wait(0.001);
                         break;
                     case 0x03:
-                        left.speed(-0.8);
-                        right.speed(0.8);
+                        left.speed(-0.6);
+                        right.speed(0.6);
                         wait(0.001);
                         break;
                     case 0x05:
-                        left.speed(0.8);
-                        right.speed(-0.8);
+                        left.speed(0.6);
+                        right.speed(-0.6);
                         wait(0.001);
                         break;
                     case 0x07:
@@ -130,9 +136,9 @@
 }
 
 void rightTurn(){  //Turn bot 90 degrees right
-    left.speed(-0.8);
-    right.speed(0.8);
-    wait(0.6);
+    left.speed(-0.6);
+    right.speed(0.6);
+    wait(0.5);
     left.stop(1);
     right.stop(1);
 }