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
Diff: main.cpp
- Revision:
- 13:c111ea1c5990
- Parent:
- 12:a070de571ea1
- Child:
- 14:e29cca7e64b2
--- a/main.cpp Tue May 09 21:39:59 2017 +0200 +++ b/main.cpp Tue May 09 22:01:09 2017 +0200 @@ -72,15 +72,36 @@ // } //} +void client(){ + SoftSerial s(NC,p17); + s.baud(9200); + while (true) { + while (!s.readable()); + char c = (char) s.getc(); + printf((const char *) c); + } +} + +void relay(){ + SoftSerial s(p17,NC); + s.baud(9200); + while (true){ + wait(1); + s.putc(0b00110101); + } +} + #define RELAY 1 +Serial usb(USBTX,USBRX); + int main() { - SoftSerial s(LED1,NC); - s.baud(1); - + usb.baud(115200); if (RELAY){ - s.putc(0b00110101); + printf("relay\r\n"); + relay(); } else { - + printf("client\r\n"); + client(); } } \ No newline at end of file