Pages: [1]   Go Down
Author Topic: Controlling the ITDB02 backlight  (Read 779 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
#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;
  }

Logged

France
Offline Offline
Edison Member
*
Karma: 38
Posts: 1009
Scientia potentia est.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That blue thing with the screw, is the variable resistor.
« Last Edit: May 11, 2013, 10:53:10 am by guix » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Blue thing on the shield? Mine does not have (or I didn't find). smiley-sad
« Last Edit: May 18, 2013, 12:56:42 pm by franciscoprado » Logged

Pages: [1]   Go Up
Jump to: