Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /********* Pleasedontcode.com **********
- Pleasedontcode thanks you for automatic code generation! Enjoy your code!
- - Terms and Conditions:
- You have a non-exclusive, revocable, worldwide, royalty-free license
- for personal and commercial use. Attribution is optional; modifications
- are allowed, but you're responsible for code maintenance. We're not
- liable for any loss or damage. For full terms,
- please visit pleasedontcode.com/termsandconditions.
- - Project: "Button Debouncing"
- - Source Code NOT compiled for: Arduino Uno
- - Source Code created on: 2025-02-26 02:51:48
- ********* Pleasedontcode.com **********/
- /****** SYSTEM REQUIREMENTS *****/
- /****** SYSTEM REQUIREMENT 1 *****/
- /* The project shall implement a setup routine to */
- /* configure hardware components and a loop to manage */
- /* real-time operations, ensuring responsive behavior */
- /* to user commands and sensor inputs. */
- /****** END SYSTEM REQUIREMENTS *****/
- /* START CODE */
- /****** DEFINITION OF LIBRARIES *****/
- #include <EasyButton.h> //https://github.com/evert-arias/EasyButton
- /****** FUNCTION PROTOTYPES *****/
- void setup(void);
- void loop(void);
- /***** DEFINITION OF DIGITAL INPUT PINS *****/
- const uint8_t myPushButton_PushButton_PIN_D2 = 2;
- /****** DEFINITION OF LIBRARIES CLASS INSTANCES*****/
- EasyButton myButton(myPushButton_PushButton_PIN_D2); // Create an instance of EasyButton
- void setup(void)
- {
- // put your setup code here, to run once:
- pinMode(myPushButton_PushButton_PIN_D2, INPUT_PULLUP);
- myButton.begin(); // Initialize the button
- }
- void loop(void)
- {
- // put your main code here, to run repeatedly:
- myButton.update(); // Update the button state
- if (myButton.isPressed()) {
- // Code to execute when the button is pressed
- }
- }
- /* END CODE */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement