diff options
author | Agathe Porte <microjoe@microjoe.org> | 2020-02-08 14:28:16 +0100 |
---|---|---|
committer | Agathe Porte <microjoe@microjoe.org> | 2020-02-08 14:28:16 +0100 |
commit | 9b1f700dc54cd1eb6dc73e3260b2c284ec91cca4 (patch) | |
tree | 9d407e0c951d04578afc442723563d5cc78c7cb3 /examples | |
parent | 61a61f3907e802f0be9bc0039a84ebaabba7b372 (diff) | |
download | charlcd-9b1f700dc54cd1eb6dc73e3260b2c284ec91cca4.tar.gz charlcd-9b1f700dc54cd1eb6dc73e3260b2c284ec91cca4.zip |
add width and height support (hack)
Diffstat (limited to 'examples')
-rw-r--r-- | examples/width_height.rs | 12 |
1 files changed, 12 insertions, 0 deletions
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(()) +} |