Created
February 27, 2018 16:24
-
-
Save Mr-Coxall/c88678f3b53e673be3e17d57b48afc2a to your computer and use it in GitHub Desktop.
Wifi connection sketch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Created by: Mr. Coxall | |
* Created on: Feb 2018 | |
* | |
** Connect the ESP8266 unit to an existing WiFi access point | |
** For more information see http://42bots.com | |
* | |
* Updated by Mr. Coxall to connect to school network | |
*/ | |
#include <ESP8266WiFi.h> | |
// Replace these with your WiFi network settings | |
const char* ssid = "OCSB"; //replace this with your WiFi network name | |
const char* password = "wireless4all"; //replace this with your WiFi network password | |
void setup() | |
{ | |
WiFi.disconnect(true); | |
delay(100); | |
Serial.begin(9600); | |
WiFi.begin(ssid, password); | |
Serial.println(); | |
Serial.println("Connecting"); | |
while (WiFi.status() != WL_CONNECTED) | |
{ | |
delay(500); | |
//Serial.println(WiFi.status()); | |
Serial.println(WiFi.localIP()); | |
} | |
Serial.println("success!"); | |
Serial.print("IP Address is: "); | |
Serial.println(WiFi.localIP()); | |
WiFi.disconnect(true); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment