Advertisement
pleasedontcode

INCUBATOR rev_01

Dec 2nd, 2023
95
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: INCUBATOR
  13.     - Source Code compiled for: Arduino Uno
  14.     - Source Code created on: 2023-12-03 04:16:20
  15.     - Source Code generated by: NITHIYANANDAM.M
  16.  
  17. ********* Pleasedontcode.com **********/
  18. /****** DEFINITION OF LIBRARIES *****/
  19. #include <Arduino.h>
  20. #include <EasyButton.h>
  21.  
  22. /****** DEFINITION OF DIGITAL INPUT PINS *****/
  23. const uint8_t Button_PushButton_PIN_D2 = 2;
  24.  
  25. /****** DEFINITION OF LIBRARIES CLASS INSTANCES *****/
  26. EasyButton Button_PushButton(Button_PushButton_PIN_D2);
  27.  
  28. void setup()
  29. {
  30.   // Initialization code
  31.  
  32.   // Initialize the push button
  33.   Button_PushButton.begin();
  34.  
  35.   // Set up the button callback function
  36.   Button_PushButton.onPressed([]() {
  37.     // Callback function when button is pressed
  38.     Serial.println("Button Pressed");
  39.   });
  40.  
  41.   // Initialize the Serial communication
  42.   Serial.begin(115200);
  43. }
  44.  
  45. void loop()
  46. {
  47.   // Main code
  48.  
  49.   // Read the state of the push button
  50.   Button_PushButton.read();
  51. }
  52.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement