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:
- Was it intentional to have the
entry
be RightToLeft
? Since the display only displays ascii characters it seems like it should also write left to right ๐ค
- Why are you setting the contrast to
0
? Won't this make it so that no text is visible, which is indeed what we observed when first trying out your code.
- Why are you configuring the OSC to use 1/4 bias (instead of 1/5 bias)? When we do that there seems to be a black background on each character, making them almost impossible to read
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