コンテンツにスキップ

Webへの接続

 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
#include <WiFi.h>

const char ssid[] = "TELLO-CFA1DB";
const char pass[] = "";

void WiFiEvent(WiFiEvent_t event) {
  switch (event) {
        case SYSTEM_EVENT_STA_CONNECTED:
            Serial.println("Connected");
            break;
        case SYSTEM_EVENT_STA_DISCONNECTED:
            Serial.println("Disconnected");
            break;
    }
}

void setup() {
  Serial.begin(115200);
  Serial.println("Setup");
  WiFi.onEvent(WiFiEvent);
  WiFi.begin(ssid, pass);
  Serial.println("Try to connect");
}

void loop() {
}