Answers for "using wifi esp8266 example"

2

nodemcu router code

#include <ESP8266WiFi.h>

const char* ssid = "******"; 
const char* password = "******";

IPAddress staticIP(192,168,1,22); 
IPAddress gateway(192,168,1,9); 
IPAddress subnet (255,255,255,0);

void setup(void) {
    Serial.begin(9600); 
    Serial.println();

    Serial.printf("Connecting to Xs \n", ssid); 
    WiFi.begin(ssid, password); 
    WiFi.config(staticIP, gateway, subnet);

    while (WiFi.status() != WL_CONNECTED) {
        delay(500); 
        Serial.print("."); 
    }

    Serial.println();
    Serial.print("Connected, IP address: "); 
    Serial.println(WiFi.localIP());
}
void loop() {}
Posted by: Guest on August-27-2020
0

esp wifi name

#include <ESP8266WiFi.h>

WiFi.hostname("Name");
set before WiFi.begin();
Posted by: Guest on October-05-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language