Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Presence.h
- Committer:
- andcor02
- Date:
- 2015-02-11
- Revision:
- 7:f12e18827f3e
- Parent:
- 1:9d2b641a9280
File content as of revision 7:f12e18827f3e:
/* presence.cpp - presence sensor library Developed by Andrea Corrado & Eric Gowland Connect to a hardware device that is boolean present/not present. Such as PIR or Rangefinder with appropriate signalling. Also drives LED as presence indicator. */ #ifndef MBED_PIR_H #define MBED_PIR_H #include "mbed.h" class presence{ public: presence(PinName pin, bool true_on_rise, int debounce_time_ms); bool isPresent(); private: InterruptIn _myint; DigitalOut _led1; bool _detection; bool _true_on_rise; int debounce_ms; Timer debounce_timer; void presence_interrupt_on(); void presence_interrupt_off(); }; #endif