Closed caternuson closed 5 years ago
oh yahh! @kattni i forgot about the buttons - wanna do this up? can return the digitalIO pins upon request
i think we can pre-define the digitalIO's in the RGB I2C LCD object, and set them to input_pullup's, then you can acces them from like lcd.up_button.value
or whatnot
sgondor from the forums made some code that worked for him. It is given below:
import adafruitmcp230xx as mcp import digitalio
up = mcp.get_pin(3) down = mcp.get_pin(2) left = mcp.get_pin(4) right = mcp.get_pin(1) select = mcp.get_pin(0)
up.direction = digitalio.Direction.INPUT down.direction = digitalio.Direction.INPUT left.direction = digitalio.Direction.INPUT right.direction = digitalio.Direction.INPUT select.direction = digitalio.Direction.INPUT
up.pull = digitalio.Pull.UP down.pull = digitalio.Pull.UP left.pull = digitalio.Pull.UP right.pull = digitalio.Pull.UP select.pull = digitalio.Pull.UP
up.value down.value left.value right.value select.value
@ladyada @kattni Check this out
yep that will work just fine, we'd like to have that all done for you in the library - we'll get to it shortly, lots of people traveling this week :)
Hi, is there any update on this? I've been waiting to get my shield buttons working.
oh yeah, this slipped over the holidays - @kattni wanna do this now?
Sure thing! I'll get started on it.
This is now included!
Add support for these products: https://www.adafruit.com/category/808
The old lib had this: https://github.com/adafruit/Adafruit_Python_CharLCD/blob/master/Adafruit_CharLCD/Adafruit_CharLCD.py#L430