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.
main.cpp
- Committer:
- senisegi
- Date:
- 2018-06-06
- Revision:
- 0:e778d701b830
File content as of revision 0:e778d701b830:
#include "mbed.h"
DigitalOut myled(LED1); //definisce myled
Serial pc(SERIAL_TX, SERIAL_RX); //Apertura della seriale 2
//Serial pc(D8, D2); //Apertura della seriale 1 *opzionale vedi sotto
int main()
{
char c; // variabile che contiene il carattere appena ricevuto
while(1) {
c=pc.getc(); //legge un carattere dalla seriale
if (c == '1')
myled = 1; //Accende il led
else if (c == '2')
myled = 0; // spegne il led
}
}