Skip to main content
Arduino

Return to Question

Commonmark migration
Source Link

#UPDATE 1:

UPDATE 1:

#UPDATE 1:

UPDATE 1:

Tweeted twitter.com/StackArduino/status/1234357912669126657
added 11 characters in body
Source Link
dda
  • 1.6k
  • 1
  • 12
  • 17

I have bought a 2.5" TFT shield online, which is equipped with the ILI9341 controller and. I need to dim the intensity of the background LEDs to match ambient light.

This particular shield does not provide a pin to control the intensity of the LEDs with PWM via a separate input, so I need to dim the background LEDs of this display via software.

The zip file with the libraries can be downloaded: here .

Does one of you know how can issue a command to the TFT display to dim the background LED'sLEDs?

UPDATE#UPDATE 1:

I wrote a new function to set the displyadisplay's brightness by controlling the background LEDs, but something is missing as I can seem to be writing correctly to the display. So I'm trying to get the display to answer to a known command first, like 0x28 (Display Off).

// Set display brightness (background LED's)
void Adafruit_TFTLCD::setDisplayBrightness(uint8_t x) {
 // Try with 0x28 (Display Off) to see if display reacts
 writeRegister8(0x28, 0);
return;
}
// New functions
void setDisplayBrightness(uint8_t x);
void Adafruit_TFTLCD::begin(uint16_t id) {
...
writeRegister8(ILI9341_DISPLAYON, 0); 
delay(500);
writeRegister8(0x51, 0x80); // Test command 0x51 - background intensity
delay(500);
void Adafruit_TFTLCD::begin(uint16_t id) {
...
writeRegister8(ILI9341_DISPLAYON, 0);
writeRegister8(0xbe, 0x80); delay(500);
writeRegister8(0x51, 0x0); delay(500);

Also if I issue the 0x28 command:

elsewhere in Adafruit_TFTLCD (e.g. in FillScreen, Fill Rect etc, it doesndoesn't work either).

I have bought a 2.5" TFT shield online which is equipped with the ILI9341 controller and I need to dim the intensity of the background LEDs to match ambient light.

This particular shield does not provide a pin to control the intensity of the LEDs with PWM via a separate input so I need to dim the background LEDs of this display via software.

The zip file with the libraries can be downloaded: here

Does one of you know how can issue a command to the TFT display to dim the background LED's?

UPDATE 1:

I wrote a new function to set the displya brightness by controlling the background LEDs, but something is missing as I can seem to be writing correctly to the display. So I'm trying to get the display to answer to a known command first, like 0x28 (Display Off).

// Set display brightness (background LED's)
void Adafruit_TFTLCD::setDisplayBrightness(uint8_t x) {
 // Try with 0x28 (Display Off) to see if display reacts
 writeRegister8(0x28, 0);
return;
}
// New functions
void setDisplayBrightness(uint8_t x);
void Adafruit_TFTLCD::begin(uint16_t id) {
...
writeRegister8(ILI9341_DISPLAYON, 0); 
delay(500);
writeRegister8(0x51, 0x80); // Test command 0x51 - background intensity
delay(500);
void Adafruit_TFTLCD::begin(uint16_t id) {
...
writeRegister8(ILI9341_DISPLAYON, 0);
writeRegister8(0xbe, 0x80); delay(500);
writeRegister8(0x51, 0x0); delay(500);

Also if I issue the 0x28

elsewhere in Adafruit_TFTLCD (e.g. in FillScreen, Fill Rect etc, it doesn work either).

I have bought a 2.5" TFT shield online, which is equipped with the ILI9341 controller. I need to dim the intensity of the background LEDs to match ambient light.

This particular shield does not provide a pin to control the intensity of the LEDs with PWM via a separate input, so I need to dim the background LEDs of this display via software.

The zip file with the libraries can be downloaded here .

Does one of you know how can issue a command to the TFT display to dim the background LEDs?

#UPDATE 1:

I wrote a new function to set the display's brightness by controlling the background LEDs, but something is missing as I can seem to be writing correctly to the display. So I'm trying to get the display to answer to a known command first, like 0x28 (Display Off).

// Set display brightness (background LED's)
void Adafruit_TFTLCD::setDisplayBrightness(uint8_t x) {
 // Try with 0x28 (Display Off) to see if display reacts
 writeRegister8(0x28, 0);
return;
}
// New functions
void setDisplayBrightness(uint8_t x);
void Adafruit_TFTLCD::begin(uint16_t id) {
...
writeRegister8(ILI9341_DISPLAYON, 0); 
delay(500);
writeRegister8(0x51, 0x80); // Test command 0x51 - background intensity
delay(500);
void Adafruit_TFTLCD::begin(uint16_t id) {
...
writeRegister8(ILI9341_DISPLAYON, 0);
writeRegister8(0xbe, 0x80); delay(500);
writeRegister8(0x51, 0x0); delay(500);

Also if I issue the 0x28 command:

elsewhere in Adafruit_TFTLCD (e.g. in FillScreen, Fill Rect etc, it doesn't work either).

Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Added 2nd update with new findings
Source Link
kxtronic
  • 396
  • 2
  • 4
  • 10

Also if I issue the 0x28

writeRegister8(ILI9341_DISPLAYOFF, 0)

elsewhere in Adafruit_TFTLCD (e.g. in FillScreen, Fill Rect etc, it doesn work either).

Any ideas? They would be highly appreciated !

Any ideas? They would be highly appreciated !

Also if I issue the 0x28

writeRegister8(ILI9341_DISPLAYOFF, 0)

elsewhere in Adafruit_TFTLCD (e.g. in FillScreen, Fill Rect etc, it doesn work either).

Any ideas? They would be highly appreciated !

Added 2nd update with new findings
Source Link
kxtronic
  • 396
  • 2
  • 4
  • 10
Loading
Added more details and code after feedbcak from others
Source Link
kxtronic
  • 396
  • 2
  • 4
  • 10
Loading
Loading
Source Link
kxtronic
  • 396
  • 2
  • 4
  • 10
Loading

AltStyle によって変換されたページ (->オリジナル) /