summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
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(())
+}