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.
Diff: main.cpp
- Revision:
- 1:adf6dea35aed
- Parent:
- 0:ee2d5dc1290a
--- a/main.cpp Wed Aug 18 15:11:14 2021 +0000
+++ b/main.cpp Thu Oct 14 10:16:51 2021 +0000
@@ -11,8 +11,9 @@
// Blinking rate in milliseconds
#define BLINKING_RATE_MS 500
-BufferedSerial hc05(PB_10,PB_11,9600);
+BufferedSerial hc05(PB_6,PB_7,9600);
PortOut anzeige(PortC,0xFF);
+DigitalIn taste(PA_6);
lcd mylcd;
char c;
@@ -22,22 +23,26 @@
char daten[6]="Hallo";
// Initialise the digital pin LED1 as an output
DigitalOut led(PA_5);
-
+ taste.mode(PullDown);
mylcd.clear();
mylcd.cursorpos(0);
+ mylcd.printf("Hallo");
while (true) {
led = !led;
+ daten[0]='*';
+ daten[1]='T';
+ daten[2]='x';
+ if (taste) daten[3]='y';
+ else daten[3]='z';
+ daten[4]='*';
+
+ hc05.write(daten,4);
if (hc05.readable())
{
hc05.read(&c,1);
mylcd.printf("%c",c);
- daten[0]='*';
- daten[1]='T';
- daten[2]=c;
- daten[3]='*';
-
- hc05.write(daten,4);
+
}
- //thread_sleep_for(BLINKING_RATE_MS);
+ thread_sleep_for(BLINKING_RATE_MS);
}
}