Reduce number of digits to 3

This commit is contained in:
Luca 2023-07-29 16:02:12 +02:00
parent 0956055d6a
commit 5288a77775
1 changed files with 2 additions and 2 deletions

View File

@ -203,12 +203,12 @@ fn main() -> ! {
if counter == 0 { if counter == 0 {
led.toggle().unwrap(); led.toggle().unwrap();
let mut bytes: [u8; 8] = [32, 32, 32, 32, 32, 194, 176, 67]; let mut bytes: [u8; 8] = [32, 32, 32, 32, 194, 176, 67];
let text = match thermocouple.read_temperature(&mut timer.count_down()) { let text = match thermocouple.read_temperature(&mut timer.count_down()) {
Ok(mut temperature) => { Ok(mut temperature) => {
temperature >>= 2; temperature >>= 2;
for i in (0..4).rev() { for i in (0..3).rev() {
bytes[i] = 48u8 + (temperature % 10) as u8; bytes[i] = 48u8 + (temperature % 10) as u8;
temperature /= 10; temperature /= 10;