arduino连接WiFi代码
时间: 2023-06-04 09:06:10 浏览: 378
Arduino Uno Wifi的ArduinoWiFi.h资源和范例,以及简单配置
以下是连接 WiFi 的 Arduino 代码示例:
#include <WiFi.h>
const char* ssid = "your_network_name";
const char* password = "your_network_password";
void setup() {
Serial.begin(9600);
delay(1000);
Serial.println("Connecting to WiFi...");
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to WiFi...");
}
Serial.println("Connected to WiFi!");
}
void loop() {
// Your code here
}
阅读全文