nikos chalikias
/
n-bed_LCD_ADC_RTC
testing n-bed
Diff: main.cpp
- Revision:
- 1:998fdef84813
- Parent:
- 0:8cd63f1ec3c9
- Child:
- 2:50bd6c03049b
--- a/main.cpp Thu Jan 22 14:50:37 2015 +0000 +++ b/main.cpp Thu Jan 22 15:09:49 2015 +0000 @@ -1,5 +1,4 @@ -// N.C. testing n-bed LCD - +// N.C. testing n-bed with LCD #include "mbed.h" #include "TextLCD.h" @@ -17,21 +16,23 @@ //Measure from a NON mbed analog pin AnalogIn input(P0_2); //the range of the analog input goes, from 0 V. to 3.3V. the actual value is represented as a float from 0 to 1. float ain; //ain must be a float, for matching the input.read type. +AnalogIn input2(P0_3); //the range of the analog input goes, from 0 V. to 3.3V. the actual value is represented as a float from 0 to 1. +float ain2; //ain must be a float, for matching the input.read type. int main() { t.start(); lcd.cls(); wait(1); - lcd.printf("Hello LCD World!\n"); lcd2.printf("Hello 2ND Display\n"); + lcd.printf("n-bed 1st Display\n"); lcd2.printf("n-bed 2nd Display\n"); while (1) { led1 = 1; ain=input.read(); lcd.locate(0,2); lcd2.locate(0,2); - lcd.printf("%1.1f mhnVolt", ( float(3.3)*ain) ) ; lcd2.printf("%1.1f mhnVolt", ( float(3.3)*ain) ) ; + lcd.printf("n-bed A3=%1.1f V", ( float(3.3)*ain) ) ; lcd2.printf("n-bed A3=%1.1f V", ( float(3.3)*ain) ) ; wait(0.001); - ain=input.read(); + ain2=input2.read(); lcd.locate(0,3); lcd2.locate(0,3); - lcd.printf("%1.1f Volt", ( float(3.3)*ain) ) ; lcd2.printf("%1.1f Volt", ( float(3.3)*ain) ) ; + lcd.printf("n-bed A4=%1.1f V", ( float(3.3)*ain2) ) ; lcd2.printf("n-bed A4=%1.1f V", ( float(3.3)*ain2) ) ; led1 = 0; wait(0.9); }