Takes data over the serial connection and transmits it over a radio link using the nRF24L01+.

Dependencies:   Radio mbed

main.cpp

Committer:
pclary
Date:
2013-09-02
Revision:
0:114850b470f5

File content as of revision 0:114850b470f5:

#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);
    }
}