VOOZH about

URL: https://qiita.com/hilucky/items/3e74d28c03d71f2f3caa

⇱ ESP32をWiFiにつなげる #Arduino - Qiita


👁 Image
14

Go to list of users who liked

9

Share on X(Twitter)

Share on Facebook

Add to Hatena Bookmark

More than 5 years have passed since last update.

@hilucky(hilucky)

ESP32をWiFiにつなげる

14
Posted at

ESP32をWiFiに繋げたので、スケッチを書いておく

ESP32-DevKitC 及び HiLetgo ESP-32s NodeMCU
ArduinoIDE 1.8.5

Arduino WiFi Library
https://www.arduino.cc/en/Reference/WiFi

WiFi.ino

# include <WiFi.h>

// 接続先のSSIDとパスワード
const char ssid[] = "########";
const char passwd[] = "########";

void setup() {
 Serial.begin(115200);

 // Connect WiFi
 connectWiFi();
}
void loop() {
 // Reconnect
 if ( WiFi.status() == W_DISCONNECTED ) {
 connectWiFi();
 }
}

/**
 * Connect WiFi
 */
void connectWiFi()
{
 WiFi.begin(ssid, passwd);
 Serial.print("WiFi connecting...");
 while(WiFi.status() != WL_CONNECTED) {
 Serial.print(".");
 delay(100);
 }
 Serial.print(" connected. ");
 Serial.println(WiFi.localIP());
}
14

Go to list of users who liked

9
0

Go to list of comments

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14

Go to list of users who liked

9