Skip to content

Commit

Permalink
use ADC_TEMPERATURE_CHANNEL_NUM instead of hard-coded channel '4'
Browse files Browse the repository at this point in the history
  • Loading branch information
bablokb committed Nov 2, 2024
1 parent cf76704 commit d6be48b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ports/raspberrypi/common-hal/microcontroller/Processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
float common_hal_mcu_processor_get_temperature(void) {
adc_init();
adc_set_temp_sensor_enabled(true);
adc_select_input(4);
adc_select_input(ADC_TEMPERATURE_CHANNEL_NUM);
uint16_t value = adc_read();
adc_set_temp_sensor_enabled(false);
float voltage = value * 3.3 / (1 << 12);
Expand Down

0 comments on commit d6be48b

Please sign in to comment.