Bird
0
0
Arduinoprogramming~10 mins

Displaying sensor data on screen 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 read the sensor value.

Arduino
int sensorValue = analogRead([1]);
Drag options to blanks, or click blank then click option'
AA0
B5
C13
DLED_BUILTIN
Attempts:
3 left
💡 Hint
Common Mistakes
Using a digital pin number instead of an analog pin.
Using LED_BUILTIN instead of the sensor pin.
2fill in blank
medium

Complete the code to initialize the serial communication.

Arduino
Serial.begin([1]);
Drag options to blanks, or click blank then click option'
A19200
B4800
C115200
D9600
Attempts:
3 left
💡 Hint
Common Mistakes
Using a baud rate that does not match the serial monitor setting.
Choosing a very low or very high baud rate without reason.
3fill in blank
hard

Fix the error in printing the sensor value to the serial monitor.

Arduino
Serial.println([1]);
Drag options to blanks, or click blank then click option'
AanalogRead
BsensorValue
Cvalue
Dsensor
Attempts:
3 left
💡 Hint
Common Mistakes
Using a variable name that was never declared.
Trying to print the function name instead of the variable.
4fill in blank
hard

Fill both blanks to create a dictionary-like structure to store sensor names and values.

Arduino
String sensorData = "[1]: " + String([2]);
Drag options to blanks, or click blank then click option'
ATemperature
BsensorValue
CHumidity
Dvalue
Attempts:
3 left
💡 Hint
Common Mistakes
Using a variable name instead of a string for the sensor name.
Not converting the sensor value to a string before concatenation.
5fill in blank
hard

Fill all three blanks to read sensor data, convert it, and print with a label.

Arduino
int [1] = analogRead(A0);
float [2] = [3] * (5.0 / 1023.0);
Serial.println("Voltage: " + String([2]));
Drag options to blanks, or click blank then click option'
AsensorRaw
BsensorVoltage
Attempts:
3 left
💡 Hint
Common Mistakes
Using the same variable name for both raw and converted values.
Not converting the raw value correctly to voltage.