Advertisement
pleasedontcode

Wi-Fi Reveal rev_01

Oct 20th, 2024
76
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: Wi-Fi Reveal
  13.     - Source Code NOT compiled for: Arduino Uno
  14.     - Source Code created on: 2024-10-20 07:52:07
  15.  
  16. ********* Pleasedontcode.com **********/
  17.  
  18. /****** SYSTEM REQUIREMENTS *****/
  19. /****** SYSTEM REQUIREMENT 1 *****/
  20.     /* Show Wi-Fi password */
  21. /****** END SYSTEM REQUIREMENTS *****/
  22.  
  23. /****** DEFINITION OF LIBRARIES *****/
  24. #include <EasyButton.h> //https://github.com/evert-arias/EasyButton
  25.  
  26. /****** FUNCTION PROTOTYPES *****/
  27. void setup(void);
  28. void loop(void);
  29.  
  30. /***** DEFINITION OF DIGITAL INPUT PINS *****/
  31. const uint8_t Sh_PushButton_PIN_D2 = 2;
  32.  
  33. /****** DEFINITION OF LIBRARIES CLASS INSTANCES*****/
  34. // Initialize the EasyButton object for the push button
  35. EasyButton pushButton(Sh_PushButton_PIN_D2); // Create an instance of EasyButton for the defined pin
  36.  
  37. // Define the Wi-Fi password
  38. const char* wifiPassword = "your_wifi_password"; // Replace with your actual Wi-Fi password
  39.  
  40. void setup(void)
  41. {
  42.     // put your setup code here, to run once:
  43.    
  44.     // Start the serial communication for debugging
  45.     Serial.begin(115200);
  46.  
  47.     // Initialize the push button
  48.     pushButton.begin(); // Call the begin method to initialize the button
  49.  
  50.     // Set the button's callback function for when it is pressed
  51.     pushButton.onPressed([]() {
  52.         Serial.print("Wi-Fi Password: "); // Print message when button is pressed
  53.         Serial.println(wifiPassword); // Display the Wi-Fi password
  54.     });
  55. }
  56.  
  57. void loop(void)
  58. {
  59.     // put your main code here, to run repeatedly:
  60.    
  61.     // Read the state of the button
  62.     pushButton.read(); // Call read method to check the button state
  63. }
  64.  
  65. /* END CODE */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement