温度センサ値 XBee送信

Dependencies:   TextLCD mbed

Fork of TEMP_XBEE by toshio masuda

Committer:
MasudaToshio
Date:
Thu May 23 09:40:59 2013 +0000
Revision:
0:0d5de68f4483
Child:
1:8cbb7db0ff4b
?????

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MasudaToshio 0:0d5de68f4483 1 #include "mbed.h"
MasudaToshio 0:0d5de68f4483 2 #include "TextLCD.h"
MasudaToshio 0:0d5de68f4483 3
MasudaToshio 0:0d5de68f4483 4 AnalogIn LM60(p15);
MasudaToshio 0:0d5de68f4483 5 TextLCD lcd(p24, p26, p27, p28, p29, p30);
MasudaToshio 0:0d5de68f4483 6
MasudaToshio 0:0d5de68f4483 7 /////////////////////////////////////////////////////
MasudaToshio 0:0d5de68f4483 8 // main
MasudaToshio 0:0d5de68f4483 9 /////////////////////////////////////////////////////
MasudaToshio 0:0d5de68f4483 10 int main(void) {
MasudaToshio 0:0d5de68f4483 11 float a_in , tempC ;
MasudaToshio 0:0d5de68f4483 12 lcd.cls();
MasudaToshio 0:0d5de68f4483 13
MasudaToshio 0:0d5de68f4483 14 while(1) {
MasudaToshio 0:0d5de68f4483 15 a_in = (LM60);
MasudaToshio 0:0d5de68f4483 16 tempC = ( ( a_in * 3.3 ) - 0.424 ) * 160.0 ;
MasudaToshio 0:0d5de68f4483 17 lcd.locate(0,0);
MasudaToshio 0:0d5de68f4483 18 lcd.printf("%5.2F C %5.3F V ", tempC, a_in);
MasudaToshio 0:0d5de68f4483 19 wait(.5);
MasudaToshio 0:0d5de68f4483 20 }
MasudaToshio 0:0d5de68f4483 21
MasudaToshio 0:0d5de68f4483 22 return 0;
MasudaToshio 0:0d5de68f4483 23 }