Snapshot.

This commit is contained in:
mattbk
2026-09-08 22:40:05 -05:00
parent d6d488b4b0
commit ccf554c8a4
3 changed files with 14 additions and 1 deletions
Generated
+7
View File
@@ -692,6 +692,12 @@ version = "1.70.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695"
[[package]]
name = "iter"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3b2e3c8e73c68d760d0c421025a2b740727f1e807bd4a3d6de2ceb886c5dcb9"
[[package]]
name = "konst"
version = "0.2.20"
@@ -889,6 +895,7 @@ version = "0.1.0"
dependencies = [
"clap",
"io",
"iter",
"serialport",
]
+1
View File
@@ -6,5 +6,6 @@ edition = "2024"
[dependencies]
clap = "4.6.6"
io = "0.0.2"
iter = "0.1.0"
serialport = "4.10.0"
+6 -1
View File
@@ -5,6 +5,7 @@ use std::io::ErrorKind;
use std::io::Write;
use std::thread::sleep;
use std::time::Duration;
use core::iter::repeat;
fn get_smeter(comport: &str) -> String {
let mut port = serialport::new(comport, 4800)
@@ -58,6 +59,10 @@ fn main() {
// Simple test loop to make sure we are getting values each time
for _i in 1..101 {
let a = get_smeter(port);
println!("{a}");
//println!("{a}");
match a.parse::<i32>() {
Ok(n) => println!("{} {}", a, "#".repeat(n.try_into().unwrap())),
Err(e) => todo!(),
}
}
}