Skip to content

Instantly share code, notes, and snippets.

@netmaniac
Last active May 15, 2019 12:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save netmaniac/39fd35d548c998ffd70aeffcb91c7d22 to your computer and use it in GitHub Desktop.
Save netmaniac/39fd35d548c998ffd70aeffcb91c7d22 to your computer and use it in GitHub Desktop.
#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