-
Notifications
You must be signed in to change notification settings - Fork 0
/
487-2-4.txt
38 lines (31 loc) · 948 Bytes
/
487-2-4.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <ESP8266WiFi.h>
#ifndef STASSID
#define STASSID "nockanda"
#define STAPSK "11213144"
#endif
const char* ssid = STASSID;
const char* password = STAPSK;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
/* Explicitly set the ESP8266 to be a WiFi-client, otherwise, it by default,
would try to act as both a client and an access-point and could cause
network-issues with your other WiFi-devices on your WiFi-network. */
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}
void loop() {
// put your main code here, to run repeatedly:
}