dotcypress / st7032i Goto Github PK
View Code? Open in Web Editor NEWPlatform agnostic Rust driver for the Sitronix ST7032i Dot Matrix LCD Controller.
License: Apache License 2.0
Platform agnostic Rust driver for the Sitronix ST7032i Dot Matrix LCD Controller.
License: Apache License 2.0
Hello,
I'm trying to switch to your library instead of my own code. But I'm running into a bit of problems.
The first step of debugging was looking at the init
function. Our two functions are quite different. Mine just looks like:
const INIT: [u8; 10] = hex!("00383914785e6d0c0106");
// ...
impl<I: Write> ST7032<I> {
// ...
pub fn init(&mut self) -> Result<(), I::Error> {
self.device.write(ST7032_I2CADDR, &INIT)
}
// ...
}
After comparing each command that our codes sends out, I was able to make the following changes to your code to get it to work with my display:
diff --git a/src/lib.rs b/src/lib.rs
index 91fc70a..381112a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -83,7 +83,7 @@ where
i2c,
delay,
lines,
- entry: Direction::RightToLeft,
+ entry: Direction::LeftToRigh,
scroll: false,
display: false,
cursor: false,
@@ -109,10 +109,10 @@ where
self.off()?;
- self.send_osc_config(true, 0)?;
- self.send_contrast(0)?;
- self.send_booster_config(true, false, 0)?;
- self.send_follower_config(true, 0)?;
+ self.send_osc_config(false, 0b100)?;
+ self.send_contrast(0b1000)?;
+ self.send_booster_config(true, true, 2)?;
+ self.send_follower_config(true, 0b101)?;
self.send_entry_mode()?;
self.delay.delay_ms(20);
My code also skips the self.off()?;
call, which seems unnecessary...
This leaves me with some questions:
entry
be RightToLeft
? Since the display only displays ascii characters it seems like it should also write left to right ๐ค0
? Won't this make it so that no text is visible, which is indeed what we observed when first trying out your code.I would love to submit a PR so that this can work on my end, but I of course still want it to work for you! Would appreciate any input you might have
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.