SMART CLEO Flame

Committer:
SMART_CLEO
Date:
Thu Sep 28 02:13:22 2017 +0000
Revision:
0:dd25ed169eae
SMART_CLEO
;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
SMART_CLEO 0:dd25ed169eae 1 #include "mbed.h"
SMART_CLEO 0:dd25ed169eae 2 #include "TextLCD.h"
SMART_CLEO 0:dd25ed169eae 3
SMART_CLEO 0:dd25ed169eae 4 PinName pin_FLAME_A = PA_0;
SMART_CLEO 0:dd25ed169eae 5 PinName pin_FLAME_D = PB_1;
SMART_CLEO 0:dd25ed169eae 6
SMART_CLEO 0:dd25ed169eae 7 AnalogIn adc_Flame(pin_FLAME_A);
SMART_CLEO 0:dd25ed169eae 8 DigitalIn Flame(pin_FLAME_D);
SMART_CLEO 0:dd25ed169eae 9
SMART_CLEO 0:dd25ed169eae 10 // rs, rw, e, d0-d3
SMART_CLEO 0:dd25ed169eae 11 TextLCD lcd(PB_12, PB_13, PB_14, PB_15, PA_9, PA_10, PA_11);
SMART_CLEO 0:dd25ed169eae 12
SMART_CLEO 0:dd25ed169eae 13 int main() {
SMART_CLEO 0:dd25ed169eae 14
SMART_CLEO 0:dd25ed169eae 15 int volt, flame_d;
SMART_CLEO 0:dd25ed169eae 16 lcd.printf(" Volt : [mV]");
SMART_CLEO 0:dd25ed169eae 17 lcd.locate(0, 1);
SMART_CLEO 0:dd25ed169eae 18 lcd.printf("Flame Status : ");
SMART_CLEO 0:dd25ed169eae 19 while(1) {
SMART_CLEO 0:dd25ed169eae 20 volt = adc_Flame.read()*3300;
SMART_CLEO 0:dd25ed169eae 21 flame_d = !Flame;
SMART_CLEO 0:dd25ed169eae 22 lcd.locate(8, 0);
SMART_CLEO 0:dd25ed169eae 23 lcd.printf("%4d", volt);
SMART_CLEO 0:dd25ed169eae 24 lcd.locate(15, 1);
SMART_CLEO 0:dd25ed169eae 25 lcd.printf("%d", flame_d);
SMART_CLEO 0:dd25ed169eae 26 wait(1);
SMART_CLEO 0:dd25ed169eae 27 }
SMART_CLEO 0:dd25ed169eae 28 }