RGB LCD for MPGuino
Hi all,
long-time lurker, finally pulled the trigger and got all the components to make an MPGuino.
I'm using a freeduino board with an adafruit 16x2 RGB backlight negative LCD. While in the future I'd like to modify the code so I can change the colors using the buttons, right now I'm just trying to set it up to display orange.
This only requires red and green light (in theory) so I hooked up the red cathode to Pin 10 on the board, and the green cathode to 11, as I was under the impression from the adafruit documentation that the cathodes needed to be wired to PWM pins. Is this necessary to have the LCD display in a solid color, or is it just for when making the LCD change colors intermittently?
I added the following lines to my code:
under //LCD Pins:
#define RedPin 10
#define GreenPin 11
#define COMMON_ANODE
under void setup(void):
pinMode(RedPin,OUTPUT);
pinMode(GreenPin,OUTPUT);
setColor(83, 4);
at the bottom:
void setColor(int red, int green)
{
#ifdef COMMON_ANODE
red = 255 - red;
green = 255 - green;
#endif
analogWrite(RedPin, red);
analogWrite(GreenPin, green);
}
How's my code look? I haven't hooked up to the VSS, inj, or +12V yet, currently I'm testing it through USB power. The problem I'm experiencing is the screen flashes brighter about 2 times per second. Can anybody help me troubleshoot this issue?
Thanks :-)
Edit: For clarification, my board is using an ATMega328 chip, and I believe I'm using an old version of the MPGuino software, as the main download link is down. I used an old archived MPGuino.pde file from Github that's
dated June 2009, so I assume it's v0.82. If anybody has a link to where I could grab the v0.86 .pde file, I'd really appreciate it.
Last edited by stoatmax; 12-07-2016 at 07:42 AM..
Reason: Just for kicks
|