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:
- 16:1a0589d846bf
- Parent:
- 15:75f9bd5d7659
- Child:
- 17:8683abdc1912
diff -r 75f9bd5d7659 -r 1a0589d846bf main.cpp
--- a/main.cpp Wed May 10 09:45:57 2017 +0200
+++ b/main.cpp Wed May 10 14:31:39 2017 +0000
@@ -75,7 +75,7 @@
void client(){
MySoftSerial s(p18,p17);
- s.baud(1);
+ s.baud(20000);
s.format(16, SoftSerial::None, 1);
while (true) {
while (!s.readable());
@@ -84,16 +84,21 @@
}
void relay(){
- MySoftSerial s(LED1,p18);
- s.baud(1);
+ MySoftSerial s(p17,p18);
+ s.baud(20000);
s.format(16, SoftSerial::None, 1);
int i = 0;
while (true){
wait(0.1);
- while(!s.writeable());
- printf("put %i\r\n", 0b0101010100110011);
- s.putc(0b0101010100110011);
- i++;
+ for (int j = 0; j < 50; ++j) {
+ while(!s.writeable());
+ //printf("put %i\r\n", 0b0101010100110011);
+ //s.putc(0b0101010100110011);
+ printf("put %i\r\n", i);
+ //s.putc(0b0000000000000000);
+ s.putc(0b0000000000001111);
+ i++;
+ }
}
}