summaryrefslogtreecommitdiffstats
path: root/examples/width_height.rs
blob: 77bb5dacf314593e2697be72e44383bcd93a5028 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
use charlcd::Screen;
use std::io::Write;

fn main() -> std::io::Result<()> {
    let mut screen = Screen::default()?;

    screen.clear()?;
    screen.write(format!("width: {}\n", screen.width()?).as_bytes())?;
    screen.write(format!("height: {}\n", screen.height()?).as_bytes())?;

    Ok(())
}