Snapshot.
This commit is contained in:
+6
-1
@@ -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!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user