Add descriptions to all RP2040 examples. Some need hardware that was not specified.
This commit is contained in:
@ -1,3 +1,6 @@
|
||||
//! This example test the ADC (Analog to Digital Conversion) of the RS2040 pin 26, 27 and 28.
|
||||
//! It also reads the temperature sensor in the chip.
|
||||
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
@ -38,5 +41,5 @@ async fn main(_spawner: Spawner) {
|
||||
|
||||
fn convert_to_celsius(raw_temp: u16) -> f32 {
|
||||
// According to chapter 4.9.5. Temperature Sensor in RP2040 datasheet
|
||||
27.0 - (raw_temp as f32 * 3.3 / 4096.0 - 0.706) / 0.001721 as f32
|
||||
27.0 - (raw_temp as f32 * 3.3 / 4096.0 - 0.706) / 0.001721
|
||||
}
|
||||
|
Reference in New Issue
Block a user