Add descriptions to all RP2040 examples. Some need hardware that was not specified.

This commit is contained in:
Henrik Berg
2023-07-13 11:16:11 +02:00
parent d979841f17
commit 588c0479f5
33 changed files with 122 additions and 5 deletions

View File

@ -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
}