voltmeter

Dependencies:   TextLCD mbed

Files at this revision

API Documentation at this revision

Comitter:
mijimy
Date:
Fri Nov 13 02:16:49 2015 +0000
Commit message:
ver1

Changed in this revision

TextLCD.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
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 1331e9500387 TextLCD.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Fri Nov 13 02:16:49 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/TextLCD/#308d188a2d3a
diff -r 000000000000 -r 1331e9500387 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Nov 13 02:16:49 2015 +0000
@@ -0,0 +1,21 @@
+#include "mbed.h" 
+#include "TextLCD.h" 
+TextLCD lcd ( p26, p25, p24, p23, p22, p21 ) ; // rs, e, d4 d5, d6, d7
+AnalogIn Ain ( p17 ) ; 
+int percentage ; 
+float voltage;
+int main( ) 
+{   while(1) 
+    {   percentage = Ain * 100 ; 
+        lcd.locate ( 1 , 0 ); 
+        lcd.printf("percentage:");
+        lcd.printf ("%i" , percentage) ; 
+        voltage= Ain*3.30-0.3;
+        lcd.locate ( 1 , 1 ); 
+        lcd.printf("Voltage: ");
+        lcd.printf ("%.1f" , voltage) ; 
+        lcd.printf(" V");
+        wait(0.02) ; 
+        lcd.cls( ) ; 
+        } 
+}
diff -r 000000000000 -r 1331e9500387 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Nov 13 02:16:49 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9296ab0bfc11
\ No newline at end of file