![](/media/cache/profiles/7c39a5f991bef4a1e34187677a65871d.jpg.50x50_q85.jpg)
Manchester transmitter demo.
Dependencies: Manchester mbed CRC16 ManchesterMsg
main.cpp
- Committer:
- hudakz
- Date:
- 2017-05-21
- Revision:
- 2:0ab7d3335571
- Parent:
- 1:cc6d7d370126
- Child:
- 3:28ae6f223bed
File content as of revision 2:0ab7d3335571:
#include "mbed.h" #include "Manchester.h" #include "CRC16.h" DigitalOut led(LED1); Manchester man(p11, p12, 9600); // Tx pin, Rx pin, speed [bps] ManchesterMsg msg(255); // Message container (max bytes) CRC16 crc16; // CRC16 object int main(void) { while(1) { msg.clear(); // Clear the message msg << "Hello World!" << 0xfa74c309; // Add some data to the message msg << crc16.calc(msg.data, msg.len); // Append CRC16 to the message man.transmit(msg); // Transmit the message wait_ms(1000); led = !led; } }