raspi with lcd shield with buttons
Moderators: adafruit_support_bill, adafruit
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
-
- Posts: 15
- Joined: Fri Nov 09, 2012 3:51 pm
raspi with lcd shield with buttons
has anyone tried to use the lcd shield with buttons with a raspberry pi? I bought a couple of those, and I'm interested to see if anyone else has tried it, so I can save a bit of time in developing my device.
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: raspi with lcd shield with buttons
we'll have a version for the raspberry pi shortly - it should be code-compatible with the arduino ones - no ETA on release.
-
- Posts: 15
- Joined: Fri Nov 09, 2012 3:51 pm
Re: raspi with lcd shield with buttons
what about using the existing arduino version with the raspberry pi?
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: raspi with lcd shield with buttons
it should be code-compatible with the arduino ones - no ETA on release.
-
- Posts: 466
- Joined: Thu Aug 30, 2012 1:34 am
Re: raspi with lcd shield with buttons
i think the problem's going to be that you'll want to run the display at 5v and the mcp23017 at 3.3v and the board only has a 5v supply. you could use the 4 channel level converter on the i2c lines, i guess.
-
- Posts: 15
- Joined: Fri Nov 09, 2012 3:51 pm
Re: raspi with lcd shield with buttons
according to the link on the manufacturer's website, the mcp23017 is rated to run up to 5.5v, so would it be correct to assume that voltage isn't really a problem?
-
- Posts: 466
- Joined: Thu Aug 30, 2012 1:34 am
Re: raspi with lcd shield with buttons
not to the shield, but maybe to the pi.
not sure if the shield has pullups to 5v, but i assume that that's what r1 and r2 are. don't want the pi seeing that if it does. i know that with the max1307(?) rtc it is suggested that you leave the 5v pullups off of the breakout when using it with the pi. don't know if you could do that with the 23017.
not sure if the shield has pullups to 5v, but i assume that that's what r1 and r2 are. don't want the pi seeing that if it does. i know that with the max1307(?) rtc it is suggested that you leave the 5v pullups off of the breakout when using it with the pi. don't know if you could do that with the 23017.
-
- Posts: 15
- Joined: Fri Nov 09, 2012 3:51 pm
Re: raspi with lcd shield with buttons
on a related note, is it especially difficult to reconfigure a couple of the button inputs on the lcd shield to drive LEDs instead? I know the pins on the 23017 can be configured as inputs or outputs, so I'm confident that it's possible, but I'm just wondering if someone has already done it, so that I could avoid re-inventing another wheel.
-
- Posts: 466
- Joined: Thu Aug 30, 2012 1:34 am
Re: raspi with lcd shield with buttons
the only problem will be that the library for the shield includes the mcp23017 object as a private member, so i don't think you can get at the pinMode function.
simplest thing might be to just make the mcp23017 member public, so you could use something like
of course, i'm something of an object oriented ignoramus. mostly i just pretend my sketches are written in c. only occasionally does this lead to my being bitten on the ass.
EDIT : i moved the line
from the private to the public definitions in Adafruit_RGBLCDShield.h, then included the two lines above in the setup function in the example sketch and it compiled just fine.
simplest thing might be to just make the mcp23017 member public, so you could use something like
Code: Select all
// the buttons are on pins 0-4.
lcd._i2c.pinMode( 0, OUTPUT);
lcd,_i2c,digitalWrite (0, HIGH);
EDIT : i moved the line
Code: Select all
Adafruit_MCP23017 _i2c;
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/