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/

raspi with lcd shield with buttons

by elkvis on Mon Nov 12, 2012 11:35 am

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.
elkvis
 
Posts: 15
Joined: Fri Nov 09, 2012 3:51 pm

Re: raspi with lcd shield with buttons

by adafruit on Mon Nov 12, 2012 1:36 pm

we'll have a version for the raspberry pi shortly - it should be code-compatible with the arduino ones - no ETA on release.
User avatar
adafruit
 
Posts: 11746
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: raspi with lcd shield with buttons

by elkvis on Mon Nov 12, 2012 4:24 pm

what about using the existing arduino version with the raspberry pi?
elkvis
 
Posts: 15
Joined: Fri Nov 09, 2012 3:51 pm

Re: raspi with lcd shield with buttons

by adafruit on Mon Nov 12, 2012 4:38 pm

it should be code-compatible with the arduino ones - no ETA on release.
User avatar
adafruit
 
Posts: 11746
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: raspi with lcd shield with buttons

by tldr on Mon Nov 12, 2012 4:41 pm

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.
"If I had known it was harmless, I would have killed it myself." - Phillip K. Dick, A Scanner Darkly
User avatar
tldr
 
Posts: 466
Joined: Thu Aug 30, 2012 1:34 am

Re: raspi with lcd shield with buttons

by elkvis on Mon Nov 12, 2012 6:17 pm

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?
elkvis
 
Posts: 15
Joined: Fri Nov 09, 2012 3:51 pm

Re: raspi with lcd shield with buttons

by tldr on Mon Nov 12, 2012 6:48 pm

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.
"If I had known it was harmless, I would have killed it myself." - Phillip K. Dick, A Scanner Darkly
User avatar
tldr
 
Posts: 466
Joined: Thu Aug 30, 2012 1:34 am

Re: raspi with lcd shield with buttons

by elkvis on Wed Nov 14, 2012 3:58 pm

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.
elkvis
 
Posts: 15
Joined: Fri Nov 09, 2012 3:51 pm

Re: raspi with lcd shield with buttons

by tldr on Thu Nov 15, 2012 1:15 am

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

Code: Select all | TOGGLE FULL SIZE
// the buttons are on pins 0-4.
  lcd._i2c.pinMode( 0, OUTPUT);
  lcd,_i2c,digitalWrite (0, HIGH);


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

Code: Select all | TOGGLE FULL SIZE
Adafruit_MCP23017 _i2c;


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.
"If I had known it was harmless, I would have killed it myself." - Phillip K. Dick, A Scanner Darkly
User avatar
tldr
 
Posts: 466
Joined: Thu Aug 30, 2012 1:34 am