Homework_5_IOT
Dependencies: C12832_lcd EthernetInterface LCD_fonts LM75B MMA7660 NTPClient SimpleSMTPClient WebSocketClient mbed-rtos mbed
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 Fri Jul 22 2022 14:43:07 by 1.7.2