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
00001 #include "mbed.h" 00002 Serial pc (SERIAL_TX, SERIAL_RX); 00003 DigitalOut myled(D7); // Pin digitale di uscita 00004 RawSerial hc05(D8, D2); 00005 00006 int main () { 00007 char a; 00008 pc.baud(9600); // setto il baud rate della porta seriale pc 00009 hc05.baud(9600); // setto il baud rate della porta rawserial hc05 00010 while (1) { 00011 if(hc05.readable()) { // se e’¨ stato ricevuto un carattere 00012 a=hc05.getc(); // assegna il carattere ricevuto alla var a 00013 if(a=='F') { 00014 myled=1; 00015 pc.printf("LED ON %c\n\r",a); 00016 } 00017 else if (a=='B') { 00018 myled=0; 00019 pc.printf("LED OFF %c\n\r",a); 00020 } 00021 } 00022 } 00023 }
Generated on Tue Aug 2 2022 13:18:39 by
1.7.2