Complete the code to set the spreading factor to 7 in a LoRa configuration.
lora.set_spreading_factor([1])The spreading factor of 7 is a common default that balances range and data rate.
Complete the code to calculate the data rate given bandwidth and spreading factor.
data_rate = bandwidth / (2 ** [1])
The data rate decreases exponentially with the spreading factor, so 2 to the power of 7 is used.
Fix the error in the code to correctly set the spreading factor variable.
sf = [1] # spreading factor must be an integer
The spreading factor must be an integer, so 7 without quotes or decimals is correct.
Fill both blanks to create a dictionary mapping spreading factor to data rate.
sf_data_rate = { [1]: [2] for [1] in range(7, 10) }The variable 'sf' is used as the key and 'data_rate' as the value in the dictionary comprehension.
Fill all three blanks to filter spreading factors with data rate above threshold.
filtered = { [1]: [2] for [1] in sf_data_rate if [2] > threshold }Use 'sf' as the key, 'data_rate' as the value, and filter where 'data_rate' is greater than threshold.
