mbed Weather Platform firmware http://mbed.org/users/okini3939/notebook/mbed-weather-platform-firmware/
Dependencies: EthernetNetIf SDHCFileSystem I2CLEDDisp Agentbed NTPClient_NetServices mbed BMP085 HTTPClient ConfigFile I2CLCD
Diff: main.cpp
- Revision:
- 16:df39da7bef98
- Parent:
- 15:07bfa25ba6ae
- Child:
- 17:7c9d111a5d45
--- a/main.cpp Wed Mar 30 20:09:04 2011 +0000 +++ b/main.cpp Fri Apr 01 23:37:04 2011 +0000 @@ -197,6 +197,16 @@ pc.printf("\r\nInterval: %d sec\r\n", conf.interval); + if (conf.lcd_mesg[0]) { + // use I2C LCD + lcd = new I2CLCD(i2c, I2CLCD_ADDR, conf.lcdtype, conf.lcdconf); + } + + if (conf.leddisp_mesg[0]) { + // use I2C LED Display + leddisp = new I2CLEDDisp(i2c); + } + if (conf.ipaddr[0]) { // use ethernet @@ -241,6 +251,10 @@ pc.printf("Snmp community name: %s\r\n", conf.snmp_commname); } } + } else { + // not use ethernet + led_g = eth_link ? 0 : 1; + led_g2 = 0; } if (conf.filetype) { @@ -281,11 +295,17 @@ pc.printf("Actions: %d\r\n", conf.actionscount); - if (! conf.ipaddr[0]) { - led_g = eth_link ? 0 : 1; - led_g2 = 0; + if (conf.inputtype == INPUT_FALL) { + intcounter = new InterruptIn(p18); + intcounter->fall(&int_counter); + } else + if (conf.inputtype == INPUT_RISE) { + intcounter = new InterruptIn(p18); + intcounter->rise(&int_counter); + } else { + aimoist = new AnalogIn(p18); } - + count_counter = 0; lastCountTime = 0; }