Advertisement
pleasedontcode

Button State rev_02

Jan 8th, 2024
100
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 State
  13.     - Source Code compiled for: Arduino Uno
  14.     - Source Code created on: 2024-01-08 12:56:24
  15.  
  16. ********* Pleasedontcode.com **********/
  17.  
  18. /****** SYSTEM REQUIREMENTS *****/
  19. /****** SYSTEM REQUIREMENT 1 *****/
  20.     /* Satyam Kumar */
  21. /****** END SYSTEM REQUIREMENTS *****/
  22.  
  23.  
  24. /********* User code review feedback **********
  25. #### Feedback 1 ####
  26. - 756499
  27. ********* User code review feedback **********/
  28.  
  29. /****** DEFINITION OF LIBRARIES *****/
  30. #include <Arduino.h>
  31. #include <EasyButton.h>
  32.  
  33. /****** SYSTEM REQUIREMENTS *****/
  34. /****** SYSTEM REQUIREMENT 1 *****/
  35. /* Satyam Kumar */
  36. /****** END SYSTEM REQUIREMENTS *****/
  37.  
  38. /****** FUNCTION PROTOTYPES *****/
  39. void setup(void);
  40. void loop(void);
  41.  
  42. /***** DEFINITION OF DIGITAL INPUT PINS *****/
  43. const uint8_t Satyam_PushButton_PIN_D2 = 2;
  44. const uint8_t Satyam_PushButton_PIN_D3 = 3;
  45. const uint8_t Satyam_PushButton_PIN_D4 = 4;
  46. const uint8_t Satyam_PushButton_PIN_D5 = 5;
  47.  
  48. /****** DEFINITION OF LIBRARIES CLASS INSTANCES*****/
  49. EasyButton Satyam_PushButton_D2(Satyam_PushButton_PIN_D2);
  50. EasyButton Satyam_PushButton_D3(Satyam_PushButton_PIN_D3);
  51. EasyButton Satyam_PushButton_D4(Satyam_PushButton_PIN_D4);
  52. EasyButton Satyam_PushButton_D5(Satyam_PushButton_PIN_D5);
  53.  
  54. void setup(void)
  55. {
  56.   // put your setup code here, to run once:
  57.   Serial.begin(115200);
  58.   Serial.println();
  59.   Serial.println(">>> Button Press Example <<<");
  60.   Satyam_PushButton_D2.begin();
  61.   Satyam_PushButton_D3.begin();
  62.   Satyam_PushButton_D4.begin();
  63.   Satyam_PushButton_D5.begin();
  64. }
  65.  
  66. void loop(void)
  67. {
  68.   // put your main code here, to run repeatedly:
  69.   Satyam_PushButton_D2.read();
  70.   Satyam_PushButton_D3.read();
  71.   Satyam_PushButton_D4.read();
  72.   Satyam_PushButton_D5.read();
  73. }
  74.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement