0

I tried to interface an LCD screen with my Arduino but I have a problem - Nothing is being displayed on my LCD screen:

LCD Screen

Here is the code:

#include<LiquidCrystal.h>

LiquidCrystal lcd(7, 8, 9, 10, 11, 12);  // sets the interfacing pins

void setup()
{
 lcd.begin(16, 2);  // initializes the 16x2 LCD
}

void loop()
{
  lcd.setCursor(0,0);           //sets the cursor at row 0 column 0
  lcd.print("16x2 LCD MODULE"); // prints 16x2 LCD MODULE
  lcd.setCursor(2,1);           //sets the cursor at row 1 column 2
  lcd.print("HELLO WORLD");     // prints HELLO WORLD
}
  • 1
    Probably your background is not set correctly (there is a way to change the contrast). – Michel Keijzers Apr 3 '18 at 13:53
  • Contrast looks good in the photo -- one row of all-on blocks indicates an uninitialized display. – jose can u c Apr 3 '18 at 13:55
  • Your photo doesn't clearly show where the wires are going. Can you create a schematic showing the wiring setup, or at least a better photo that clearly shows where each wire from the LCD goes to the Arduino? – jose can u c Apr 3 '18 at 14:17
  • @josecanuc the uninitialized screens can be seen even if the contrast is set wrong; – esoterik Jul 3 '18 at 0:08
1

In the setup() you have to state what pin the Vo (display contrast pin) on the LCD is connected to. Before the

lcd.begin(16,2)

try

analogWrite(pin Vo is connected to, contrast you want to set the screen to);

An example would be:

analogWrite(6,80);
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.