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:
- montse
- Date:
- 2020-04-15
- Revision:
- 26:0d2df6a1ed26
- Parent:
- 25:869f212440f8
File content as of revision 26:0d2df6a1ed26:
#include "mbed.h" //libreria que nos permite utilizar comandos y sentencias propias de mbed
#include <iostream>
#include <stdio.h>
//Crear un programa el cual al presionar un botón encienda un LED y al dejar de presionar que lo apague.
Serial com1(USBTX, USBRX);
DigitalIn boton1(PTC6);
DigitalOut myled(LED1);
int main()
{
while(1)
{
if (boton1.read()==0)
{
myled=1;
}
else{
myled=0;
}
}
}