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 Demo Team

PIR/PIR.h

Committer:
andcor02
Date:
2014-12-03
Revision:
25:cb16c5248769

File content as of revision 25:cb16c5248769:

/*
    PIR.cpp -  sensor library
    Developed by Andrea Corrado   
*/


#ifndef MBED_PIR_H
#define MBED_PIR_H

#include "mbed.h"

/* EXAMPLE

#include "mbed.h"
#include "PIR.h"

Serial pc (USBTX,USBRX);

PIR sensor(PTB2);

int main()
{
    
if (sensor.getdetection()) {
pc.printf("\n\r Detection");
  sensor.resetdetection(); 
  }
}
*/

class PIR {
    
public:

    PIR (PinName pin);
    
    void pir_interrupt();
    
    bool getdetection(){return _detection;}
    
    void resetdetection(){_detection = false;}

protected:
    InterruptIn _myint;
    bool _detection;
    Timer debounce;
    
};

#endif