Skip to content

Instantly share code, notes, and snippets.

@Ryanhu1015
Created June 5, 2017 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ryanhu1015/ce34c5ce25119d9443225ee06f167535 to your computer and use it in GitHub Desktop.
Save Ryanhu1015/ce34c5ce25119d9443225ee06f167535 to your computer and use it in GitHub Desktop.
ESP8266 WiFi connection
#include <ESP8266WiFi.h>
const char* ssid = "...";// type in the SSID name which you want to connect
const char* password = "...";// type the password of the WiFi AP you choose
void setup() {
Serial.begin(115200);
delay(10);
// Connect to WiFi network
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment