Skip to content

Commit

Permalink
Merge pull request #9784 from bablokb/rp2350b_temp
Browse files Browse the repository at this point in the history
use ADC_TEMPERATURE_CHANNEL_NUM instead of hard-coded channel '4'
  • Loading branch information
dhalbert authored Nov 2, 2024
2 parents cf76704 + d6be48b commit e0256be
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 e0256be

Please sign in to comment.