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
Door_Trip/DoorTrip.h@46:807e9cf63f4c, 2015-07-16 (annotated)
- Committer:
- andcor02
- Date:
- Thu Jul 16 13:28:49 2015 +0000
- Revision:
- 46:807e9cf63f4c
- Parent:
- 40:b2e9bc654ca1
Added Serial VCOM debug over USB.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
andcor02 | 40:b2e9bc654ca1 | 1 | /* |
andcor02 | 40:b2e9bc654ca1 | 2 | DoorTrip.cpp - DoorTrip sensor library |
andcor02 | 40:b2e9bc654ca1 | 3 | Developed by Andrea Corrado & Eric Gowland |
andcor02 | 40:b2e9bc654ca1 | 4 | |
andcor02 | 40:b2e9bc654ca1 | 5 | Connect to a hardware device that is boolean present/not present. Such as PIR, Rangefinder or laser with appropriate signalling. |
andcor02 | 40:b2e9bc654ca1 | 6 | Also drives LED as DoorTrip indicator. |
andcor02 | 40:b2e9bc654ca1 | 7 | */ |
andcor02 | 40:b2e9bc654ca1 | 8 | |
andcor02 | 40:b2e9bc654ca1 | 9 | |
andcor02 | 40:b2e9bc654ca1 | 10 | #ifndef MBED_DOOR_H |
andcor02 | 40:b2e9bc654ca1 | 11 | #define MBED_DOOR_H |
andcor02 | 40:b2e9bc654ca1 | 12 | |
andcor02 | 40:b2e9bc654ca1 | 13 | #include "mbed.h" |
andcor02 | 40:b2e9bc654ca1 | 14 | |
andcor02 | 40:b2e9bc654ca1 | 15 | class DoorTrip{ |
andcor02 | 40:b2e9bc654ca1 | 16 | |
andcor02 | 40:b2e9bc654ca1 | 17 | public: |
andcor02 | 40:b2e9bc654ca1 | 18 | |
andcor02 | 40:b2e9bc654ca1 | 19 | DoorTrip(PinName pin, bool true_on_rise, int debounce_time_ms); |
andcor02 | 40:b2e9bc654ca1 | 20 | bool isPresent(); |
andcor02 | 40:b2e9bc654ca1 | 21 | |
andcor02 | 40:b2e9bc654ca1 | 22 | private: |
andcor02 | 40:b2e9bc654ca1 | 23 | InterruptIn _myint; |
andcor02 | 40:b2e9bc654ca1 | 24 | DigitalOut _led1; |
andcor02 | 40:b2e9bc654ca1 | 25 | bool _detection; |
andcor02 | 40:b2e9bc654ca1 | 26 | bool _true_on_rise; |
andcor02 | 40:b2e9bc654ca1 | 27 | int debounce_ms; |
andcor02 | 40:b2e9bc654ca1 | 28 | Timer debounce_timer; |
andcor02 | 40:b2e9bc654ca1 | 29 | void DoorTrip_interrupt_on(); |
andcor02 | 40:b2e9bc654ca1 | 30 | void DoorTrip_interrupt_off(); |
andcor02 | 40:b2e9bc654ca1 | 31 | |
andcor02 | 40:b2e9bc654ca1 | 32 | }; |
andcor02 | 40:b2e9bc654ca1 | 33 | |
andcor02 | 40:b2e9bc654ca1 | 34 | #endif |