-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enabling Grove - 16x2 LCD (JHD1804) #136
base: master
Are you sure you want to change the base?
Conversation
self.command(0x30) | ||
else: | ||
raise ValueError('Invalid data bus mode: {}'.format(self.data_bus_mode)) | ||
if self._i2c_expander != 'JHD1804': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this not applicable to the JHD1804? The way I understand it, a port expander only forwards the commands to the hitachi chip.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this line doesn't work, see tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line doesn't work in tests, but it works in reality. the value of _i2c_expander
comes from the CharLCD
class, the same as e.g. in the next line if self.data_bus_mode == c.LCD_4BITMODE:
, with the difference that data_bus_mode
is always defined self.data_bus_mode = c.LCD_4BITMODE
(line 153 in i2c.py) while the expander must be defined when creating the object:
if i2c_expander in ['PCF8574', 'MCP23008', 'MCP23017', 'JHD1802']:
self._i2c_expander = i2c_expander
else:
raise NotImplementedError('I2C expander "%s" is not supported.' % i2c_expander)
(i2c.py 131 to 134)
I don't see an expander defined anywhere in the tests, but the object creation still goes through?
Adds another LCD for use:
https://www.seeedstudio.com/Grove-16x2-LCD-White-on-Blue.html