From 82574131bc11d4542919251c02048d5c0c863b61 Mon Sep 17 00:00:00 2001
From: Stephen D <webmaster@scd31.com>
Date: Wed, 12 Mar 2025 16:18:50 -0400
Subject: [PATCH] fixes

---
 src/main.rs | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/main.rs b/src/main.rs
index c1dac89..57ad2b5 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,15 +1,15 @@
 use anyhow::bail;
 use image::{GenericImageView, ImageReader};
 
-const TOAST_TIME_SECONDS: u64 = 60;
+const TOAST_TIME_SECONDS: u64 = 15;
 const CENTER_X: f64 = 100.0;
 const CENTER_Y: f64 = 100.0;
-const BREAD_HEIGHT: f64 = 15.3;
-const IDLE_HEIGHT: f64 = BREAD_HEIGHT + 10.0;
-const PIXEL_SIZE_MM: f64 = 4.0;
+const BREAD_HEIGHT: f64 = 12.0;
+const IDLE_HEIGHT: f64 = BREAD_HEIGHT + 5.0;
+const PIXEL_SIZE_MM: f64 = 3.0;
 
 fn main() -> anyhow::Result<()> {
-    let img = ImageReader::open("/home/stephen/Downloads/qr_tiny.png")?.decode()?;
+    let img = ImageReader::open("/home/stephen/Downloads/scd31-qr.png")?.decode()?;
 
     preamble();
 
@@ -19,14 +19,14 @@ fn main() -> anyhow::Result<()> {
 
             match p.0 {
                 [0, 0, 0, 255] => {
-                    // nothing, for now
-                }
-                [255, 255, 255, 255] => {
                     toast(
                         x as f64 - (img.width() as f64 / 2.0),
                         y as f64 - (img.height() as f64 / 2.0),
                     );
                 }
+                [255, 255, 255, 255] => {
+                    // white
+                }
                 _ => bail!("Pixel was not entirely black nor entirely white: {:?}", p),
             }
         }
@@ -42,7 +42,7 @@ G28 ; home
 G90 ; absolute positioning
 G0 Z{IDLE_HEIGHT}
 G0 X{CENTER_X} Y{CENTER_Y}
-M109 S220 ; heat hotend to 220C and wait
+M109 S230 ; heat hotend to 230C and wait
 "#
     );
 }
-- 
GitLab