So far I am yet to find a python tutorial on I2C that does not simply import a module that does everything in the background so I'd be extremely happy if someone could point me to an appropriate resource. To summarise: What data makes up the register and value? Unfortunately that did not work and the display still shows me the characters from when I used another library to write to it. Value expects an int aswell so 00000001 from binary to decimal turns into 1. Register expects an int so 00 turns into 0. I want to pass a command to the display so RS and R/W should both be 0. I've tried using the write_word_data(i2c_addr, register, value, force=None) method: from smbus2 import SMBus I am getting stuck on how to put the 10 inputs into byte format and what part is data and what is the register I need to write to. There are two versions of the chip's ROM with two different fonts: HD44780UA00, Japanese katakana characters, and HD44780UA02, which includes Western European characters. The chip comes with a built-in font and the ability to define up to 8 custom characters. > R/W to specify whether I am reading or writing (in case of the LCD display I will only be writing) The LCD1602 uses the Hitachi HD44780 LCD controller chip. > RS to specify whether I am sending data or a command To control the lcd display I have to control 10 inputs. The smbus2 documentation provides several methods to send data to an I2C device. The datasheet gives instructions on how to clear the display: The datasheet shows how to drive the LCD directly via its 16 pins but I am not sure how this translates to I2C. I've chosen the smbus2 library to send data to the display. Now I'd like to look a bit under the hood and learn how to drive the display by sending bits & bytes directly rather than passing a string to a function without understanding how it works. I've used one of the many python librarys to confirm that the display is working. I've purchased a generic 1602 lcd display and I2C adapter from ebay and am interested to control it over I2C.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |