summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAgathe Porte <microjoe@microjoe.org>2020-02-23 11:38:35 +0100
committerAgathe Porte <microjoe@microjoe.org>2020-02-23 11:38:35 +0100
commit3110d3fa3a2a5a17fd467b30a4acaeab9ff8b978 (patch)
tree78fdea9a4f295b7cb554b1fc6b32482e04a21610
parentc07aa9f0c068200d80f6635c221dd7480e53766a (diff)
downloadcharlcd-3110d3fa3a2a5a17fd467b30a4acaeab9ff8b978.tar.gz
charlcd-3110d3fa3a2a5a17fd467b30a4acaeab9ff8b978.zip
add special_char pub mod
-rw-r--r--examples/special_char.rs35
-rw-r--r--src/lib.rs1
-rw-r--r--src/special_char.rs19
3 files changed, 55 insertions, 0 deletions
diff --git a/examples/special_char.rs b/examples/special_char.rs
new file mode 100644
index 0000000..5f66fd9
--- /dev/null
+++ b/examples/special_char.rs
@@ -0,0 +1,35 @@
+use charlcd::special_char;
+use charlcd::Screen;
+use std::io::Write;
+
+fn main() -> std::io::Result<()> {
+ let mut screen = Screen::default()?;
+
+ screen.clear()?;
+
+ screen.write(&[special_char::ALPHA])?;
+ screen.write(&[special_char::BETA])?;
+ screen.write(&[special_char::EPSILON])?;
+ screen.write(&[special_char::MU])?;
+ screen.write(&[special_char::SIGMA])?;
+ screen.write(&[special_char::RO])?;
+ screen.write(&[special_char::THETA])?;
+ screen.write(&[special_char::OMEGA])?;
+ screen.write(&[special_char::SIGMA_UPPER])?;
+ screen.write(&[special_char::PI])?;
+
+ screen.write(b"\n")?;
+
+ screen.write(&[special_char::SQRT])?;
+ screen.write(&[special_char::INV])?;
+ screen.write(&[special_char::INFINITE])?;
+ screen.write(&[special_char::DIV])?;
+ screen.write(&[special_char::MEAN])?;
+
+ screen.write(&[special_char::MEDIAN_DOT])?;
+ screen.write(&[special_char::BLOCK])?;
+
+ screen.flush()?;
+
+ Ok(())
+}
diff --git a/src/lib.rs b/src/lib.rs
index 6b1d6e1..49a32b0 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,6 +1,7 @@
mod codes;
pub mod custom_char;
mod of_node;
+pub mod special_char;
use std::fs::{File, OpenOptions};
use std::path::Path;
diff --git a/src/special_char.rs b/src/special_char.rs
new file mode 100644
index 0000000..a5a8807
--- /dev/null
+++ b/src/special_char.rs
@@ -0,0 +1,19 @@
+pub const ALPHA: u8 = 0xe0;
+pub const BETA: u8 = 0xe2;
+pub const EPSILON: u8 = 0xe3;
+pub const MU: u8 = 0xe4;
+pub const SIGMA: u8 = 0xe5;
+pub const RO: u8 = 0xe6;
+pub const THETA: u8 = 0xf2;
+pub const OMEGA: u8 = 0xf4;
+pub const SIGMA_UPPER: u8 = 0xf6;
+pub const PI: u8 = 0xf7;
+
+pub const SQRT: u8 = 0xe8;
+pub const INV: u8 = 0xe9;
+pub const INFINITE: u8 = 0xf3;
+pub const DIV: u8 = 0xfd;
+pub const MEAN: u8 = 0xf8;
+
+pub const MEDIAN_DOT: u8 = 0xa5;
+pub const BLOCK: u8 = 0xff;