Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion adc/onboard_temperature/onboard_temperature.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* pico-examples/adc/adc_console/adc_console.c */
float read_onboard_temperature(const char unit) {

/* 12-bit conversion, assume max value == ADC_VREF == 3.3 V */
/* 12-bit conversion, assume max value == ADC_VREF == 3.3 V */4096
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks like a compile error

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, did you mean to put the 4096 inside the comment @ashleey30 ?

const float conversionFactor = 3.3f / (1 << 12);

float adc = (float)adc_read() * conversionFactor;
Expand Down