0
0
Arduinoprogramming~10 mins

Why wireless is needed for IoT in Arduino - Test Your Understanding

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

Complete the code to define a wireless connection type for IoT.

Arduino
const char* connectionType = "[1]";
Drag options to blanks, or click blank then click option'
Awireless
Bwired
Cusb
Dethernet
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing wired connection which limits device mobility.
2fill in blank
medium

Complete the code to initialize a wireless module for IoT communication.

Arduino
WiFi.begin("SSID", "[1]");
Drag options to blanks, or click blank then click option'
Ausername
Bport
Cipaddress
Dpassword
Attempts:
3 left
💡 Hint
Common Mistakes
Using username instead of password for WiFi connection.
3fill in blank
hard

Fix the error in the code to send data wirelessly using MQTT.

Arduino
client.publish("sensor/data", [1]);
Drag options to blanks, or click blank then click option'
Adata
BsendData()
C"data"
D123
Attempts:
3 left
💡 Hint
Common Mistakes
Using a function call or string literal instead of the data variable.
4fill in blank
hard

Fill both blanks to create a dictionary of sensor readings with wireless transmission condition.

Arduino
if ([1].connected()) {
  client.publish("temp", String([2]));
}
Drag options to blanks, or click blank then click option'
Aclient
Btemperature
CWiFi
Dhumidity
Attempts:
3 left
💡 Hint
Common Mistakes
Checking WiFi connection instead of MQTT client connection.
Sending humidity instead of temperature.
5fill in blank
hard

Fill all three blanks to set up wireless credentials and start connection.

Arduino
const char* ssid = "[1]";
const char* password = "[2]";
WiFi.begin([3]);
Drag options to blanks, or click blank then click option'
AmyNetwork
BmyPassword123
Cssid, password
Dpassword, ssid
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping SSID and password in WiFi.begin.
Using incorrect variable names.