I've soldered little metal "jumpers" from LCD pins 16, 17, and 18 to the top of the shield header pins 6, 5, and 3, respectively. I tried to then write PWM values from 0-255 to those pins at the same time (that is, 255 to pins 6, 5, 3) and I get a weird redish/blueish color instead of white. (Using the regular library to set the backlight to white works.)
Here's my dumbed down code to test the backlight setting. Note that I've removed any references to your library to prevent any initialization on the LCD that may prevent this from working.
- Code: Select all
// Test for the RGB backlight control via PWM
int brightness = 0; // how bright the LED is
int fadeAmount = 5; // how many points to fade the LED by
void setup() {
// Debugging output
Serial.begin(9600);
// Init backlight PWM outputs!
pinMode(3, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
// Oddly enough, 0 = full brightness
analogWrite(3, 0);
analogWrite(5, 0);
analogWrite(6, 0);
Serial.println("Displaying full brightness (white)");
delay(2000);
}
void loop() {
analogWrite(3, brightness);
analogWrite(5, brightness);
analogWrite(6, brightness);
Serial.print("Setting overall brightness to ");
Serial.println(brightness);
brightness = brightness + fadeAmount;
if (brightness == 0 || brightness == 255) {
fadeAmount = -fadeAmount ;
}
delay(30);
}
Is this a software problem or a hardware one?