Advertisement
pleasedontcode

EasyButton Integration rev_01

May 10th, 2024
768
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /********* Pleasedontcode.com **********
  2.  
  3.     Pleasedontcode thanks you for automatic code generation! Enjoy your code!
  4.  
  5.     - Terms and Conditions:
  6.     You have a non-exclusive, revocable, worldwide, royalty-free license
  7.     for personal and commercial use. Attribution is optional; modifications
  8.     are allowed, but you're responsible for code maintenance. We're not
  9.     liable for any loss or damage. For full terms,
  10.     please visit pleasedontcode.com/termsandconditions.
  11.  
  12.     - Project: EasyButton Integration
  13.     - Source Code NOT compiled for: Arduino Uno
  14.     - Source Code created on: 2024-05-10 06:28:07
  15.  
  16. ********* Pleasedontcode.com **********/
  17.  
  18. /****** SYSTEM REQUIREMENTS *****/
  19. /****** SYSTEM REQUIREMENT 1 *****/
  20.     /* Tutn off light */
  21. /****** SYSTEM REQUIREMENT 2 *****/
  22.     /* Tutn off light */
  23. /****** END SYSTEM REQUIREMENTS *****/
  24.  
  25. /****** DEFINITION OF LIBRARIES *****/
  26. #include <EasyButton.h> //https://github.com/evert-arias/EasyButton
  27.  
  28. /****** FUNCTION PROTOTYPES *****/
  29. void setup(void);
  30. void loop(void);
  31.  
  32. /***** DEFINITION OF DIGITAL INPUT PINS *****/
  33. const uint8_t Yu_PushButton_PIN_D2      = 2;
  34. const uint8_t Yu_PushButton_PIN_D3      = 3;
  35. const uint8_t Yu_PushButton_PIN_D4      = 4;
  36.  
  37. /****** DEFINITION OF LIBRARIES CLASS INSTANCES*****/
  38.  
  39. // Define EasyButton objects
  40. EasyButton buttonD2(Yu_PushButton_PIN_D2);
  41. EasyButton buttonD3(Yu_PushButton_PIN_D3);
  42. EasyButton buttonD4(Yu_PushButton_PIN_D4);
  43.  
  44. void setup(void)
  45. {
  46.     // put your setup code here, to run once:
  47.  
  48.     pinMode(Yu_PushButton_PIN_D2,   INPUT_PULLUP);
  49.     pinMode(Yu_PushButton_PIN_D3,   INPUT_PULLUP);
  50.     pinMode(Yu_PushButton_PIN_D4,   INPUT_PULLUP);
  51.  
  52.     // Initialize EasyButton objects
  53.     buttonD2.begin();
  54.     buttonD3.begin();
  55.     buttonD4.begin();
  56. }
  57.  
  58. void loop(void)
  59. {
  60.     // put your main code here, to run repeatedly:
  61.  
  62.     // Read the buttons
  63.     buttonD2.read();
  64.     buttonD3.read();
  65.     buttonD4.read();
  66. }
  67.  
  68. /* END CODE */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement