Advertisement
pleasedontcode

haroon rev_02

Sep 23rd, 2023
142
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: haroon
  13.     - Source Code compiled for: Arduino Uno
  14.     - Source Code created on: 2023-09-23 23:37:24
  15.     - Source Code generated by: Haroon
  16.  
  17. ********* Pleasedontcode.com **********/
  18. /****** DEFINITION OF LIBRARIES *****/
  19. #include <Arduino.h>
  20. #include <EasyButton.h>
  21.  
  22. /****** SYSTEM REQUIREMENT 1 *****/
  23.     /* auto editing app */
  24.  
  25. /****** FUNCTION PROTOTYPES *****/
  26. void setup(void);
  27. void loop(void);
  28.  
  29. /***** DEFINITION OF DIGITAL INPUT PINS *****/
  30. const uint8_t haroon_PushButton_PIN_D2 = 2;
  31. const uint8_t haroon_PushButton_PIN_D3 = 3;
  32.  
  33. // Instantiate EasyButton objects
  34. static EasyButton haroon_PushButton_D2(haroon_PushButton_PIN_D2);
  35. static EasyButton haroon_PushButton_D3(haroon_PushButton_PIN_D3);
  36.  
  37. void setup(void)
  38. {
  39.     // put your setup code here, to run once:
  40.  
  41.     pinMode(haroon_PushButton_PIN_D2,   INPUT_PULLUP);
  42.     pinMode(haroon_PushButton_PIN_D3,   INPUT_PULLUP);
  43.  
  44.     // Initialize EasyButton objects
  45.     haroon_PushButton_D2.begin();
  46.     haroon_PushButton_D3.begin();
  47.  
  48. }
  49.  
  50.  
  51. void loop(void)
  52. {
  53.     // put your main code here, to run repeatedly:
  54.  
  55.     // Check if button D2 is pressed
  56.     if (haroon_PushButton_D2.read())
  57.     {
  58.         // Button D2 is pressed, do something
  59.     }
  60.  
  61.     // Check if button D3 is pressed
  62.     if (haroon_PushButton_D3.read())
  63.     {
  64.         // Button D3 is pressed, do something
  65.     }
  66.  
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement