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
Fork of INTERUPCIONES by
main.cpp@0:38bcc53b1324, 2016-04-20 (annotated)
- Committer:
- tony63
- Date:
- Wed Apr 20 20:08:14 2016 +0000
- Revision:
- 0:38bcc53b1324
- Child:
- 1:d8dfdd1c3f6b
PRUEBA DE INTERUPCIONES en FRDMKL25Z
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tony63 | 0:38bcc53b1324 | 1 | /* |
tony63 | 0:38bcc53b1324 | 2 | ESTE PROGRAMA ES PARA PROBAR INTERUPCIONES POR CAMBIO EN ENTRADA DIGITAL |
tony63 | 0:38bcc53b1324 | 3 | ESTAN PROHIBIDOS PARA SIGUIENTES ENTRADAS |
tony63 | 0:38bcc53b1324 | 4 | PRB0 |
tony63 | 0:38bcc53b1324 | 5 | PTB1 |
tony63 | 0:38bcc53b1324 | 6 | PTB2 |
tony63 | 0:38bcc53b1324 | 7 | PTB3 |
tony63 | 0:38bcc53b1324 | 8 | PTC2 |
tony63 | 0:38bcc53b1324 | 9 | PTC1 |
tony63 | 0:38bcc53b1324 | 10 | PTE0 |
tony63 | 0:38bcc53b1324 | 11 | PTE1 |
tony63 | 0:38bcc53b1324 | 12 | PTC8 |
tony63 | 0:38bcc53b1324 | 13 | PTC9 |
tony63 | 0:38bcc53b1324 | 14 | EL RESTO PUEDEN CON INTERUPCION |
tony63 | 0:38bcc53b1324 | 15 | SI SE IGNORA ESTO LA FRDMKL25Z SE BLOQUEA Y NO PERMITE CARGAR NINGUN PROGRAMA |
tony63 | 0:38bcc53b1324 | 16 | SI FUERON COMPROBADOS: |
tony63 | 0:38bcc53b1324 | 17 | PTD2 |
tony63 | 0:38bcc53b1324 | 18 | PTA13 |
tony63 | 0:38bcc53b1324 | 19 | PTD5 |
tony63 | 0:38bcc53b1324 | 20 | PTD0 |
tony63 | 0:38bcc53b1324 | 21 | PTD1--NO FUNCIONA |
tony63 | 0:38bcc53b1324 | 22 | PTD3 |
tony63 | 0:38bcc53b1324 | 23 | PTA2--NO FUNCIONA |
tony63 | 0:38bcc53b1324 | 24 | PTA12 |
tony63 | 0:38bcc53b1324 | 25 | PTA5 |
tony63 | 0:38bcc53b1324 | 26 | PTA4 |
tony63 | 0:38bcc53b1324 | 27 | PTD4 |
tony63 | 0:38bcc53b1324 | 28 | PTA2--NO FUNCIONA..SE CONFUNCE CON EL PUERTO PTA1 SI SE PROGRAMA PTA2 Y EL CAMBIO ES EN PTA1 SI FUNCIONA |
tony63 | 0:38bcc53b1324 | 29 | PUERTO C NO FUNCIONA |
tony63 | 0:38bcc53b1324 | 30 | PTA17 |
tony63 | 0:38bcc53b1324 | 31 | |
tony63 | 0:38bcc53b1324 | 32 | */ |
tony63 | 0:38bcc53b1324 | 33 | |
tony63 | 0:38bcc53b1324 | 34 | #include "mbed.h" |
tony63 | 0:38bcc53b1324 | 35 | |
tony63 | 0:38bcc53b1324 | 36 | InterruptIn button(PTA17); |
tony63 | 0:38bcc53b1324 | 37 | DigitalOut led(LED1); |
tony63 | 0:38bcc53b1324 | 38 | DigitalOut flash(LED3); |
tony63 | 0:38bcc53b1324 | 39 | |
tony63 | 0:38bcc53b1324 | 40 | void flip() { |
tony63 | 0:38bcc53b1324 | 41 | led = !led; |
tony63 | 0:38bcc53b1324 | 42 | } |
tony63 | 0:38bcc53b1324 | 43 | |
tony63 | 0:38bcc53b1324 | 44 | int main() { |
tony63 | 0:38bcc53b1324 | 45 | button.rise(&flip); // attach the address of the flip function to the rising edge |
tony63 | 0:38bcc53b1324 | 46 | while(1) { // wait around, interrupts will interrupt this! |
tony63 | 0:38bcc53b1324 | 47 | flash = !flash; |
tony63 | 0:38bcc53b1324 | 48 | wait(0.25); |
tony63 | 0:38bcc53b1324 | 49 | } |
tony63 | 0:38bcc53b1324 | 50 | } |