Complete the code to start the ADC conversion.
ADC_Start([1]);The function ADC_Start is called with the ADC channel to begin conversion. Here, ADC1 is the correct channel.
Complete the code to check if the ADC conversion is complete.
if (ADC_GetFlagStatus([1]) == SET) { /* conversion done */ }
The flag ADC_FLAG_EOC (End Of Conversion) indicates the ADC has finished converting.
Fix the error in reading the ADC value.
uint16_t adcValue = [1]();The correct function to get the converted ADC value is ADC_GetConversionValue().
Fill both blanks to create a dictionary comprehension that maps channel numbers to their ADC values if the value is above 1000.
adc_results = { [1]: [2] for [1] in channels if [2] > 1000 }We use ch as the loop variable for channels and adc_value as the value for each channel. The comprehension maps channel to its ADC value if the value is above 1000.
Fill all three blanks to create a dictionary comprehension that maps channel names in uppercase to their ADC values if the value is greater than 2000.
adc_data = { [1].[2](): [3] for [1] in channels if [3] > 2000 }The loop variable is ch. We call upper() on it to get uppercase channel names. The ADC value is stored in adc_val. The comprehension filters values greater than 2000.