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.
Blinking.cpp
- Committer:
- pinofal
- Date:
- 2019-11-15
- Revision:
- 1:9929cc08730b
File content as of revision 1:9929cc08730b:
#include "mbed.h"
// genera un oggetto serial collegato al PC
Serial pc(USBTX, USBRX);
// genera un oggetto DigitalOut collegato al Led
DigitalIn myButton(USER_BUTTON);
DigitalOut myLed(LED1);
//DigitalIn myButton(PA_0); // verde
int main()
{
// configura velocità della comunicazione seriale su USB-VirtualCom e invia messaggio di benvenuto
pc.baud(921600); //921600 bps
while(true)
{
myLed = 0;
wait(1);
myLed = 1;
if(myButton==0)
{
pc.printf("IN = 0\r\n");
myLed = 1;
}
else
{
pc.printf("IN = 1\r\n");
myLed = 0;
}
}
}