david_prentice:
Q1 and R2 should switch the backlight.
Have you tried Bill Perry's diagnostic sketch? It should test the backlight.
Okay well, I used the diagnostics text, but all I got out of it was the following information, and that the backlight still won't turn on, and while the test was running nothing happened either.
I can't tell for sure what you have run but it looks like the output of the LCDlibTest sketch that is included in the hd44780 library package.
That is not the diag test for i2c backpacks.
If you haven't already I'd recommend installing the hd44780 library it is available in the IDE library manager, and you can read more about it here: duinoWitchery · GitHub
The i/o class for i2c backpacks is hd44780_I2Cexp
The diag sketch is called I2CexpDiag
Run that and see if the library correctly determines the pin mappings for that backpack.
bperrybap:
I can't tell for sure what you have run but it looks like the output of the LCDlibTest sketch that is included in the hd44780 library package.
That is not the diag test for i2c backpacks.
If you haven't already I'd recommend installing the hd44780 library it is available in the IDE library manager, and you can read more about it here: duinoWitchery · GitHub
The i/o class for i2c backpacks is hd44780_I2Cexp
The diag sketch is called I2CexpDiag
Run that and see if the library correctly determines the pin mappings for that backpack.
--- bill
Well, I feel kind of embarrassed now, but ran the sketch and it did indeed work, the LCD might not be the best quality since one row didn't work until I pressed on the display but it turned on!
********************************************************************
Serial Initialized
--------------------------------------------------------------------
I2CexpDiag - i2c LCD i/o expander backpack diagnostic tool
--------------------------------------------------------------------
hd44780 lib version: 0.8.3
--------------------------------------------------------------------
Reported Arduino Revision: 1.6.13
CPU ARCH: AVR - F_CPU: 16000000
--------------------------------------------------------------------
A4: digital pin: 18
A5: digital pin: 19
SDA: digital pin: 18
SCL: digital pin: 19
--------------------------------------------------------------------
Checking for required external I2C pull-up on SDA - YES
Checking for required external I2C pull-up on SCL - YES
--------------------------------------------------------------------
Scanning i2c bus for devices..
i2c device found at address 0x20
Total I2C devices found: 1
--------------------------------------------------------------------
Scanning i2c bus for all lcd displays
LCD at address: 0x20 | config: M1234567H | R/W control: No
Total LCD devices found: 1
--------------------------------------------------------------------
LCD Display Memory Test
Display: 0
(R/W control not supported)
--------------------------------------------------------------------
Each working display should be displaying its #, address, and config information
If display is blank, but backlight is on, try adjusting contrast pot
If backlight is off, wait for next test
--------------------------------------------------------------------
Blinking backlight test: to verify BL level autodetection
If backlight is mostly off but
you briefly see "BL Off" on display with backlight on,
then the library autodetected incorrect BL level
and the library cannot autoconfigure the device
--------------------------------------------------------------------
Displaying 'uptime' on all displays
--------------------------------------------------------------------
Thank you so much!
Now, how would I go and add this to a file to display my own things on the LCD?
If you could let me know that I would be forever grateful!
That backpack uses the MCP23008 i/o expander chip. Most backpacks use the PCF8574 chip.
hd44780_I2Cexp automatically figures all that out. None of the other i2c LCD backpack libraries will auto configure and work with that chip.
The chip and pin mapping are the same as the adafruit #292 backpack. Adafruit has a library, but it does not auto configure the i2c address and it is much slower than the hd44780 library.
In terms of how to use the hd44780 library, it is no different than using any other lcd library that uses the LCD 1.0 API.
All the API functions available in the hd44780 library package are in the main readme file for the library and can be seen on the main hd44780 github page.
hd44780 is a superset of the LiquidCrystal API so examples that you may see for the LiquidCrystal library will work with hd44780 once the header files and lcd object constructor are changed for hd44780 and the appropriate hd44780 i/o class.
The library includes several working example sketches with examples for each supported i/o class so you can see the needed includes and see the code for working examples.
I'd recommend updating the library to the latest revision and revisiting the github page as there have been some recent updates to the code and also some additional "readme" documentation that cane be easily viewed on the github page that has some additional explanation of the included examples.