From 6f052edad25c8c4bcba89455917a3c21afc8e3e9 Mon Sep 17 00:00:00 2001 From: Luca Date: Sat, 29 Jul 2023 16:02:12 +0200 Subject: [PATCH] Reduce number of digits to 3 --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index c3bfef8..cbd0812 100644 --- a/src/main.rs +++ b/src/main.rs @@ -203,12 +203,12 @@ fn main() -> ! { if counter == 0 { led.toggle().unwrap(); - let mut bytes: [u8; 8] = [32, 32, 32, 32, 32, 194, 176, 67]; + let mut bytes: [u8; 7] = [32, 32, 32, 32, 194, 176, 67]; let text = match thermocouple.read_temperature(&mut timer.count_down()) { Ok(mut temperature) => { temperature >>= 2; - for i in (0..4).rev() { + for i in (0..3).rev() { bytes[i] = 48u8 + (temperature % 10) as u8; temperature /= 10;