Skip to content

Commit 894c16c

Browse files
Bugfixlet
1 parent 508df28 commit 894c16c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Adafruit_CharLCDPlate/Adafruit_CharLCDPlate.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,9 @@ def __init__(self, busnum=-1, addr=0x20, debug=False):
116116
def out4(self, bitmask, value):
117117
b = bitmask | self.flip[value >> 4] # Insert high 4 bits of data
118118
# Write initial !E state, data is sampled on rising strobe edge
119-
self.mcp.i2c.bus.write_byte_data(
120-
self.mcp.i2c.address, self.mcp.MCP23017_OLATB, b)
119+
# Commented out, seems to be OK setting & strobing at same time
120+
# self.mcp.i2c.bus.write_byte_data(
121+
# self.mcp.i2c.address, self.mcp.MCP23017_OLATB, b)
121122
# Strobe high (enable)
122123
self.mcp.i2c.bus.write_byte_data(
123124
self.mcp.i2c.address, self.mcp.MCP23017_OLATB, b | 0b00100000)
@@ -197,6 +198,7 @@ def write(self, value, char_mode=False):
197198
# Mask out data bits & RW from current OLATB value
198199
a = ((self.mcp.outputvalue >> 8) & 0b00000001)
199200
if char_mode: a |= 0b10000000 # RS = Command/data
201+
b = a
200202

201203
# If string or list, iterate through multiple write ops
202204
if isinstance(value, str):

0 commit comments

Comments
 (0)