pepe

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Armar.cpp Source File

Armar.cpp

00001 #include "alarma.h"
00002 #include "mbed.h"
00003 
00004 void Armar(void){
00005     Pip(1);                                     //Armando.
00006     for(i=0;i<delayFactory;i++){
00007         KeepAlive();
00008         wait(0.8);                              //Con KeepAlive es 1 seg por vuelta.                  
00009     }
00010     Buzzer = 1;                                 //Armada.
00011     wait(1);
00012     Buzzer = 0;         
00013     while(Pulsador == false){                    //Armada    /////
00014         An = SensorAnalogico();                                 //
00015         Di = SensorDigital();                                   //
00016         KeepAlive();                                            //
00017         if((An == 2)||(Di == false)){                           //
00018             while(Pulsador == false){            //Dsparada     //
00019                 Sirena(delaySirena);                        //  //
00020                 LuzDisparo(delayLuz);                       //  //
00021             }                                    /////////////  //
00022             wait(1);                                            //
00023             Pip(2);                                             //
00024             return;                                             //
00025         }                                                       //
00026     }                                            /////////////////
00027     Pip(2);
00028     return;
00029 }
00030 
00031         
00032    
00033