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: SoftSerial SDFileSystem mbed wave_player
main.cpp
- Committer:
- Thomas Cauwelier
- Date:
- 2017-05-03
- Revision:
- 9:d95984ce5de9
- Parent:
- 8:4fcc746968b3
- Child:
- 10:071b7cc8b0ff
File content as of revision 9:d95984ce5de9:
#include "mbed.h" #include "rtos.h" #include "Manchester.h" Serial out(p9, p10, 3200); //p9 Serial in(p13, p14, 3200); //p14 void receive_uart() { while (true){ if(in.readable()){ char s[28]; in.gets(s, 28); char dec[14]; Manchester::decode_manchester(s,28,dec); printf(dec); }else{ Thread::yield(); } } } int main() { printf("%s\r\n", "hello, term!"); Thread thread; thread.start(receive_uart); while (true){ while (!out.writeable()); char tosend[28]; Manchester::encode_manchester("hello, term\r\n",14,tosend); out.printf(tosend); wait(1); } }