Open Rakesh420 opened 4 years ago
Did you solve this problem?
HI I just tested the code on Windows PC with Arduino 1.8.13 and it compiles just fine. Please make sure you are using the latest stable version of Arduino
I am using, Arduino version 1.8.13, but it still showing same error
`#include
// WiFi network name and password: const char networkName = "TELLO-XXXXXX";//Replace with your Tello SSID const char networkPswd = "";
//Are we currently connected? boolean connected = false;
Tello tello;
void setup() { Serial.begin(9600); //Connect to the WiFi network connectToWiFi(networkName, networkPswd); }
void loop() { // put your main code here, to run repeatedly: if(connected ) { tello.takeoff(); delay(5000); tello.up(30); delay(2000); tello.down(30); delay(2000); tello.right(30); delay(2000); tello.left(30); delay(2000); tello.land(); //you have 5 seconds to save your tello before it takes off again delay(5000);
//do once and go into a while loop
while(1)
{
delay(5000);
}
} }
void connectToWiFi(const char ssid, const char pwd) { Serial.println("Connecting to WiFi network: " + String(ssid));
// delete old config WiFi.disconnect(true); //register event handler WiFi.onEvent(WiFiEvent);
//Initiate connection WiFi.begin(ssid, pwd);
Serial.println("Waiting for WIFI connection..."); }
//wifi event handler void WiFiEvent(WiFiEvent_t event) { switch (event) { case SYSTEM_EVENT_STA_GOT_IP: //When connected set Serial.print("WiFi connected! IP address: "); Serial.println(WiFi.localIP()); //initialise Tello after we are connected tello.init(); connected = true; break;
case SYSTEM_EVENT_STA_DISCONNECTED:
Serial.println("WiFi lost connection");
connected = false;
break;
} } `
Arduino: 1.8.10 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled, All SSL ciphers (most compatible), 4M (no SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"
tello_example:63:16: error: variable or field 'WiFiEvent' declared void
void WiFiEvent(WiFiEvent_t event)
tello_example:63:16: error: 'WiFiEvent_t' was not declared in this scope
F:\telloArduino-master\tello_example\tello_example.ino: In function 'void connectToWiFi(const char, const char)':
tello_example:52:23: error: no matching function for call to 'WiFiClass::disconnect(bool)'
WiFi.disconnect(true);
F:\telloArduino-master\tello_example\tello_example.ino:52:23: note: candidate is:
In file included from C:\Users\R\Documents\Arduino\libraries\tello/Tello.h:12:0,
C:\Program Files (x86)\Arduino\libraries\WiFi\src/WiFi.h:130:9: note: int WiFiClass::disconnect()
C:\Program Files (x86)\Arduino\libraries\WiFi\src/WiFi.h:130:9: note: candidate expects 0 arguments, 1 provided
tello_example:54:8: error: 'class WiFiClass' has no member named 'onEvent'
WiFi.onEvent(WiFiEvent);
tello_example:54:16: error: 'WiFiEvent' was not declared in this scope
WiFi.onEvent(WiFiEvent);
tello_example:57:23: error: invalid conversion from 'const char' to 'char' [-fpermissive]
WiFi.begin(ssid, pwd);
In file included from C:\Users\R\Documents\Arduino\libraries\tello/Tello.h:12:0,
C:\Program Files (x86)\Arduino\libraries\WiFi\src/WiFi.h:79:9: error: initializing argument 1 of 'int WiFiClass::begin(char, const char)' [-fpermissive]
F:\telloArduino-master\tello_example\tello_example.ino: At global scope:
tello_example:63:16: error: variable or field 'WiFiEvent' declared void
void WiFiEvent(WiFiEvent_t event)
tello_example:63:16: error: 'WiFiEvent_t' was not declared in this scope
Multiple libraries were found for "SPI.h" Used: C:\Users\R Multiple libraries were found for "Tello.h" Used: C:\Users\R Not used: C:\Users\R Multiple libraries were found for "WiFi.h" Used: C:\Program Multiple libraries were found for "ESP8266WiFi.h" Used: C:\Users\R exit status 1 variable or field 'WiFiEvent' declared void
This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.