i have to use 8, 9, 4, 5, 6, 7 gpio for different purpose, so i have use different pins for LCD.
i tried to use 30, 31, 32, 33, 34, 35, but its not working. Is there pin multiplexing need to added?
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
//LiquidCrystal lcd(8, 9, 4, 5, 6, 7); // it works fine
LiquidCrystal lcd(30, 31, 32, 33, 34, 35); // its not working
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.setCursor(0,0);
lcd.print("hello");
}
void loop() {
}
I connected a 1602 display to my Mega using the wiring in the posted code and ran the code. It prints "hello" on the display. So it is not a software problem.
Do you have LCD pin 5 (RW) tied to ground.
Do you have a pot on the contrast pin and have you tried to adjust the contrast? A 1K resistor from LCD pin 3 (Vo) to ground will usually result in good contrast in lieu of a pot.
Does the display show anything (ie. boxes on the top row)?
Is the backlight connected and turned on?
If you still have trouble, take some clear pictures of your wiring and post the photos. We often spot problems that way. How to post photos:
How to post an image.
Another page on posting images.
Here is a thread dedicated to fixing LCD problems.
Hi ,
Thanks for the hint. i had some wiring problem. it works fine.
thanks,
Aravind