Advertisement
pleasedontcode

Button Setup rev_01

Mar 16th, 2024
40
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: Button Setup
  13.     - Source Code compiled for: Arduino Uno
  14.     - Source Code created on: 2024-03-16 11:46:31
  15.  
  16. ********* Pleasedontcode.com **********/
  17.  
  18. /****** SYSTEM REQUIREMENTS *****/
  19. /****** SYSTEM REQUIREMENT 1 *****/
  20.     /* Écris un code en Python pour créer une */
  21.     /* calculatrice, explique ligne par ligne le code */
  22.     /* généré avec des commentaires. */
  23. /****** SYSTEM REQUIREMENT 2 *****/
  24.     /* Écris un code en Python pour créer une */
  25.     /* calculatrice, explique ligne par ligne le code */
  26.     /* généré avec des commentaires. */
  27. /****** END SYSTEM REQUIREMENTS *****/
  28.  
  29. /****** DEFINITION OF LIBRARIES *****/
  30. #include <EasyButton.h> // https://github.com/evert-arias/EasyButton
  31.  
  32. /****** FUNCTION PROTOTYPES *****/
  33. void setup(void);
  34. void loop(void);
  35.  
  36. /***** DEFINITION OF DIGITAL INPUT PINS *****/
  37. const uint8_t GO_PushButton_PIN_D2 = 2;
  38. const uint8_t GO_PushButton_PIN_D3 = 3;
  39. const uint8_t GO_PushButton_PIN_D4 = 4;
  40.  
  41. /****** DEFINITION OF LIBRARIES CLASS INSTANCES*****/
  42. EasyButton button_D2(GO_PushButton_PIN_D2);
  43. EasyButton button_D3(GO_PushButton_PIN_D3);
  44. EasyButton button_D4(GO_PushButton_PIN_D4);
  45.  
  46. void setup(void)
  47. {
  48.   // put your setup code here, to run once:
  49.  
  50.   pinMode(GO_PushButton_PIN_D2, INPUT_PULLUP);
  51.   pinMode(GO_PushButton_PIN_D3, INPUT_PULLUP);
  52.   pinMode(GO_PushButton_PIN_D4, INPUT_PULLUP);
  53.  
  54.   button_D2.begin();
  55.   button_D3.begin();
  56.   button_D4.begin();
  57. }
  58.  
  59. void loop(void)
  60. {
  61.   // put your main code here, to run repeatedly:
  62.   button_D2.read();
  63.   button_D3.read();
  64.   button_D4.read();
  65. }
  66.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement