Wireless temperature receiver with ER400TRS transceiver.

Dependencies:   mbed

main.cpp

Committer:
lnadal
Date:
2011-08-31
Revision:
0:996e5de63519

File content as of revision 0:996e5de63519:


/*
**************************************************************************
Wireless temperature receiver with ER400TRS transceiver.
433 MHz transceiver.  180 bytes of data. 19200 Baud.


Wiring:
p1: antenna(17 cm). p2,p7(Host Ready Input), p9: ground.
p5(Serial Data Out): mBed's p10(rx).p6(Serial Data In), p8: Vcc = +5 V.

Author: Lluis Nadal. August 2011.
**************************************************************************
*/

#include "mbed.h"


Serial pc(USBTX, USBRX); // tx, rx
Serial receiver(p9, p10);  // tx, rx
char s[10];


int main() {


    wait(2);
    receiver.baud(19200);
    wait(0.5);

    while (1) {
        if (receiver.readable()) {
            receiver.scanf("%s",s);

            pc.printf( "%s C\r\n",s);
        }

    }
}