summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorRomain Porte <microjoe@microjoe.org>2020-02-08 14:28:16 +0100
committerRomain Porte <microjoe@microjoe.org>2020-02-08 14:28:16 +0100
commit5b4b95fc25d92615fe2555cac0d53c425e5201b0 (patch)
treef17c74b1187d03edc8a030200ce107f5321f997e /examples
parent7be6f770263b4a3bbaab32ab4aa7d88ca43089fa (diff)
downloadcharlcd-5b4b95fc25d92615fe2555cac0d53c425e5201b0.tar.gz
charlcd-5b4b95fc25d92615fe2555cac0d53c425e5201b0.zip
add width and height support (hack)
Diffstat (limited to 'examples')
-rw-r--r--examples/width_height.rs12
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(())
+}