Skip to content
Snippets Groups Projects
Commit 48f5a6a1 authored by George-Dănuț ALDEA's avatar George-Dănuț ALDEA
Browse files

Merge branch 'lab06-fix' into 'main'

Lab06 fix

See merge request !83
parents 672f0457 ed09f6e3
No related branches found
No related tags found
1 merge request!83Lab06 fix
Pipeline #111815 passed
...@@ -229,9 +229,9 @@ The `press` contains the raw pressure measurement data. The measurement output i ...@@ -229,9 +229,9 @@ The `press` contains the raw pressure measurement data. The measurement output i
To determine the raw pressure measurement, you need to first read the `press_msb`, `press_lsb` and `press_xlsb` register values, then compute the raw value: To determine the raw pressure measurement, you need to first read the `press_msb`, `press_lsb` and `press_xlsb` register values, then compute the raw value:
```rust ```rust
// Assuming the `press_*` values are u32s. If not, additional // Assuming the `press_*` values are i32s. If not, additional
// casts will be necessary. // casts will be necessary.
let raw_press: u32 = (press_msb << 12) + (press_lsb << 4) + (press_xlsb >> 4) let raw_press: i32 = (press_msb << 12) + (press_lsb << 4) + (press_xlsb >> 4)
``` ```
::: :::
...@@ -249,9 +249,9 @@ The `temp` contains the raw temperature measurement data. The measurement output ...@@ -249,9 +249,9 @@ The `temp` contains the raw temperature measurement data. The measurement output
To determine the raw temperature measurement, you need to first read the `temp_msb`, `temp_lsb` and `temp_xlsb` register values, then compute the raw value: To determine the raw temperature measurement, you need to first read the `temp_msb`, `temp_lsb` and `temp_xlsb` register values, then compute the raw value:
```rust ```rust
// Assuming the `temp_*` values are u32s. If not, additional // Assuming the `temp_*` values are i32s. If not, additional
// casts will be necessary. // casts will be necessary.
let raw_temp: u32 = (temp_msb << 12) + (temp_lsb << 4) + (temp_xlsb >> 4) let raw_temp: i32 = (temp_msb << 12) + (temp_lsb << 4) + (temp_xlsb >> 4)
``` ```
::: :::
...@@ -494,7 +494,7 @@ This should be done **only once**, before reading the sensor. ...@@ -494,7 +494,7 @@ This should be done **only once**, before reading the sensor.
* Read the raw temperature value stored in the `temp` register once a second, and print it to the terminal using the `defmt` macros. Details on how this can be performed can be found in this [subsection](./index.mdx#register-temp-0xfa0xfc) of the register map and in the [Reading a register](./index.mdx#reading-a-register) subsection. (**2p**) * Read the raw temperature value stored in the `temp` register once a second, and print it to the terminal using the `defmt` macros. Details on how this can be performed can be found in this [subsection](./index.mdx#register-temp-0xfa0xfc) of the register map and in the [Reading a register](./index.mdx#reading-a-register) subsection. (**2p**)
3. Based on the raw temperature value previously determined, compute the actual temperature value using the **mock** calibration values provided bellow and the formula described in the [sections above](./index.mdx#temperature-computation-formulae). (**1p**) 3. Based on the raw temperature value previously determined, compute the actual temperature value using the **mock** calibration values provided bellow and the formula described in the [sections above](./index.mdx#temperature-computation-formula). (**1p**)
```rust ```rust
let dig_t1: u16 = 27504; let dig_t1: u16 = 27504;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment