Darrien Galid
/
rf_simple
Simple RF test for FYRP
Diff: main.cpp
- Revision:
- 0:2efae9d4138c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Apr 01 06:36:29 2019 +0000 @@ -0,0 +1,26 @@ +#include "mbed.h" + +Serial pc(USBTX, USBRX); +Serial device(PTE0, PTE1); //Device tx and rx at PTE0 and PTE1 +DigitalOut myled1(LED1); +DigitalOut myled2(LED2); +//Use LEDS to indicate RF link activity +//Use PC terminal to write messages + +int main() { + device.baud(9600); + + while(1) { + + while (device.readable() == 0) { + myled1 = 1; + pc.write(device.read()); + myled1 = 0; + } + + while (pc.readable() == 0) { + myled2 = 1; + device.write(pc.read()); + myled2 = 0; + } +} \ No newline at end of file