Decode routine for weather station WT440H or WT450H
This piece of software decode Weahter station temperature and humidity freeware, by Lotfi BAGHLI, March, 2013
I hacked the TX WT440H, got 2 wires out (GND and DATA), http://www.upm-marketing.com/products/wd633+wt440h.html
I still want to get the data from a RX one (WS738) or a simple 433 MHz RX but signal pbs not yet solved In fact, from the builtin RX of the Weather station, it is ok, but from the external RX, the range is very small : 20 cm :-(
thanks to Jaakko Ala-Paavola, http://ala-paavola.fi/jaakko/doku.php?id=wt450h
for the protocol and decode routine
Connect 2 wires to the MBED : GND and Data Signal to p18
Temperature and Humidity are displayed on the Serial via USB of the MBED
Diff: main.cpp
- Revision:
- 2:5a073ef49b21
- Parent:
- 1:a9798dd70dbf
- Child:
- 3:cd558875d654
--- a/main.cpp Fri Mar 29 18:36:54 2013 +0000 +++ b/main.cpp Sat Mar 30 10:30:38 2013 +0000 @@ -1,20 +1,32 @@ #include "mbed.h" - -Ticker flipper; -DigitalOut led1(LED1); + +DigitalOut myled(LED1); DigitalOut led2(LED2); - -void flip() { - led2 = !led2; -} +DigitalIn Rx433(p20); +Serial pc(USBTX, USBRX); +Ticker T1; + +unsigned int i; +void T1Interrupt() { + //myled = 1- myled; + i++; + if ((i&1)==1) myled = 1; + else myled = 0; +} + int main() { - led2 = 1; - flipper.attach(&flip, 2.0); // setup flipper to call flip after 2 seconds - - // spin in a main loop. flipper will interrupt it to call flip + i=0; + pc.baud(115200); +// T1.attach_us(&T1Interrupt,500000); // setup T1 interrupt + T1.attach(&T1Interrupt,2.0); // setup T1 interrupt while(1) { - led1 = !led1; - wait(0.2); + led2 = !led2; + wait(0.5); + +// i=(Rx433==1); +// pc.printf("rx= %d ", i); + pc.printf("%d", i); +// i++; } -} \ No newline at end of file +}