温度センサーサンプルプログラム mbedセミナー演習3

Dependencies:   TextLCD mbed

main.cpp

Committer:
jksoft
Date:
2011-08-26
Revision:
0:0d8380b11a05

File content as of revision 0:0d8380b11a05:

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

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

int main() {
    float tmp;
    
    while(1) {
        lcd.locate(0,0);
        tmp = (ain - 0.1818)/0.00303;
        lcd.printf("temp:%2.2f",tmp);
        wait(0.5);
    }
}