0
0
Drone Programmingprogramming~10 mins

Why sensors provide situational awareness in Drone Programming - Test Your Understanding

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.

Drone Programming
sensor_value = sensor.[1]()
Drag options to blanks, or click blank then click option'
Aread
Bwrite
Cconnect
Dstart
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'write' instead of 'read' will try to send data, not get it.
2fill in blank
medium

Complete the code to check if the sensor detects an obstacle.

Drone Programming
if sensor.[1]() < 10:
    alert('Obstacle nearby!')
Drag options to blanks, or click blank then click option'
Adistance
Bget_distance
Cmeasure
Ddetect
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'distance' alone is not a method call.
3fill in blank
hard

Fix the error in the code to update sensor data correctly.

Drone Programming
sensor_data = sensor.[1]
Drag options to blanks, or click blank then click option'
Arefresh
Bupdate
Crefresh()
Dupdate()
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting parentheses means the method is not called, just referenced.
4fill in blank
hard

Fill both blanks to create a dictionary of sensor readings above a threshold.

Drone Programming
important_readings = {sensor.[1](): sensor.[2]() for _ in range(5) if sensor.[1]() > 50}
Drag options to blanks, or click blank then click option'
Aget_temperature
Bget_humidity
Cget_pressure
Dget_light
Attempts:
3 left
💡 Hint
Common Mistakes
Using the same method for both blanks will cause incorrect data pairing.
5fill in blank
hard

Fill all three blanks to filter sensor data and create a summary dictionary.

Drone Programming
summary = {sensor.[1](): sensor.[2]() for _ in range(10) if sensor.[3]() < 20}
Drag options to blanks, or click blank then click option'
Aget_light
Bget_temperature
Cget_distance
Dget_humidity
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the methods will cause wrong filtering or data collection.