Code Monkey home page Code Monkey logo

st7032i's Introduction

st7032i

Platform agnostic Rust driver for the Dot Matrix LCD Controller (Sitronix ST7032i or similar).

Documentation

The documentation can be found at docs.rs.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

st7032i's People

Contributors

dotcypress avatar

Stargazers

Roman avatar Max Vasiliev avatar

Watchers

James Cloos avatar  avatar

st7032i's Issues

LCD initialization

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:

  1. 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 ๐Ÿค”
  2. 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.
  3. 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.