-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathip.ino
36 lines (29 loc) · 984 Bytes
/
ip.ino
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
#include <ESP8266WiFi.h>
const char* ssid = "Haridas KP"; // Your WiFi ssid
const char* password = "9096562712"; // Your Wifi password;
// the setup function runs once when you press reset or power the board
void setup() {
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.print("Attempting to connect to SSID");
WiFi.begin(ssid, password);
// Attempt to connect to WiFi network:
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
// Connect to WPA/WPA2 network. Change this line if using open or WEP network:
// Wait 1 seconds for connection:
delay(1000);
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
//You can get IP address assigned to ESP
Serial.print("MAC: ");
Serial.println(WiFi.macAddress());
}
void loop() {
// put your main code here, to run repeatedly:
}