0
0
Arduinoprogramming~10 mins

WiFi with ESP8266/ESP32 in Arduino - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to include the WiFi library for ESP8266.

Arduino
#include <[1]>
Drag options to blanks, or click blank then click option'
AWiFi.h
BESP8266WiFi.h
CWiFiClient.h
DESP32WiFi.h
Attempts:
3 left
💡 Hint
Common Mistakes
Including the generic WiFi library instead of the ESP8266 specific one.
Using ESP32 library for ESP8266.
2fill in blank
medium

Complete the code to connect to a WiFi network using SSID and password.

Arduino
WiFi.begin([1], password);
Drag options to blanks, or click blank then click option'
A"mySSID"
BmySSID
Cssid
D"password"
Attempts:
3 left
💡 Hint
Common Mistakes
Using variable names without quotes.
Using the password instead of SSID.
3fill in blank
hard

Fix the error in the code to check if WiFi is connected.

Arduino
if (WiFi.[1]() == WL_CONNECTED) {
Drag options to blanks, or click blank then click option'
Astatus
BisConnected
Cconnect
Dbegin
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'connect' or 'begin' which start connections, not check status.
Using 'isConnected' which does not exist.
4fill in blank
hard

Fill both blanks to print the local IP address after connecting to WiFi.

Arduino
Serial.println(WiFi.[1]());
Serial.print("IP Address: ");
Serial.println(WiFi.[2]());
Drag options to blanks, or click blank then click option'
Astatus
BlocalIP
CmacAddress
DSSID
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'macAddress' or 'SSID' instead of 'localIP'.
Not checking connection status before printing IP.
5fill in blank
hard

Fill all three blanks to create a WiFi access point with SSID and password, then print its IP.

Arduino
WiFi.softAP([1], [2]);
Serial.print("AP IP: ");
Serial.println(WiFi.[3]());
Drag options to blanks, or click blank then click option'
A"MyESP32AP"
B"12345678"
CsoftAPIP
DlocalIP
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'localIP' instead of 'softAPIP' for access point IP.
Not using quotes around SSID and password.