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.
Revision 25:6816f234bc1e, committed 2020-04-12
- Comitter:
- nervy
- Date:
- Sun Apr 12 03:52:08 2020 +0000
- Parent:
- 24:7f14b70fc9ef
- Commit message:
- E1p3
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Apr 08 11:03:25 2019 +0100 +++ b/main.cpp Sun Apr 12 03:52:08 2020 +0000 @@ -1,12 +1,21 @@ -#include "mbed.h" +#include "mbed.h" //librería que nos permite utilizar comandos y sentencias propias de mbed + +DigitalOut myled(LED3); -DigitalOut myled(LED1); +//DigitalOut es decirle al microcontrolador que voy a utilizar un pin de tipo salida. +//myled es el nombre que yo selecciono para nombrar el pin que voy a utilizar como salida. +//LED2 le dice al microcontrolador cual es e pin a utilizar de manera física. int main() { - while(1) { - myled = 1; - wait(0.2); - myled = 0; - wait(0.2); + + + while(1) //ciclo infinito + + + { + myled = 1; //encender* + wait(5); //wait es un comando que retrasa cierto tiempo al sistema (el tiempo está dado en seg). + myled = 0; //apagar* + wait(5); } }