Go Down

Topic: Controlling the ITDB02 backlight (Read 945 times) previous topic - next topic

I have an ITDB02 shield + 2.4" LCD. In its manual (https://www.google.com.br/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&ved=0CDoQFjAB&url=http%3A%2F%2Fitdb02.googlecode.com%2Ffiles%2FITDB02shield_Manual.pdf&ei=wUaOUdmGHo_M9AT0uIGgBQ&usg=AFQjCNH5ww6GKdFzgBHFOgAT-wpqyldAzA&sig2=Lz-k8D_ghpSyhSSXx0rpuA&cad=rja) is described a resistor becoming it able to handle the backlight, but I don't know which is.

I got the following code in one of these Arduino's forums by here. It draws a group of parallel coloured lines and text, but it backlight is not changed. I tried set different values in backlight_pin variable, but it didn't solve. Anyone knows how to? Tks

Code: [Select]

#include <UTFT.h>

const int backlight_pin = 8;
const int backlight_on = 0;
const int backlight_off = 255;
const int backlight_half = 127;
const int backlight_quarter = 192;
const int backlight_3quarter = 64;

extern uint8_t BigFont[];

// Uncomment the next line for chipKit Uno32
UTFT myGLCD(ITDB24E_8,19,18,17,16);   // Remember to change the model parameter to suit your display module!

// initialisation
void setup() {
// Setup the LCD
  myGLCD.InitLCD();
  myGLCD.setFont(BigFont);
  myGLCD.lcdOn();
  analogWrite(backlight_pin, backlight_on);         
  drawBackground();
}

// Fool with the backlight
void loop() {
  screenMessage("    Full Backlight    "); 
  analogWrite(backlight_pin, backlight_on);
  delay(3000);
  screenMessage("    Half Backlight    "); 
  analogWrite(backlight_pin, backlight_half);
  delay(3000);
  screenMessage("  Quarter Backlight   "); 
  analogWrite(backlight_pin, backlight_half);
  delay(3000);
  screenMessage("      Fade  Down      ");
  for(int i=0;i<256;i++) {
    analogWrite(backlight_pin, i);
    delay(25);
  }
  screenMessage("      Fade  Up       ");
  for(int i=255;i>-1;i--) {
    analogWrite(backlight_pin, i);
    delay(25);
  }
}

// Display the backlight state
void screenMessage(String message) {
  myGLCD.setColor(255,255,255);
  myGLCD.setBackColor(0,0,0);
  myGLCD.print(message, CENTER, 113);
}

// Put some mixed colours in
void drawBackground() {myGLCD.clrScr();
  int r=255;
  int g,b=0; 
  for(int y=0;y<100;y+=20){
    myGLCD.setColor(r, g, b);
    myGLCD.fillRect (0,y,319,y+10);
    r-=16;
    g+=16;
    b+=16;
  }
  r=0;
  g,b=255; 
  for(int y=226;y>100;y-=20){
    myGLCD.setColor(r, g, b);
    myGLCD.fillRect (0,y,319,y-10);
    r+=16;
    g-=16;
    b-=16;
  }


guix

#1
May 11, 2013, 05:51 pm Last Edit: May 11, 2013, 05:53 pm by guix Reason: 1
That blue thing with the screw, is the variable resistor.

#2
May 18, 2013, 07:51 pm Last Edit: May 18, 2013, 07:56 pm by franciscoprado Reason: 1
Blue thing on the shield? Mine does not have (or I didn't find). :(

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy