RGB LCD Shield Fade

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
ciscomonkey
 
Posts: 6
Joined: Wed Mar 07, 2012 5:52 pm

RGB LCD Shield Fade

Post by ciscomonkey »

Did a quick search here of the forum, but didn't see it listed, so I apologize if it has already been covered.

Is there any way to control the LCD brightness using the RGBLCDShield library? I know the usage instructions states there is no PWM on the backlight function at this time, so I was just curious if anyone had a work around or had already coded this up?

I'd like to add a fade function to my menus where I would typically dim the backlight over a few seconds. I realize that I can just turn it off, but the fade has a much cooler look.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: RGB LCD Shield Fade

Post by adafruit_support_mike »

I don't know of any version of the library that's been modded to support backlight PWM.

You'd have to bit-bang it with repeated calls to the MCP23017's digitalWrite() method. The main challenge is getting access to the RGBLCDShield object's MCP23017 object, because that's a private attribute.

The easiest solution would be to move that item up into the public: section so you can play with it in your regular code.

User avatar
ciscomonkey
 
Posts: 6
Joined: Wed Mar 07, 2012 5:52 pm

Re: RGB LCD Shield Fade

Post by ciscomonkey »

Thanks! If I get it working, I'll post it back up here for others. Not sure how much time I'll spend on a "nice to have" feature though. :)

User avatar
jovapo
 
Posts: 5
Joined: Wed Oct 19, 2016 1:39 am

Re: RGB LCD Shield Fade

Post by jovapo »

I was wondering if there was any movement on this over the last 4 years? I want to have the LCD back light show roughly the same color as my dot star LEDs but that requires PWM. If no one has done it should I ditch the shield and wire up the LCD/button directly? Or perhaps I could run just the RGB pins to the arduino directly and still use the shield for other things.

As for using the shield as is, I have lots of programming experience but didn't know a lot about arduino programming and thus I didn't fully understand what was said here:
You'd have to bit-bang it with repeated calls to the MCP23017's digitalWrite() method. The main challenge is getting access to the RGBLCDShield object's MCP23017 object, because that's a private attribute.

The easiest solution would be to move that item up into the public: section so you can play with it in your regular code.
For me getting access to the MCP23017 object is the easy part. Is there a tutorial for bit-banging to control the LEDs?

User avatar
ciscomonkey
 
Posts: 6
Joined: Wed Mar 07, 2012 5:52 pm

Re: RGB LCD Shield Fade

Post by ciscomonkey »

I ended up just not soldering the pin for the backlight pin to the header strip and then wired it up so I could PWM the backlight pin.

User avatar
jovapo
 
Posts: 5
Joined: Wed Oct 19, 2016 1:39 am

Re: RGB LCD Shield Fade

Post by jovapo »

Ok that's the path I will probably take. Did you look into what was suggested at all? Any idea how much work it would be?
ciscomonkey wrote:I ended up just not soldering the pin for the backlight pin to the header strip and then wired it up so I could PWM the backlight pin.

User avatar
ciscomonkey
 
Posts: 6
Joined: Wed Mar 07, 2012 5:52 pm

Re: RGB LCD Shield Fade

Post by ciscomonkey »

There's no PWM on the shield.

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: RGB LCD Shield Fade

Post by adafruit_support_bill »

The i2c port expander chip used to control the LCD display has no native PWM. You would have to bit-bang it with repeated commands to turn pins on and off. That would be a lot of overhead, and probably slow enough to cause some annoying flicker besides. Wiring the backlight pins direct to Arduino PWM pins is a much more practical approach.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”