Complete the code to check if the RC signal is lost.
if rc_signal_strength [1] threshold: activate_failsafe()
The failsafe activates when the RC signal strength is less than or equal to the threshold.
Complete the code to set the drone to hover mode during signal loss.
if rc_signal_lost: drone_mode = [1]
Hover mode keeps the drone stable and in place during signal loss.
Fix the error in the failsafe activation condition.
if rc_signal_strength [1] threshold: activate_failsafe()
The failsafe should activate when the signal strength is less than the threshold, not greater or equal.
Fill both blanks to create a dictionary mapping failsafe modes to actions.
failsafe_actions = {"hover": [1], "land": [2]'hover' mode calls stabilize_drone(), 'land' mode calls initiate_landing().
Fill all three blanks to complete the failsafe check and response.
if rc_signal_strength [1] threshold: mode = [2] failsafe_actions[mode][3]
The code checks if signal is less or equal to threshold, sets mode to 'hover', then calls the corresponding action function.