Skip to content
Snippets Groups Projects
Commit 82574131 authored by Stephen D's avatar Stephen D
Browse files

fixes

parent f0f185f9
No related branches found
No related tags found
No related merge requests found
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
"#
);
}
......
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