Preliminary sample code for using the rangefinder.

Dependencies:   ISR_Mini-explorer_tmp2

Files at this revision

API Documentation at this revision

Comitter:
fabiofaria
Date:
Fri May 11 19:22:44 2018 +0000
Parent:
1:8fd592bac4de
Child:
3:f6a9a5b79268
Commit message:
LED to inform robot communication added.; Odometry small change.

Changed in this revision

ISR_Mini-explorer.lib 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
--- a/ISR_Mini-explorer.lib	Wed May 02 14:05:07 2018 +0000
+++ b/ISR_Mini-explorer.lib	Fri May 11 19:22:44 2018 +0000
@@ -1,1 +1,1 @@
-https://os.mbed.com/users/fabiofaria/code/ISR_Mini-explorer_tmp2/#f6fddeae358e
+https://os.mbed.com/users/fabiofaria/code/ISR_Mini-explorer_tmp2/#43215ff15665
--- a/main.cpp	Wed May 02 14:05:07 2018 +0000
+++ b/main.cpp	Fri May 11 19:22:44 2018 +0000
@@ -6,6 +6,9 @@
 int main()
 {
     initRobot(124);
+    X=20;
+    Y=20;
+    THETA=0;
 
     while(1) {
         if( read_rangefinder() == 0 ) {
@@ -14,6 +17,11 @@
             }
             pc.printf("\n");
         }
+        else
+        {
+            pc.printf("Rangefinder reading failed!\n");
+            q_led_red_rea = 0; // Turns ON rear red LED.
+        }
 
         wait(0.5);
     }