Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /********* Pleasedontcode.com **********
- Pleasedontcode thanks you for automatic code generation! Enjoy your code!
- - Terms and Conditions:
- You have a non-exclusive, revocable, worldwide, royalty-free license
- for personal and commercial use. Attribution is optional; modifications
- are allowed, but you're responsible for code maintenance. We're not
- liable for any loss or damage. For full terms,
- please visit pleasedontcode.com/termsandconditions.
- - Project: WiFi Setup
- - Source Code NOT compiled for: ESP8266 NodeMCU V1.0
- - Source Code created on: 2025-07-04 22:31:49
- ********* Pleasedontcode.com **********/
- /****** SYSTEM REQUIREMENTS *****/
- /****** SYSTEM REQUIREMENT 1 *****/
- /* Implement a Wi-Fi connection feature using the */
- /* ESP8266 NodeMCU V1.0 to enable remote control of */
- /* connected devices. */
- /****** END SYSTEM REQUIREMENTS *****/
- /* START CODE */
- /****** DEFINITION OF LIBRARIES *****/
- // Include the ESP8266WiFi library for Wi-Fi connectivity
- #include <ESP8266WiFi.h>
- /****** FUNCTION PROTOTYPES *****/
- void setup(void);
- void loop(void);
- // Wi-Fi network credentials
- const char* ssid = "Your_SSID"; // Replace with your Wi-Fi SSID
- const char* password = "Your_PASSWORD"; // Replace with your Wi-Fi password
- void setup(void)
- {
- // put your setup code here, to run once:
- Serial.begin(115200);
- delay(10);
- Serial.println();
- Serial.println("Connecting to WiFi...");
- // Initiate Wi-Fi connection
- WiFi.begin(ssid, password);
- // Wait for connection
- while (WiFi.status() != WL_CONNECTED) {
- delay(500);
- Serial.print(".");
- }
- Serial.println("");
- Serial.println("WiFi connected");
- Serial.print("IP address: ");
- Serial.println(WiFi.localIP());
- }
- void loop(void)
- {
- // put your main code here, to run repeatedly:
- // For example, you can add code to handle remote control commands
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement