アナログ入力

Dependencies:   TextLCD mbed

main.cpp

Committer:
hasimo
Date:
2014-07-28
Revision:
0:d86587ed9b1c

File content as of revision 0:d86587ed9b1c:

#include "mbed.h"
#include "TextLCD.h"

TextLCD lcd(p24, p26, p27, p28, p29, p30); // rs, e, d4-d7
AnalogIn ain(p15);

int main() {
    float adc;
    
    while (1){
        lcd.locate(0,0);
        lcd.printf("%8.3f \n", ain.read());
        wait(0.05);                 // 20Hz update rate
    }
}