![](/media/cache/profiles/7c39a5f991bef4a1e34187677a65871d.jpg.50x50_q85.jpg)
Manchester receiver demo.
Dependencies: Manchester mbed CRC16 ManchesterMsg
Revision 6:d1191c39b418, committed 2018-10-14
- Comitter:
- hudakz
- Date:
- Sun Oct 14 09:46:53 2018 +0000
- Parent:
- 5:3dc7d8e25c89
- Commit message:
- Number of sync pulses in preamble can be set.
Changed in this revision
--- a/Manchester.lib Mon May 22 09:59:41 2017 +0000 +++ b/Manchester.lib Sun Oct 14 09:46:53 2018 +0000 @@ -1,1 +1,1 @@ -http://developer.mbed.org/users/hudakz/code/Manchester/#7454ad91f714 +http://developer.mbed.org/users/hudakz/code/Manchester/#c1b5893191fe
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ManchesterMsg.lib Sun Oct 14 09:46:53 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/hudakz/code/ManchesterMsg/#260cfaa4e8b5
--- a/main.cpp Mon May 22 09:59:41 2017 +0000 +++ b/main.cpp Sun Oct 14 09:46:53 2018 +0000 @@ -3,7 +3,7 @@ #include "CRC16.h" DigitalOut led(LED1); -Manchester man(p11, p12, 9600); // Tx pin, Rx pin, speed [bps] +Manchester man(D3, D4, 9600); // Tx pin, Rx pin, speed [bps] ManchesterMsg msg(100); // Message container (max bytes) char str[80]; // Storage for the received array of char uint32_t val; // Storage for the value received @@ -12,8 +12,9 @@ unsigned short calcCRC16; // CRC16 calculated int main(void) { + man.setPreamble(5); // Number of sync pulses in preamble while(1) { - if(man.receive(msg)) { // Receive message + if(man.receive(msg)) { // Receive message // Print data length and raw data bytes printf("\r\n----------------------------------------\r\n");
--- a/mbed.bld Mon May 22 09:59:41 2017 +0000 +++ b/mbed.bld Sun Oct 14 09:46:53 2018 +0000 @@ -1,1 +1,1 @@ -https://mbed.org/users/mbed_official/code/mbed/builds/4eea097334d6 \ No newline at end of file +https://os.mbed.com/users/mbed_official/code/mbed/builds/e95d10626187 \ No newline at end of file