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.
Diff: Config.cpp
- Revision:
- 0:f42f18c56a88
diff -r 000000000000 -r f42f18c56a88 Config.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Config.cpp Sat Nov 16 00:48:19 2013 +0000
@@ -0,0 +1,72 @@
+#include "alarma.h"
+#include "mbed.h"
+
+int contador = 0;
+
+void Config(void){
+ if(Prog == 1){ //Bandera para que entre a programacion solo después de un reseteo.
+ while(Pulsador != false); //Espero que se suelte el pulsador.
+ Pip(3);
+ while(true){
+ if(contador >= 25){ //Si el tiempo llega a 5 seg...
+ Pip(3);
+ contador = 0;
+ break;
+ }
+ contador = 0;
+ while(Pulsador != true) //Aguardo a que se presione el pulsador.
+ KeepAlive();
+ wait(0.05);
+ delaySirena++;
+ Pip(1);
+ if(delaySirena >= 10)
+ delaySirena = 1;
+ while(Pulsador != false){ //Espero que se suelte el pulsador.
+ contador++;
+ KeepAlive(); //0.2 segundos
+ }
+ }
+ while(true){
+ if(contador >= 25){
+ Pip(3);
+ contador = 0;
+ break;
+ }
+ contador = 0;
+ while(Pulsador != true)
+ KeepAlive();
+ wait(0.05);
+ delayLuz++;
+ Pip(1);
+ if(delayLuz >= 10)
+ delayLuz = 1;
+ while(Pulsador != false){
+ contador++;
+ KeepAlive(); //0.2 segundos
+ }
+ }
+ while(true){
+ if(contador >= 25){
+ Buzzer = 1;
+ wait(1);
+ Buzzer = 0;
+ wait(1);
+ contador = 0;
+ return;
+ }
+ contador = 0;
+ while(Pulsador != true)
+ KeepAlive();
+ wait(0.05);
+ delayFactory = delayFactory + 1;
+ Pip(1);
+ if(delayFactory >= 5)
+ delayFactory = 2;
+ while(Pulsador != false){
+ contador++;
+ KeepAlive(); //0.2 segundos
+ }
+ }
+ }
+}
+
\ No newline at end of file