mbed Sensor node for Instrumented Booth over ETH.

Dependencies:   EthernetInterface-1 MaxbotixDriver Presence HTU21D_TEMP_HUMID_SENSOR_SAMPLE Resources SHARPIR mbed-rtos mbed-src WDT_K64F nsdl_lib

Fork of Trenton_Switch_LPC1768_ETH by Demo Team

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers DoorTrip.h Source File

DoorTrip.h

00001 /*
00002     DoorTrip.cpp -  DoorTrip sensor library
00003     Developed by Andrea Corrado & Eric Gowland
00004     
00005     Connect to a hardware device that is boolean present/not present. Such as PIR, Rangefinder or laser with appropriate signalling.
00006     Also drives LED as DoorTrip indicator.
00007 */
00008 
00009 
00010 #ifndef MBED_DOOR_H
00011 #define MBED_DOOR_H
00012 
00013 #include "mbed.h"
00014 
00015 class DoorTrip{
00016     
00017 public:
00018 
00019     DoorTrip(PinName pin, bool true_on_rise, int debounce_time_ms);
00020     bool isPresent();
00021     
00022 private:
00023     InterruptIn _myint;
00024     DigitalOut _led1;
00025     bool _detection;
00026     bool _true_on_rise;
00027     int debounce_ms;
00028     Timer debounce_timer;
00029     void DoorTrip_interrupt_on();
00030     void DoorTrip_interrupt_off();
00031     
00032 };
00033 
00034 #endif