Delete main.rs

This commit is contained in:
Кобелев Андрей Андреевич
2026-01-28 01:37:06 +05:00
parent 446a710e01
commit c8917047cc

View File

@@ -1,45 +0,0 @@
use anyhow::Result;
use m::vfd::VfdConfig;
use m::worker::VfdWorker;
use std::time::Duration;
fn main() -> Result<()> {
let port_name = std::env::args()
.nth(1)
.unwrap_or("/dev/cu.usbmodem101".into());
let width: usize = std::env::args()
.nth(2)
.as_deref()
.unwrap_or("20")
.parse()
.unwrap_or(20);
let cfg = VfdConfig::new(port_name).with_width(width);
let worker = VfdWorker::start(cfg)?;
let vfd = worker.handle();
// === бизнес-логика (демо) ===
vfd.clear();
vfd.set_brightness(0);
vfd.set_marquee_text(" Вставай самурай, у нас город в огне! Пора на работу!");
vfd.start_marquee(1, 8, Duration::from_millis(1500));
{
std::thread::sleep(Duration::from_millis(800));
vfd.set_brightness(1);
std::thread::sleep(Duration::from_millis(800));
vfd.set_brightness(2);
std::thread::sleep(Duration::from_millis(800));
vfd.set_brightness(3);
std::thread::sleep(Duration::from_millis(800));
vfd.set_brightness(4);
}
// останавливаем
std::thread::sleep(Duration::from_secs(30));
vfd.stop_marquee();
// graceful shutdown (или просто выйти — Drop у VfdWorker сделает shutdown+join)
vfd.shutdown();
Ok(())
}