Shunsaku Kume / Mbed 2 deprecated spectrasymbol

Dependencies:   mbed TextLCD

Revision:
0:37ce5da9a5f0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Aug 03 08:08:02 2022 +0000
@@ -0,0 +1,20 @@
+#include "mbed.h"
+#include "TextLCD.h"
+
+
+TextLCD lcd(p24, p26, p27, p28, p29, p30); // rs, e, d4-d7
+AnalogIn ain(p15);
+
+int main() {
+    float adc, volts, mm;
+    
+    while (1){
+        lcd.locate(0,0);
+        adc = ain.read();           // read analog as a float
+        volts = 1-adc ;          // convert to volts
+        mm = volts *100 ;    
+        lcd.printf("%8.3f mm\n", mm);
+
+        wait(0.05);                 // 20Hz update rate
+    }
+}
\ No newline at end of file