mirror of
https://github.com/cccb/servicepoint.git
synced 2025-01-19 02:20:12 +01:00
updated hello display example
This commit is contained in:
parent
005bc6d297
commit
3a90627853
1
hello_display/rustfmt.toml
Normal file
1
hello_display/rustfmt.toml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
max_width = 80
|
|
@ -1,21 +1,17 @@
|
||||||
|
use airportdisplay::{text::Text, Command, Display};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use airportdisplay::{
|
|
||||||
Command,
|
|
||||||
Display,
|
|
||||||
text::Text,
|
|
||||||
text::Buffer,
|
|
||||||
};
|
|
||||||
|
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<()> {
|
||||||
println!("Sending hello display...");
|
println!("Sending hello display...");
|
||||||
let display = Display::open("172.23.42.29:2342".into())?;
|
let display = Display::open("172.23.42.29:2342".into())?;
|
||||||
|
|
||||||
let text = Command::Text(Text::Buffer(
|
let text: String =
|
||||||
Buffer::from(
|
"♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥\n♥ mauuu ♥\n♥ mau mauuuunz! ♥\n♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥".into();
|
||||||
"♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥\n♥ mauuu ♥\n♥ mau mauuuunz! ♥\n♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥".to_string())));
|
|
||||||
|
println!("{}", text);
|
||||||
|
|
||||||
display.send(Command::Clear)?;
|
display.send(Command::Clear)?;
|
||||||
display.send(text)?;
|
display.send(Command::Text(Text::Buffer(text.into())))?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue