mirror of
https://github.com/cccb/servicepoint.git
synced 2025-01-18 18:10:14 +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 airportdisplay::{
|
||||
Command,
|
||||
Display,
|
||||
text::Text,
|
||||
text::Buffer,
|
||||
};
|
||||
|
||||
fn main() -> Result<()> {
|
||||
println!("Sending hello display...");
|
||||
let display = Display::open("172.23.42.29:2342".into())?;
|
||||
|
||||
let text = Command::Text(Text::Buffer(
|
||||
Buffer::from(
|
||||
"♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥\n♥ mauuu ♥\n♥ mau mauuuunz! ♥\n♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥".to_string())));
|
||||
let text: String =
|
||||
"♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥\n♥ mauuu ♥\n♥ mau mauuuunz! ♥\n♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥".into();
|
||||
|
||||
println!("{}", text);
|
||||
|
||||
display.send(Command::Clear)?;
|
||||
display.send(text)?;
|
||||
display.send(Command::Text(Text::Buffer(text.into())))?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue