Snapshot.
This commit is contained in:
Generated
+7
@@ -692,6 +692,12 @@ version = "1.70.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695"
|
checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "iter"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b3b2e3c8e73c68d760d0c421025a2b740727f1e807bd4a3d6de2ceb886c5dcb9"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "konst"
|
name = "konst"
|
||||||
version = "0.2.20"
|
version = "0.2.20"
|
||||||
@@ -889,6 +895,7 @@ version = "0.1.0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"io",
|
"io",
|
||||||
|
"iter",
|
||||||
"serialport",
|
"serialport",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -6,5 +6,6 @@ edition = "2024"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
clap = "4.6.6"
|
clap = "4.6.6"
|
||||||
io = "0.0.2"
|
io = "0.0.2"
|
||||||
|
iter = "0.1.0"
|
||||||
serialport = "4.10.0"
|
serialport = "4.10.0"
|
||||||
|
|
||||||
|
|||||||
+6
-1
@@ -5,6 +5,7 @@ use std::io::ErrorKind;
|
|||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use std::thread::sleep;
|
use std::thread::sleep;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
use core::iter::repeat;
|
||||||
|
|
||||||
fn get_smeter(comport: &str) -> String {
|
fn get_smeter(comport: &str) -> String {
|
||||||
let mut port = serialport::new(comport, 4800)
|
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
|
// Simple test loop to make sure we are getting values each time
|
||||||
for _i in 1..101 {
|
for _i in 1..101 {
|
||||||
let a = get_smeter(port);
|
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!(),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user