I’m trying to implement an interface to my 16x2 LCD (HD44780 character LCD connected via PCF8574 on I2C). In both standard Python and MicoPython, I’ve used the lcd_api.py (Found here: https://github.com/dhylands/python_lcd/blob/master/lcd/lcd_api.py) as the base class and implemented my own HAL on top of that (see that git for examples). This is all being done on a ESP32 dev board (LOLIN32).
In the init, I start with the following to initialize I2C:
self.i2c = i2c.I2C(I2C0, i2c_addr, clock=100000)
self.addr = i2c_addr
</div>self._write then does this (cmd is a bytearray):<br><pre class="CodeBlock">try:<br> self.i2c.lock()<br> self.i2c.set_addr(self.addr)<br> self.i2c.write_bytes(self.addr, cmd)<br>except Exception as e:<br> print(e)<br>finally:<br> self.i2c.unlock()The problem is that whenever I try to run this, I get a very useless InvalidHardwareStatusError thrown (useless in that there is nothing in the documentation to tell me what it even means!). I've tried various combinations on how to write commands to the LCD:
Just for my own sanity, I did load my Micropython build on and was able to verify that I had the correct I2C address and the hardware all worked as expected so it appears to be something I'm doing wrong in Zerynth.
To add to the confusion, the documentation could use some extra details. For example (https://docs.zerynth.com/latest/official/core.zerynth.stdlib/docs/official_core.zerynth.stdlib_i2c.html):`write_bytes`(*args, timeout=-1)
args is converted to bytes and sent.`
data is written. ```How is args converted?
What is data? (string? bytearray?)
Some I2C examples and troubleshooting guidelines would be greatly appreciated! Thanks!