NUR BAHIRAH MUHAMAD @ ABD RAHMAN / Mbed 2 deprecated ADC_TEST

Dependencies:   TextLCD mbed

Files at this revision

API Documentation at this revision

Comitter:
Bahirah
Date:
Thu May 24 05:30:16 2018 +0000
Commit message:
ADC_SWITCH

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Thu May 24 05:30:16 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/TextLCD/#308d188a2d3a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu May 24 05:30:16 2018 +0000
@@ -0,0 +1,43 @@
+
+#include "mbed.h"
+#include "TextLCD.h"
+
+TextLCD lcd(D8, D9, D4, D5, D6, D7);
+Serial pc(USBTX, USBRX);
+AnalogIn Ain(PC_3);
+DigitalIn pb (PA_12);
+float ADCdata;
+
+int main() {
+    lcd.cls();
+    lcd.locate(1,0);
+    lcd.printf ("Temp Measure");
+
+            while (1) 
+            {   
+                ADCdata=Ain;
+                ADCdata=ADCdata*100;
+                
+                
+                if (pb == 0)
+                {
+                    lcd.locate (0,1);
+                    lcd.printf ("Cel:");
+            
+                    lcd.locate (4,1);
+                    lcd.printf ("%2.2f", ADCdata);
+                    
+                }
+                else if (pb == 1)
+                {   
+                
+                    lcd.locate (8,1);
+                    lcd.printf ("Fah:", ADCdata);
+                    
+                    lcd.locate (12,1);
+                    lcd.printf ("%2.2f", ADCdata);
+                    
+                }
+                wait (0.5);
+            }
+            }   
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu May 24 05:30:16 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/5aab5a7997ee
\ No newline at end of file