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
read.h
- Committer:
- ericbisson
- Date:
- 2017-03-07
- Revision:
- 14:bd909277eb13
File content as of revision 14:bd909277eb13:
#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;
}
}
}
