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
00001 /* 00002 presence.cpp - presence 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 or Rangefinder with appropriate signalling. 00006 Also drives LED as presence indicator. 00007 */ 00008 00009 #ifndef MBED_PIR_H 00010 #define MBED_PIR_H 00011 00012 #include "mbed.h" 00013 00014 class presence{ 00015 00016 public: 00017 00018 presence(PinName pin, bool true_on_rise, int debounce_time_ms); 00019 bool isPresent(); 00020 00021 private: 00022 InterruptIn _myint; 00023 DigitalOut _led1; 00024 bool _detection; 00025 bool _true_on_rise; 00026 int debounce_ms; 00027 Timer debounce_timer; 00028 void presence_interrupt_on(); 00029 void presence_interrupt_off(); 00030 00031 }; 00032 00033 #endif
Generated on Sat Jul 16 2022 19:54:40 by
