Created
April 13, 2025 19:12
-
-
Save maxpromer/00a6db150f5f37ac8f2896719da4ca29 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 <WiFi.h> // นำเข้าไลบรารี่ WiFi | |
const char* ssid = "your-ssid"; // ชื่อ WiFi | |
const char* password = "your-password"; // รหัสผ่าน WiFi | |
void setup() { | |
Serial.begin(115200); // เริ่มต้นใช้ Serial ที่ความเร็ว 115200 | |
while(!Serial){delay(100);} | |
// We start by connecting to a WiFi network | |
Serial.println(); | |
Serial.println("******************************************************"); | |
Serial.print("Connecting to "); | |
Serial.println(ssid); | |
WiFi.begin(ssid, password); // เริ่มต้นเชื่อมต่อ WiFi | |
while (WiFi.status() != WL_CONNECTED) { // วนลูปหากยังเชื่อมต่อ WiFi ไม่สำเร็จ | |
delay(500); | |
Serial.print("."); | |
} | |
Serial.println(""); | |
Serial.println("WiFi connected"); | |
Serial.println("IP address: "); | |
Serial.println(WiFi.localIP()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment