ekitszone lcd-keypad module for uno and LiquidCrystal lib setCursor problem

Hi All, my first posting !!

I have one of the above mentioned modules, that I have been using with arduino-0022 and the LCD4bit_mod library that goes with it. I just migrated to arduino 1.0 and had to migrate to the LiquidCrystal library instead due to the use of the delay() function the LCD4bit_mod lib uses without the inclusion of #include <arduino.h> as now required in 1.0. Once I figured out the pin mapping for the constructor it mostly worked. However, the setCursor function doesn't seem to allow me to move the cursor to the second line of the ekitszone module display. I Can move the cursor anywhere on the first line, just can't figure out how to get it to the second line. I know setCursor (0,1) ought to do it, but it doesn't.

Has anyone else come across this problem ? and overcome it ??

The only alternative I have is to go back to using the LCD4bit_mod library after I modify it to include the #include <arduino.h> so it will compile with the delay() call.

Thanks
John

First of all - go take a look at this http://arduino.cc/forum/index.php/topic,102266.0.html, particularly items #1 and #4.

However, the setCursor function doesn't seem to allow me to move the cursor to the second line of the ekitszone module display. I Can move the cursor anywhere on the first line, just can't figure out how to get it to the second line.

You didn't post your source code, but my crystal ball tells me that you didn't include the lcd.begin() statement.

I know setCursor (0,1) ought to do it, but it doesn't.

So what does it do?

The only alternative I have is to go back to using the LCD4bit_mod library

There is no reason use any variation of the LCD4bit library. The original library was written by someone with only a vague understanding of the LCD controller - if you don't believe me just look at comments in the source code - and all that the modified version does is remap the pins.

Don

Once I figured out the pin mapping for the constructor it mostly worked.

How could you have missed the explanation? It's right there in plain sight.

Start here: http://arduino.cc/en/Tutorial/LiquidCrystal
Scroll down to the bottom
Use the Liquid Crystal Library link to get here: http://arduino.cc/en/Reference/LiquidCrystal
Use the LiquidCrystal() link to get here: http://arduino.cc/en/Reference/LiquidCrystalConstructor
And there it is under 'Syntax'

Of course you might not need the complete explanation if the comments in the example were more complete:

//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);      // put your pin numbers here

Don

Don, In understand the syntax of the constructor, the problem I had was that I did not know what pins were used for RS, R/W, Enable etc pins, as the ekitszone schematic http://www.ekitszone.com/download/lcd-keypad-schematic.pdf does not indicate which arduino pins are used, but I figured it by browsing the source of the LCD4bit_mod library.

In the end, what I was missing was simply the begin() call, as the LCD4bit_mod library has no equivalent.

Thanks
John

I did not know what pins were used for RS, R/W, Enable etc pins, as the ekitszone schematic http://www.ekitszone.com/download/lcd-keypad-schematic.pdf does not indicate which arduino pins are used ...

Yes it does. The LCD is shown at the right side of the diagram in your link. It shows pin 4 connected to PB0, pin 6 connected to PB1, etc.

Your method, checking the source code, is valid as well (as you have already found out).

In the end, what I was missing was simply the begin() call....

It's good to know that my crystal ball is still functioning.

Don

Johnboy888:
the ekitszone schematic http://www.ekitszone.com/download/lcd-keypad-schematic.pdf does not indicate which arduino pins are used, but I figured it by browsing the source of the LCD4bit_mod library.

Does anyone have a copy of this schematic, it appears the site no longer exists?

Cheers
Jon

My copy was still on my computer. It's not much of a 'schematic' though.

Don

lcd-keypad-schematic.pdf (11.7 KB)

Wow,
They didn't even bother to label the HD44780 pins.
Not that it's hard to figure it out, but still.....

Just dug this out of a drawer, and worked out the following to make it work with an old Arduino NG.

const int rs = 8, en = 9, d4 = 4, d5 = 5, d6 = 6, d7 = 7;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);