Alarma con sensores PIR de calor los detecta por medio de interrupciones, que filtran falsos disparos del sensor, da orden de grabar video con tres cámaras, acciona una sirena

Dependencies:   mbed

Fork of INTERUPCIONES by Gustavo Ramirez

main.cpp

Committer:
tony63
Date:
2016-04-20
Revision:
0:38bcc53b1324
Child:
1:d8dfdd1c3f6b

File content as of revision 0:38bcc53b1324:

/*
ESTE PROGRAMA ES PARA PROBAR INTERUPCIONES POR CAMBIO EN ENTRADA DIGITAL
ESTAN PROHIBIDOS PARA SIGUIENTES ENTRADAS
PRB0
PTB1
PTB2
PTB3
PTC2
PTC1
PTE0
PTE1
PTC8
PTC9
EL RESTO PUEDEN CON INTERUPCION
SI SE IGNORA ESTO LA FRDMKL25Z SE BLOQUEA Y NO PERMITE CARGAR NINGUN PROGRAMA
SI FUERON COMPROBADOS:
PTD2
PTA13
PTD5
PTD0
PTD1--NO FUNCIONA
PTD3
PTA2--NO FUNCIONA
PTA12
PTA5
PTA4
PTD4
PTA2--NO FUNCIONA..SE CONFUNCE CON EL PUERTO PTA1  SI SE PROGRAMA PTA2 Y EL CAMBIO ES EN PTA1 SI FUNCIONA
PUERTO C NO FUNCIONA
PTA17

*/

#include "mbed.h"
 
InterruptIn button(PTA17);
DigitalOut led(LED1);
DigitalOut flash(LED3);
 
void flip() {
    led = !led;
}
 
int main() {
    button.rise(&flip);  // attach the address of the flip function to the rising edge
    while(1) {           // wait around, interrupts will interrupt this!
        flash = !flash;
        wait(0.25);
    }
}