Advertisement
pleasedontcode

esp8266clock rev_02

Nov 24th, 2023
78
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 14:00:20
  15.     - Source Code generated by: vijay
  16.  
  17. ********* Pleasedontcode.com **********/
  18. /****** DEFINITION OF LIBRARIES *****/
  19. #include <Arduino.h>
  20. #include <EasyButton.h>
  21. #include <DFRobot_DS1307.h>
  22.  
  23. /****** SYSTEM REQUIREMENT 1 *****/
  24. /* p10wificlock */
  25.  
  26. /****** SYSTEM REQUIREMENT 2 *****/
  27. /* esp8266p10clocdatetimedayfullcolur */
  28.  
  29. /****** FUNCTION PROTOTYPES *****/
  30. void setup(void);
  31. void loop(void);
  32.  
  33. /***** DEFINITION OF DIGITAL INPUT PINS *****/
  34. const uint8_t p10rgb_PushButton_PIN_D2 = 2;  // Button connected to pin D2
  35. const uint8_t p10rgb_PushButton_PIN_D3 = 3;  // Button connected to pin D3
  36. const uint8_t p10rgb_PushButton_PIN_D4 = 4;  // Button connected to pin D4
  37.  
  38. /****** DEFINITION OF LIBRARIES CLASS INSTANCES*****/
  39. EasyButton p10rgb_PushButton_D2(p10rgb_PushButton_PIN_D2);
  40. EasyButton p10rgb_PushButton_D3(p10rgb_PushButton_PIN_D3);
  41. EasyButton p10rgb_PushButton_D4(p10rgb_PushButton_PIN_D4);
  42.  
  43. void setup(void)
  44. {
  45.   // put your setup code here, to run once:
  46.   p10rgb_PushButton_D2.begin();
  47.   p10rgb_PushButton_D3.begin();
  48.   p10rgb_PushButton_D4.begin();
  49. }
  50.  
  51. void loop(void)
  52. {
  53.   // put your main code here, to run repeatedly:
  54.   p10rgb_PushButton_D2.read();
  55.   p10rgb_PushButton_D3.read();
  56.   p10rgb_PushButton_D4.read();
  57.  
  58.   // Handle button states and perform actions
  59.   if (p10rgb_PushButton_D2.isPressed())
  60.   {
  61.     // Button D2 is pressed, perform action
  62.     // TODO: Add code here to handle button D2 press
  63.   }
  64.  
  65.   if (p10rgb_PushButton_D3.isPressed())
  66.   {
  67.     // Button D3 is pressed, perform action
  68.     // TODO: Add code here to handle button D3 press
  69.   }
  70.  
  71.   if (p10rgb_PushButton_D4.isPressed())
  72.   {
  73.     // Button D4 is pressed, perform action
  74.     // TODO: Add code here to handle button D4 press
  75.   }
  76. }
  77.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement