Skip to content

Add support for LCD Keypad Kits #24

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

Closed
caternuson opened this issue Dec 19, 2018 · 8 comments
Closed

Add support for LCD Keypad Kits #24

caternuson opened this issue Dec 19, 2018 · 8 comments

Comments

@caternuson
Copy link
Contributor

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

@ladyada
Copy link
Member

ladyada commented Dec 19, 2018

oh yahh! @kattni i forgot about the buttons - wanna do this up? can return the digitalIO pins upon request

@ladyada
Copy link
Member

ladyada commented Dec 19, 2018

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

@abdullahsurati
Copy link

sgondor from the forums made some code that worked for him. It is given below:

import adafruit_mcp230xx as mcp_
import digitalio

#Create the push buttons
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)

#Define buttons as inputs
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

#Create pull-ups for each button
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

#And then to read the status of a button just use:
up.value
down.value
left.value
right.value
select.value

@ladyada @kattni Check this out

@ladyada
Copy link
Member

ladyada commented Dec 21, 2018

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 :)

@pavelruzicka
Copy link

Hi, is there any update on this? I've been waiting to get my shield buttons working.

@ladyada
Copy link
Member

ladyada commented Jan 12, 2019

oh yeah, this slipped over the holidays - @kattni wanna do this now?

@kattni
Copy link
Contributor

kattni commented Jan 12, 2019

Sure thing! I'll get started on it.

@kattni
Copy link
Contributor

kattni commented Jan 14, 2019

This is now included!

@kattni kattni closed this as completed Jan 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants