Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed-rtos mbed CRC16
Fork of S5info_APP2 by
Diff: read.h
- Revision:
- 14:bd909277eb13
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/read.h Tue Mar 07 04:39:57 2017 +0000
@@ -0,0 +1,26 @@
+#include "mbed.h"
+#include "rtos.h"
+DigitalIn in(p30);
+Thread ThreadLecture;
+const int PREAMBULE = 0b01010101;
+const int START = 0b01111110;
+const int END = 0b01111110;
+
+void read()
+{
+ char byte;
+ vector<char> bytes;
+ while (true)
+ {
+ ThreadLecture.signal_wait(1);
+
+ byte = (byte << 1) + in;
+
+ shift++;
+ if (shift == 8)
+ {
+ bytes.push_back(byte);
+ shift = 0;
+ }
+ }
+}
\ No newline at end of file
