Advertisement
pleasedontcode

web rev_01

Nov 14th, 2023
74
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: web
  13.     - Source Code compiled for: Arduino Mega
  14.     - Source Code created on: 2023-11-15 05:44:53
  15.     - Source Code generated by: SHREENIKESH
  16.  
  17. ********* Pleasedontcode.com **********/
  18. /****** DEFINITION OF LIBRARIES *****/
  19. #include <Arduino.h>
  20. #include <EasyButton.h>
  21.  
  22. /****** SYSTEM REQUIREMENT 1 *****/
  23. /* wallpaper website looks beautiful */
  24.  
  25. /****** FUNCTION PROTOTYPES *****/
  26. void setup(void);
  27. void loop(void);
  28.  
  29. /***** DEFINITION OF DIGITAL INPUT PINS *****/
  30. const uint8_t web_PushButton_PIN_D2 = 2;
  31. const uint8_t web_PushButton_PIN_D3 = 3;
  32.  
  33. /****** DEFINITION OF LIBRARIES CLASS INSTANCES*****/
  34. EasyButton web_PushButton_D2(web_PushButton_PIN_D2);
  35. EasyButton web_PushButton_D3(web_PushButton_PIN_D3);
  36.  
  37. void onWebPushButtonD2Pressed() {
  38.   // Code to execute when web_PushButton_D2 is pressed
  39.   Serial.println("web_PushButton_D2 pressed");
  40. }
  41.  
  42. void onWebPushButtonD3Pressed() {
  43.   // Code to execute when web_PushButton_D3 is pressed
  44.   Serial.println("web_PushButton_D3 pressed");
  45. }
  46.  
  47. void setup(void)
  48. {
  49.   // put your setup code here, to run once:
  50.   Serial.begin(115200);
  51.  
  52.   pinMode(web_PushButton_PIN_D2, INPUT_PULLUP);
  53.   pinMode(web_PushButton_PIN_D3, INPUT_PULLUP);
  54.  
  55.   web_PushButton_D2.begin();
  56.   web_PushButton_D3.begin();
  57.  
  58.   web_PushButton_D2.onPressed(onWebPushButtonD2Pressed);
  59.   web_PushButton_D3.onPressed(onWebPushButtonD3Pressed);
  60. }
  61.  
  62. void loop(void)
  63. {
  64.   // put your main code here, to run repeatedly:
  65.   web_PushButton_D2.read();
  66.   web_PushButton_D3.read();
  67. }
  68.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement