SMART CLEO Gas

main.cpp

Committer:
SMART_CLEO
Date:
2017-09-28
Revision:
0:5251f7d3452f

File content as of revision 0:5251f7d3452f:

#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);
    }
}