Challenge - 5 Problems
RC Transmitter Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediateOutput of RC channel mapping code
What is the output of this code that maps RC transmitter channels to drone controls?
Drone Programming
channels = ['throttle', 'yaw', 'pitch', 'roll'] input_values = [1500, 1600, 1400, 1550] control_map = {ch: val for ch, val in zip(channels, input_values)} print(control_map)
Attempts:
2 left
💡 Hint
Look at how zip pairs elements from two lists in order.
✗ Incorrect
The zip function pairs elements from channels and input_values in order, creating key-value pairs correctly.
🧠 Conceptual
intermediateUnderstanding PWM signal range for RC channels
What is the typical PWM signal range (in microseconds) used by RC transmitters for each channel?
Attempts:
2 left
💡 Hint
Think about the standard pulse width modulation range for RC signals.
✗ Incorrect
RC transmitters typically use PWM signals ranging from 1000 to 2000 microseconds to represent channel positions.
🔧 Debug
advancedIdentify the error in RC channel calibration code
What error does this code raise when calibrating RC channel values?
code:
calibrated = {ch: val - 1500 for ch, val in [('throttle', 1600), ('yaw', 1400), ('pitch', 1500), ('roll', 1550)]
print(calibrated)
Attempts:
2 left
💡 Hint
Check the dictionary comprehension syntax carefully.
✗ Incorrect
The dictionary comprehension is missing a closing bracket before the print statement, causing a SyntaxError.
📝 Syntax
advancedCorrect syntax for reading RC channel values asynchronously
Which option correctly defines an async function to read RC channel values and print them?
Attempts:
2 left
💡 Hint
Remember Python async function syntax and await keyword usage.
✗ Incorrect
Option A correctly defines an async function and uses await to get asynchronous RC values before printing.
🚀 Application
expertCalculate number of valid RC channel configurations
Given 8 RC channels, each can be assigned a unique function from a set of 8 functions. How many unique ways can you assign functions to channels?
Attempts:
2 left
💡 Hint
Think about permutations of 8 unique items.
✗ Incorrect
Assigning 8 unique functions to 8 channels is a permutation problem: 8! = 40320.
