Pages: [1]   Go Down
Author Topic: ekitszone lcd-keypad module for uno and LiquidCrystal lib setCursor problem  (Read 1868 times)
0 Members and 1 Guest are viewing this topic.
Australia
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: May 11, 2012, 06:57:03 am by Johnboy888 » Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4260
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Quote
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.

Quote
I know setCursor (0,1) ought to do it, but it doesn't.
So what does it do?

Quote
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
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4260
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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:
Code:
//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);      // put your pin numbers here

Don
« Last Edit: May 11, 2012, 08:40:41 am by floresta » Logged

Australia
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4260
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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).


Quote
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

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4260
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Don

* lcd-keypad-schematic.pdf (11.73 KB - downloaded 13 times.)
Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2648
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: