Complete the code to define the main control loop function in ArduPilot.
def main_loop(): while True: [1]()
The main control loop calls process_sensors() to read sensor data continuously.
Complete the code to initialize the communication module in ArduPilot.
def initialize_communication(): comm = [1]() comm.setup()
The communication module is initialized by creating an instance of CommModule.
Fix the error in the function that updates the flight mode in ArduPilot.
def update_flight_mode(mode): if mode == [1]: set_mode('AUTO') else: set_mode('MANUAL')
The mode should be compared as a string literal 'AUTO' with quotes.
Fill both blanks to create a dictionary comprehension that maps sensor names to their readings if the reading is above 50.
sensor_data = { [1]: sensors[[2]] for [1] in sensors if sensors[[1]] > 50 }Use the same variable name sensor for keys and indexing in the comprehension.
Fill all three blanks to create a dictionary comprehension that maps uppercase sensor names to their readings if the reading is less than 100.
filtered_sensors = { [1]: [2] for [3] in sensors if sensors[[3]] < 100 }The comprehension uses sensor as the loop variable, maps uppercase names to readings.
