Advertisement
pleasedontcode

Button Detection rev_01

Aug 20th, 2024
86
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: Button Detection
  13.     - Source Code NOT compiled for: Arduino Uno
  14.     - Source Code created on: 2024-08-20 09:22:51
  15.  
  16. ********* Pleasedontcode.com **********/
  17.  
  18. /****** SYSTEM REQUIREMENTS *****/
  19. /****** SYSTEM REQUIREMENT 1 *****/
  20.     /* Inserire all inizio dello script le chiavi api di */
  21.     /* bybit  STRUMENTI DA TRADARE   future perpetual in */
  22.     /* coppia con usdt  INDICATORI  Zscore 20 giorni */
  23.     /* Stocastico 14 giorni   SMA 20 timeframe 45m */
  24.     /* SETTAGGIO  Timeframe: 4h  Importo: 1000 usd */
  25.     /* Leverage: 1 */
  26. /****** END SYSTEM REQUIREMENTS *****/
  27.  
  28. /****** DEFINITION OF LIBRARIES *****/
  29. #include <EasyButton.h> // https://github.com/evert-arias/EasyButton
  30.  
  31. /****** FUNCTION PROTOTYPES *****/
  32. void setup(void);
  33. void loop(void);
  34.  
  35. /***** DEFINITION OF DIGITAL INPUT PINS *****/
  36. const uint8_t start_PushButton_PIN_D2 = 2;
  37.  
  38. /****** DEFINITION OF LIBRARIES CLASS INSTANCES *****/
  39. // Instantiate EasyButton object for the push button
  40. EasyButton startButton(start_PushButton_PIN_D2);
  41.  
  42. /****** FUNCTION DEFINITIONS *****/
  43. void setup(void)
  44. {
  45.     // Initialize serial communication for debugging
  46.     Serial.begin(115200);
  47.    
  48.     // Print a startup message
  49.     Serial.println();
  50.     Serial.println(">>> EasyButton example <<<");
  51.  
  52.     // Initialize the button
  53.     startButton.begin();
  54.    
  55.     // Set up the button press event handler
  56.     startButton.onPressed([]() {
  57.         Serial.println("Start Button pressed");
  58.     });
  59. }
  60.  
  61. void loop(void)
  62. {
  63.     // Continuously read the button state
  64.     startButton.read();
  65. }
  66.  
  67. /* END CODE */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement