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
Diff: main.cpp
- Revision:
- 0:a7e7666c7a9d
- Child:
- 1:e856bb79d8b6
diff -r 000000000000 -r a7e7666c7a9d main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Jan 10 07:44:10 2020 +0000
@@ -0,0 +1,42 @@
+#include "mbed.h"
+
+#define TX PA_2
+#define RX PA_3
+Serial pc(USBTX, USBRX);
+
+Serial bluetooth(TX,RX);
+
+DigitalOut LEDA(PB_8,0);
+DigitalOut LEDB(PB_9,0);
+
+
+
+int main()
+{
+
+ char Buffer[10];
+
+
+
+
+ while(1) {
+ bluetooth.scanf("%s",&Buffer);
+ pc.printf("Test");
+ if(Buffer[0] == 'O' && Buffer[1] =='N') {
+ if(Buffer[2]=='A') {
+ LEDA=1;
+ pc.printf("nothing received");
+ } else if(Buffer[2] == 'B') {
+ LEDB =1;
+ }
+ } else if(Buffer[0] =='O' && Buffer[1] =='F' && Buffer[2] == 'F') {
+ if(Buffer[3]=='A') {
+ LEDA=0;
+ } else if(Buffer[3]=='B') {
+ LEDB =0;
+ }
+ } else {
+ pc.printf("nothing received");
+ }
+ }
+}