temp adc and preesure on lcd 20*4 also 16*4
Dependencies: KS0108 SCP1000 TextLCD mbed
Fork of TextLCD_ADC by
main.cpp@5:746a38bc5a10, 2013-08-28 (annotated)
- Committer:
- drrifat
- Date:
- Wed Aug 28 18:34:41 2013 +0000
- Revision:
- 5:746a38bc5a10
- Parent:
- 4:206beeaf992b
scp1000 pressure sensor read pressure and temp, show 16x4 lcd
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
drrifat | 5:746a38bc5a10 | 1 | #include "SCP1000.h" |
drrifat | 5:746a38bc5a10 | 2 | #include "mbed.h" |
drrifat | 5:746a38bc5a10 | 3 | #include "TextLCD.h" |
simon | 1:7418a52375a0 | 4 | |
simon | 0:334327d1a416 | 5 | |
drrifat | 5:746a38bc5a10 | 6 | TextLCD lcd(p26, p25, p24, p23, p22, p21,TextLCD::LCD20x4); // rs, e, d4-d7 |
drrifat | 5:746a38bc5a10 | 7 | |
drrifat | 5:746a38bc5a10 | 8 | SCP1000 scp1000(p5,p6,p7,p8); |
drrifat | 5:746a38bc5a10 | 9 | AnalogIn ain (p20); |
drrifat | 5:746a38bc5a10 | 10 | |
drrifat | 5:746a38bc5a10 | 11 | //Serial rn42(p9,p10); |
drrifat | 5:746a38bc5a10 | 12 | |
drrifat | 5:746a38bc5a10 | 13 | |
ramsphd | 3:bae19bde97d5 | 14 | int main() |
ramsphd | 3:bae19bde97d5 | 15 | { |
drrifat | 5:746a38bc5a10 | 16 | rn42.baud(57600); |
drrifat | 5:746a38bc5a10 | 17 | lcd.locate(0, 0); |
drrifat | 5:746a38bc5a10 | 18 | lcd.printf("This is version 1.0\n"); |
drrifat | 5:746a38bc5a10 | 19 | lcd.locate(0, 1); |
drrifat | 5:746a38bc5a10 | 20 | lcd.printf("of the spi host test\n"); |
drrifat | 5:746a38bc5a10 | 21 | wait(0.75); |
drrifat | 5:746a38bc5a10 | 22 | lcd.cls(); |
drrifat | 5:746a38bc5a10 | 23 | while (1){ |
drrifat | 5:746a38bc5a10 | 24 | |
drrifat | 5:746a38bc5a10 | 25 | lcd.locate(0, 0); |
drrifat | 5:746a38bc5a10 | 26 | lcd.printf("%.2f\n", ain.read()); |
drrifat | 5:746a38bc5a10 | 27 | lcd.locate(0, 1); |
drrifat | 5:746a38bc5a10 | 28 | lcd.printf("%d Pa ", scp1000.readPressure()); |
drrifat | 5:746a38bc5a10 | 29 | lcd.locate(0, 2); |
drrifat | 5:746a38bc5a10 | 30 | lcd.printf("%f C", scp1000.readTemperature()); |
drrifat | 5:746a38bc5a10 | 31 | |
drrifat | 5:746a38bc5a10 | 32 | } |
drrifat | 5:746a38bc5a10 | 33 | |
simon | 0:334327d1a416 | 34 | } |