Go Down

Topic: Contrast problem on i2c? (Read 710 times) previous topic - next topic

tudorcraft

I want to print something using the A1602 display with I2C shield, but when I print something, everything is white(see attachment).
Here is the code, by the way:

#include <Wire.h> 
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set the LCD I2C address, if it's not working try 0x27.

void setup(){
  lcd.begin(16,2);   // iInit the LCD for 16 chars 2 lines
  lcd.backlight();   // Turn on the backligt (try lcd.noBaklight() to turn it off)
  lcd.setCursor(0,0); //First line
  lcd.print("I2C LCD Tutorial");
  lcd.setCursor(0,1); //Second line
  lcd.print("*Ardumotive.com*");
}

void loop(){
}

spycatcher2k

Adjust the variable resistor you have on the contrast pin.
Mrs Drew
-=-
http://www.uk-pcb.co.uk - UK PCB Fab Company
I will design & code for you, but I will also charge you (PM me)
If you don't like my answers, realize : I'm not being cheeky, I'm Just trying to prompt you to use your own brain/google etc.

tudorcraft

Already tried that, it doesn't work. It just changes the brightness.

spycatcher2k

Then check your wiring! or better still, post your wiring diagram here.
Mrs Drew
-=-
http://www.uk-pcb.co.uk - UK PCB Fab Company
I will design & code for you, but I will also charge you (PM me)
If you don't like my answers, realize : I'm not being cheeky, I'm Just trying to prompt you to use your own brain/google etc.

wolframore

Are you using a 1602 with the backpack?  The blue potentionmeter on the backpack adjusts the contrast.  Have you tried that?  Please include pictures and wiring diagram.
Bad Boys Rate Our Young Girls But Violet Goes willingly - Get Some Now :) - ELI the ICE man

TheMonkey

#5
Mar 19, 2019, 06:21 pm Last Edit: Mar 19, 2019, 06:22 pm by TheMonkey
Your code says 0X27 and notes say to try 0x27 if not, so you seem to be aware of two addresses, but have you tried 0x3F?

Or maybe you got it working, it's a few weeks old. If you got it working, what was fix?

Go Up