Hello I got 2 of 20x4 lcd and my problem is that I can use only top 2 lines and they work perfect.
I used multiple liabraries and I have set configurations for 20x4 in code.
Lcd is wired in 4bit.
The 2 bottom ones are just blank.
The lcd is BTHQ 42003AV-111
here is datasheet:
http://www.data-modul.com/tl_files/dm/data/specification_BT48024.pdf
here is only difference that I found with others lcd:
Driving scheme: 1/33 Duty, 1/6.7 bias.
If you need more info or something please write.
Im sorry for bad english
here is the code of arduino liquid crystal liabrari:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(20, 4);
// Print a message to the LCD.
lcd.print("hello, world!");
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 3);
// print the number of seconds since reset:
lcd.print(millis() / 1000);
}
and here is some simple lcd:
#include "SimpleLCD.h";
const int backlightPin = 11;
const int RS = 3;
const int RW = 4;
const int E = 5;
const int D4 = 6;
const int D5 = 7;
const int D6 = 8;
const int D7 = 9;
SimpleLCD lcd(RS,RW,E,D4,D5,D6,D7);
int lcdBrightness = 255;
int incomingByte = 0;
void setup() {
Serial.begin(9600);
// set the digital pin as output:
pinMode(backlightPin, OUTPUT);
digitalWrite(backlightPin, HIGH);
lcd.lcdInit();
lcd.lcdWriteText("--> Hello world! <--");
lcd.lcdGoToXY(1,3);
lcd.lcdWriteText("http://morf.lv");
lcd.lcdGoToXY(2,4);
lcd.lcdWriteText("Rastro-Mania");
lcd.lcdGoToXY(3,0);
lcd.lcdWriteText("Coding & Engineering");
}
void loop()
{
if (Serial.available() > 0)
{
// read the incoming byte:
incomingByte = Serial.read();
if(incomingByte == 'h')
{
if(lcdBrightness < 255)
lcdBrightness+=17;
analogWrite(backlightPin,lcdBrightness);
}
else if(incomingByte == 'l')
{
if(lcdBrightness > 0)
lcdBrightness-=17;
analogWrite(backlightPin,lcdBrightness);
}
else if(incomingByte == 'c')
{
lcd.lcdClear();
}
// say what you got:
Serial.print("LCD brightness: ");
Serial.println(lcdBrightness, DEC);
}
}