kiban honpo / Mbed 2 deprecated TEMP_XBEE

Dependencies:   TextLCD mbed

Fork of TEMP_XBEE by toshio masuda

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "TextLCD.h"
00003 
00004 AnalogIn    LM60(p15);
00005 TextLCD     lcd(p24, p26, p27, p28, p29, p30);
00006 Serial      xbee(p13, p14); // tx, rx
00007 
00008 /////////////////////////////////////////////////////
00009 //      main
00010 /////////////////////////////////////////////////////
00011 int main(void) {
00012         float a_in , tempC ;
00013     lcd.cls();
00014 
00015     while(1) {
00016         a_in = (LM60);
00017         tempC = (  ( a_in * 3.3 ) - 0.424  ) * 160.0 ;
00018         lcd.locate(0,0);
00019         lcd.printf("%5.2F C %5.3F V ", tempC, a_in);
00020 
00021         xbee.printf( "c" ) ;
00022         wait(.2);
00023         xbee.printf("%5.2F C %5.3F V ", tempC, a_in);
00024         wait(2);
00025     }
00026 
00027     return 0;
00028 }