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.
Fork of PGO6_VoteController_template by
debounce_button.h
00001 #include "mbed.h" 00002 00003 /** 00004 Due to the imperfect design of the buttons, a press on the button is registered multple times. 00005 The debouncer module makes sure that these false positives of the button are going to be ignored. 00006 00007 Also, this module provides a multiclick service which allows the user to press the button multiple times 00008 within a certain time frame. Therefore, multiple actions can be mapped to a single button. 00009 00010 */ 00011 00012 extern volatile bool button1_pressed; // Used in the main loop 00013 extern volatile bool button1_enabled; // Used for debouncing 00014 extern volatile int multiclick_state; // Counts how many clicks occured in the time slot, used in main loop 00015 extern volatile int last_multiclick_state; // Counts how many clicks occured in the previous timeslot 00016 extern volatile bool button1_busy; // Informs the mainloop that the user is clicking the button 00017 extern volatile bool result_ready; 00018 00019 void button1_multiclick_reset_cb(void); // Resets the amount of clicks, but stores this value for the usage in the main loop 00020 void button1_enabled_cb(void); // Enables the button again after a timeout, used for debouncing the button 00021 void button1_onpressed_cb(void); // Callback which is called when the user presses the button
Generated on Wed Jul 13 2022 07:17:10 by
