han back
/
CLEO_GAS
SMART CLEO Gas
Diff: main.cpp
- Revision:
- 0:5251f7d3452f
diff -r 000000000000 -r 5251f7d3452f main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Sep 28 02:14:11 2017 +0000 @@ -0,0 +1,22 @@ +#include "mbed.h" +#include "TextLCD.h" + +PinName pin_GAS = PA_1; + +AnalogIn adc_Gas(pin_GAS); + +// rs, rw, e, d0-d3 +TextLCD lcd(PB_12, PB_13, PB_14, PB_15, PA_9, PA_10, PA_11); + +int main() { + + int volt; + lcd.printf(" GAS Program\n"); + lcd.printf(" Volt : [mV]"); + while(1) { + volt = adc_Gas.read()*3300; + lcd.locate(8, 1); + lcd.printf("%4d", volt); + wait(0.5); + } +}