![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Weather control switch for connected day. NXP LPC 1768 module. Ethernet connectivity.
Dependencies: EthernetInterface mbed-rtos mbed nanoservice_client_1_12
Fork of Trenton_Switch_LPC1768_WIFLY by
Diff: PIR/PIR.cpp
- Revision:
- 26:3467812d5832
- Parent:
- 25:cb16c5248769
--- a/PIR/PIR.cpp Wed Dec 03 09:03:29 2014 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/* - PIR.cpp - sensor library - Developed by Andrea Corrado -*/ - - -#include "mbed.h" -#include "PIR.h" - -PIR::PIR(PinName pin):_myint(pin) -{ - _myint.rise(this, &PIR::pir_interrupt); - _detection=false; - debounce.start(); - -} - -void PIR::pir_interrupt() -{ - if(debounce.read_ms() > 4000) { - _detection=true; - debounce.reset(); - } -}