bernard rayappa
/
lcdmonitor
test file
Fork of TextLCD_HelloWorld by
main.cpp@5:1ad7d56050dd, 2013-11-20 (annotated)
- Committer:
- ramsphd
- Date:
- Wed Nov 20 10:48:50 2013 +0000
- Revision:
- 5:1ad7d56050dd
- Parent:
- 3:bae19bde97d5
TEXT_LCD with ADC sent to serial pc
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
simon | 1:7418a52375a0 | 1 | // Hello World! for the TextLCD |
simon | 1:7418a52375a0 | 2 | |
simon | 0:334327d1a416 | 3 | #include "mbed.h" |
simon | 0:334327d1a416 | 4 | #include "TextLCD.h" |
simon | 0:334327d1a416 | 5 | |
ramsphd | 5:1ad7d56050dd | 6 | TextLCD lcd(p25, p26, p24, p23, p22, p21); // rs, e, d4-d7 |
ramsphd | 5:1ad7d56050dd | 7 | Serial pc(USBTX,USBRX); |
ramsphd | 5:1ad7d56050dd | 8 | AnalogIn voltage(p15); |
ramsphd | 3:bae19bde97d5 | 9 | int main() |
ramsphd | 3:bae19bde97d5 | 10 | { |
ramsphd | 3:bae19bde97d5 | 11 | while (1){ |
ramsphd | 5:1ad7d56050dd | 12 | lcd.printf("Voltage in fraction: %2.4f\n", voltage.read()); |
ramsphd | 5:1ad7d56050dd | 13 | pc.printf("Voltage in fraction: %2.4f\n", voltage.read()); |
ramsphd | 5:1ad7d56050dd | 14 | |
ramsphd | 5:1ad7d56050dd | 15 | wait(5); |
ramsphd | 5:1ad7d56050dd | 16 | lcd.printf("Voltage in integer: %6d\n", voltage.read_u16()); |
ramsphd | 5:1ad7d56050dd | 17 | pc.printf("Voltage in integer: %6d\n", voltage.read_u16()); |
ramsphd | 5:1ad7d56050dd | 18 | wait(5); |
simon | 0:334327d1a416 | 19 | } |
ramsphd | 3:bae19bde97d5 | 20 | } |