ESP32 – Get in touch!

Open up Arduino IDE. The following code just connects to a WiFi network and return the status via serial.
Check out the Serial Monitor after uploading: Tools>SerialMonitor

#include "WiFi.h"

const char* ssid = "my-network";
const char* pw = "my-password";

void setup()
{
  Serial.begin(115200);
  WiFi.begin(ssid, pw);
  
  while(WiFi.status() != WL_CONNECTED)
  {
    delay(500);
    Serial.println("Connecting to WiFi...");
  }
  Serial.println("Connected to WiFi network");
}

void loop()
{
}

Leave a Reply

Your email address will not be published. Required fields are marked *