How to control the display's backlight in the sketch?

or it could be the resistance in the backlighting leds....

Yes this, I'm pretty sure: the trimmer's input is 3.3V, output is LED-A pin, which probably stand for LED Anode. If I put a wire between LED-A (pin19) and GND (pin 1), the backlights turns OFF.

And to add to that: in the datasheet of the SSD1289 controller, there is not a single word about backlight, however there is code to turn ON/OFF the display, I tried it and does what it says, turn ON/OFF the display, but doesn't have any effect on the backlight.

void UTFT::lcdOff()
{
	cbi(P_CS, B_CS);
	switch (display_model)
	{
		case PCF8833:
			LCD_Write_COM(0x28);
			break;

		//I added this ------------------------
		case SSD1289:
			//turn OFF
			LCD_Write_COM_DATA(0x07,0x0000);
			LCD_Write_COM_DATA(0x00,0x0000);
			LCD_Write_COM_DATA(0x10,0x0001);
			
			//only standby mode ON: no visible difference?
			//LCD_Write_COM_DATA(0x10,0x0001);
			break;
		//-------------------------------------
	}
	sbi(P_CS, B_CS);
}

void UTFT::lcdOn()
{
	cbi(P_CS, B_CS);
	switch (display_model)
	{
		case PCF8833:
			LCD_Write_COM(0x29);
			break;

		//I added this ------------------------
		case SSD1289:
			//turn ON
			LCD_Write_COM_DATA(0x07,0x0021);
			LCD_Write_COM_DATA(0x00,0x0001);
			LCD_Write_COM_DATA(0x07,0x0023);
			LCD_Write_COM_DATA(0x10,0x0000);
			delay(30); 
			LCD_Write_COM_DATA(0x07,0x0033);
			LCD_Write_COM_DATA(0x11,0x60B0);
			LCD_Write_COM_DATA(0x02,0x0600);
			LCD_Write_COM(0x22);
		
			//only standby mode OFF: no visible difference?
			//LCD_Write_COM_DATA(0x10,0x0000);
			break;
		//-------------------------------------
	}
	sbi(P_CS, B_CS);
}

So... If I just replace the trimmer by something else that does basically the same thing (analogWrite), isn't that OK? Then, you could reply to my questions :slight_smile: