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

Dependencies:   TextLCD mbed

Committer:
jksoft
Date:
Fri Aug 26 15:47:21 2011 +0000
Revision:
0:0d8380b11a05

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jksoft 0:0d8380b11a05 1 #include "mbed.h"
jksoft 0:0d8380b11a05 2 #include "TextLCD.h"
jksoft 0:0d8380b11a05 3
jksoft 0:0d8380b11a05 4 TextLCD lcd(p24, p26, p27, p28, p29, p30); // rs, e, d4-d7
jksoft 0:0d8380b11a05 5 AnalogIn ain(p15);
jksoft 0:0d8380b11a05 6
jksoft 0:0d8380b11a05 7 int main() {
jksoft 0:0d8380b11a05 8 float tmp;
jksoft 0:0d8380b11a05 9
jksoft 0:0d8380b11a05 10 while(1) {
jksoft 0:0d8380b11a05 11 lcd.locate(0,0);
jksoft 0:0d8380b11a05 12 tmp = (ain - 0.1818)/0.00303;
jksoft 0:0d8380b11a05 13 lcd.printf("temp:%2.2f",tmp);
jksoft 0:0d8380b11a05 14 wait(0.5);
jksoft 0:0d8380b11a05 15 }
jksoft 0:0d8380b11a05 16 }