works

Dependencies:   SRF05 mbed

Fork of SRF05_HelloWorld by Simon Ford

Revision:
5:df7cdf275ec9
Parent:
4:87d6d45092c5
Child:
6:fae63ea5ba75
--- a/main.cpp	Tue Nov 29 19:32:11 2016 +0000
+++ b/main.cpp	Tue Dec 06 14:44:31 2016 +0000
@@ -1,13 +1,8 @@
 // Simple program to read the distance from an SRF05 using the SRF05 library
 
 #include "mbed.h"
-#include "Adafruit_GFX.h"
-#include "Adafruit_SSD1306.h"
 #include "SRF05.h"
 
-SPIPreInit Gspi(p5, p6, p7);
-SPI spi(p5, p6, p7);
-Adafruit_SSD1306_Spi ssd(spi, p5, p6, p7);
 SRF05 srf(p9, p10);
  
 int main() { 
@@ -19,8 +14,7 @@
      while(1) { 
          curval = srf.read();
          percentage = 100-((curval-5)/range)*100;
-         printf ("P,V: %.0f (%.0f)\n\r", percentage, curval);
-         ssd.printf ("P,V: %.0f (%.0f)\n\r", percentage, curval);            
+         printf ("Percentage Remaining: %.0f (%.0f)\n\r", percentage, curval);             
          wait(0.2); 
      } 
  } 
\ No newline at end of file