Manchester receiver demo.

Dependencies:   Manchester mbed CRC16 ManchesterMsg

Files at this revision

API Documentation at this revision

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

Manchester.lib Show annotated file Show diff for this revision Revisions of this file
ManchesterMsg.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 3dc7d8e25c89 -r d1191c39b418 Manchester.lib
--- 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
diff -r 3dc7d8e25c89 -r d1191c39b418 ManchesterMsg.lib
--- /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
diff -r 3dc7d8e25c89 -r d1191c39b418 main.cpp
--- 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");
diff -r 3dc7d8e25c89 -r d1191c39b418 mbed.bld
--- 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