Last active
May 15, 2019 12:41
-
-
Save netmaniac/39fd35d548c998ffd70aeffcb91c7d22 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#include <ESP8266WiFi.h> | |
#define AP | |
void setup() { | |
// put your setup code here, to run once: | |
Serial.begin(115200); | |
#ifdef AP | |
Serial.println("Access Point"); | |
WiFi.mode(WIFI_AP); | |
WiFi.softAP("testAP", "", 1, false, 1); | |
#else | |
Serial.println("Station"); | |
// WiFi.mode(WIFI_STA); | |
WiFi.begin("siec", "haslo"); | |
while (WiFi.status() != WL_CONNECTED) { | |
delay(500); | |
Serial.print("."); | |
} | |
Serial.println(""); | |
Serial.println("WiFi connected"); | |
Serial.println("IP address: "); | |
Serial.println(WiFi.localIP()); | |
} | |
#endif | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment