4 years, 7 months ago.

I2C LCD 20x4 Display backlight lost??

This is really strange....Now I have my combined I2C devices running ADXL345 and ITG3200 and displaying the results on my I2C LCD screen the backlight has gone out. If I swap LCD screens over (I have another one running on one mbed reading temperature from a TMP102 device) the backlight returns and the other LCD screen that was working goes out. Is it possible the data being transferred (using all four lines) is causing this....using code to edit out / or partially remove lines makes no difference?

1 Answer

4 years, 7 months ago.

The backlight is controlled by a bit on the i2c portexpander. By default the backlight will be switched off. You need to activate it explicitly by calling the correct method of the lcd library. You had that call included in the code posted in one of your earlier questions on this topic. Your second code example was lacking the call. Make sure you have the correct code included.

lcd.setBacklight(TextLCD::LightOn);

Accepted Answer

Doh!!! Thanks Erik in my euphoria at getting both sensors on the one chip finally working I can see exactly now where I have commented that particular line out. Please can I ask what's the best way to help people avoid the trouble I've had should they a) choose the combined sensor I have and b)choose the program library I did that basically doesn't work communicating to a ADXL345? I've looked closely at both libraries and the one that works on I2C has a significant amount of greater detail in the .h and .c files. Thanks once again for your help.

posted by Derek Calland 08 Mar 2017