Patrick Clary
/
PcRadioBridge
Takes data over the serial connection and transmits it over a radio link using the nRF24L01+.
Diff: main.cpp
- Revision:
- 0:114850b470f5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Sep 02 02:20:09 2013 +0000 @@ -0,0 +1,28 @@ +#include "mbed.h" +#include "Radio.h" + + + +RadioController radio(p5, p6, p7, p8, p9); + + + +int main() +{ + Serial pc(USBTX, USBRX); + pc.baud(460800); + + radio.reset(); + + uint32_t data; + + while (true) + { + data = 0; + data |= ((uint32_t)pc.getc()) << 0; + data |= ((uint32_t)pc.getc()) << 8; + data |= ((uint32_t)pc.getc()) << 16; + data |= ((uint32_t)pc.getc()) << 24; + radio.transmit(data); + } +}