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
main.cpp
- Committer:
- MaxenceGalopin
- Date:
- 2020-01-10
- Revision:
- 0:a7e7666c7a9d
File content as of revision 0:a7e7666c7a9d:
#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"); } } }