Hello,
I want to connect to the WiFi at home and using this code I got from the Internet. When
I compile it, I get the error message:
exit status 1
'class WiFiClass' has no member named 'mode'
So it does not recognize the line:
WiFi.mode(WIFI_STA);
Any ideas of what goes wrong? Just look at the coding.
Greetings,
Thomas, DL3TL
/*
Transfer weather station data via WiFi to server
*/
#include "WiFi.h"
#include <WiFiClient.h>
#include <WiFiServer.h>
#include <WiFiUdp.h>
const char* ssid = "MagentaWLAN-R75V";
const char* password = "70767048290050865805";
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
if (WiFi.status() != WL_CONNECTED) {
BlinkErrorFast();
}
else {
WiFi.disconnect()
BlinkOK();
}
}