Created
December 18, 2016 00:33
-
-
Save pfeerick/f795ef4b6203ca4efb93eb8bdcc3d92a to your computer and use it in GitHub Desktop.
Demo sketch showing how to configure a Digistump Oak's wifi manually without a Particle connection
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
SYSTEM_MODE(MANUAL); | |
#include <ESP8266WiFi.h> | |
//Static IP stuff | |
char SSID[] = "yournetwork"; // your network SSID | |
char passwd[] = "yourpassword"; // your network password | |
void setup() | |
{ | |
pinMode(LED_BUILTIN, OUTPUT); | |
//don't save these details | |
WiFi.persistent(false); | |
//start the WiFi connection process | |
WiFi.begin_internal(SSID, passwd, 0, NULL); | |
//wait for WiFi to connect | |
while (WiFi.status() != WL_CONNECTED) | |
{ | |
digitalWrite(LED_BUILTIN, HIGH); | |
delay(100); | |
digitalWrite(LED_BUILTIN, LOW); | |
delay(100); | |
} | |
} | |
void loop() | |
{ | |
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) | |
delay(1000); // wait for a second | |
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW | |
delay(1000); // wait for a second | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment