![](/media/cache/profiles/7c39a5f991bef4a1e34187677a65871d.jpg.50x50_q85.jpg)
Manchester transmitter demo.
Dependencies: Manchester mbed CRC16 ManchesterMsg
Diff: main.cpp
- Revision:
- 0:f58990cef4fe
- Child:
- 1:cc6d7d370126
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed May 17 07:54:14 2017 +0000 @@ -0,0 +1,17 @@ +#include "mbed.h" +#include "Manchester.h" + +DigitalOut led(LED1); +Manchester man(p11, p12, 9600); // Tx pin, Rx pin, speed [bps] +ManchesterMsg msg(255); // Message container (max bytes) + +int main(void) { + while(1) { + msg.clear(); // Clear message + msg << "Hello World!" << 0xfa74c309; // Add data to message + man.transmit(msg); // Transmit message + wait_ms(1000); + led = !led; + } +} +