A program designed to get the distance from an SRF02 distance sensor and create an audible and visual indication of that distance with data logging capabilities.

Dependencies:   N5110 PowerControl SRF02 mbed

Revision:
10:b61013738793
Parent:
9:4a319e9db41c
Child:
11:41052065c916
--- a/main.cpp	Thu Apr 23 10:36:07 2015 +0000
+++ b/main.cpp	Thu Apr 23 15:12:49 2015 +0000
@@ -24,7 +24,7 @@
     display.printString("--++--++--++--",0,3);
     display.printString("Sam Russell",10,4);
     display.printString("--++--++--++--",0,5);
-    wait(2); ///Delay between the introduction and the begining of the game.
+    wait(4); ///Delay between the introduction and the begining of the game.
     display.clear(); ///Clears the display.
 }
 
@@ -74,7 +74,7 @@
             buzzer.period(1/261.63); ///Plays note 'Do'
             buzz=1;
         }
-    } if(distance>30) {
+    } if(distance>=30) {
         display.drawRect(2,2,8,16,1); ///Draw 1 Bar
         if(mode==0 && buzz==0) { ///when mode is normal buzz is zero, play a note.
             buzzer.period(1/246.94); ///Plays note 'Si'