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
00001 #include "mbed.h" 00002 # include "DebouncedIn.h" 00003 00004 // Programa para encender un led, si se hace presión sobre un pulsador 00005 // El led va a encender con mayor duración a medida que se pulse 00006 00007 DigitalOut LED(LED1); 00008 DebouncedIn PULSADOR(PTC12); 00009 00010 00011 float c = 0; 00012 00013 int main () 00014 { 00015 00016 while (1) 00017 { 00018 00019 if (c<10) 00020 { 00021 00022 LED=!LED; 00023 if (PULSADOR.falling()) 00024 { 00025 LED == 1; 00026 c = c+0.1; 00027 00028 } 00029 00030 00031 00032 wait (c); 00033 } 00034 else 00035 { 00036 c=0; 00037 00038 } 00039 00040 } 00041 }
Generated on Fri Jul 22 2022 01:18:31 by
1.7.2