Advertisement
pleasedontcode

esp8266clock rev_01

Nov 24th, 2023
70
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: esp8266clock
  13.     - Source Code compiled for: Arduino Uno
  14.     - Source Code created on: 2023-11-24 13:43:39
  15.     - Source Code generated by: vijay
  16.  
  17. ********* Pleasedontcode.com **********/
  18. /****** DEFINITION OF LIBRARIES *****/
  19. #include <Arduino.h>
  20. #include <EasyButton.h>
  21.  
  22. /****** SYSTEM REQUIREMENT 1 *****/
  23. /* p10wificlock */
  24.  
  25. /****** FUNCTION PROTOTYPES *****/
  26. void setup(void);
  27. void loop(void);
  28.  
  29. /***** DEFINITION OF DIGITAL INPUT PINS *****/
  30. const uint8_t p10rgb_PushButton_PIN_D2 = 2;
  31. const uint8_t p10rgb_PushButton_PIN_D3 = 3;
  32. const uint8_t p10rgb_PushButton_PIN_D4 = 4;
  33.  
  34. /****** DEFINITION OF LIBRARIES CLASS INSTANCES*****/
  35. EasyButton button1(p10rgb_PushButton_PIN_D2);
  36. EasyButton button2(p10rgb_PushButton_PIN_D3);
  37. EasyButton button3(p10rgb_PushButton_PIN_D4);
  38.  
  39. void onPressed1()
  40. {
  41.   // Code to be executed when button 1 is pressed
  42. }
  43.  
  44. void onPressed2()
  45. {
  46.   // Code to be executed when button 2 is pressed
  47. }
  48.  
  49. void onPressed3()
  50. {
  51.   // Code to be executed when button 3 is pressed
  52. }
  53.  
  54. void setup(void)
  55. {
  56.   // put your setup code here, to run once:
  57.   pinMode(p10rgb_PushButton_PIN_D2, INPUT_PULLUP);
  58.   pinMode(p10rgb_PushButton_PIN_D3, INPUT_PULLUP);
  59.   pinMode(p10rgb_PushButton_PIN_D4, INPUT_PULLUP);
  60.  
  61.   button1.begin();
  62.   button1.onPressed(onPressed1);
  63.  
  64.   button2.begin();
  65.   button2.onPressed(onPressed2);
  66.  
  67.   button3.begin();
  68.   button3.onPressed(onPressed3);
  69. }
  70.  
  71. void loop(void)
  72. {
  73.   // put your main code here, to run repeatedly:
  74.   button1.read();
  75.   button2.read();
  76.   button3.read();
  77. }
  78.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement