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.
DebouncedIn.h
00001 #include "mbed.h" 00002 00003 class DebouncedIn { 00004 public: 00005 DebouncedIn(PinName in); 00006 00007 int read (void); 00008 operator int(); 00009 00010 int rising(void); 00011 int falling(void); 00012 int steady(void); 00013 00014 private : 00015 // objects 00016 DigitalIn _in; 00017 Ticker _ticker; 00018 00019 // function to take a sample, and update flags 00020 void _sample(void); 00021 00022 // counters and flags 00023 int _samples; 00024 int _output; 00025 int _output_last; 00026 int _rising_flag; 00027 int _falling_flag; 00028 int _state_counter; 00029 00030 }; 00031
Generated on Sat Jul 30 2022 22:57:14 by
