From 9b1f700dc54cd1eb6dc73e3260b2c284ec91cca4 Mon Sep 17 00:00:00 2001 From: Agathe Porte Date: Sat, 8 Feb 2020 14:28:16 +0100 Subject: add width and height support (hack) --- examples/width_height.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 examples/width_height.rs (limited to 'examples/width_height.rs') diff --git a/examples/width_height.rs b/examples/width_height.rs new file mode 100644 index 0000000..77bb5da --- /dev/null +++ b/examples/width_height.rs @@ -0,0 +1,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(()) +} -- cgit v1.2.3