Pages: [1]   Go Down
Author Topic: LiquidCrystal 4x40 library for Arduino 1.0.1  (Read 1623 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello, looking for a 4x40 LiquidCrystal library for Arduino 1.0.1
HD44780 based.
I assume the standard LiquidCrystal library will not handle 4 x 40 displays.
Can you help

Many thanks
Tony
« Last Edit: July 28, 2012, 03:38:12 am by Bemused » Logged

Hannover, Germany
Offline Offline
Jr. Member
**
Karma: 0
Posts: 52
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It will handle - the method begin () is your friend.  smiley

best regards
Andreas
Logged

http://danimathblog.blogspot.com

#define true '/'/'/'
#define false '-'-'-'

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

Andreas thanks
So
lcd.begin(40, 4);

Syntax

LiquidCrystal(rs, enable, d4, d5, d6, d7)
LiquidCrystal(rs, rw, enable, d4, d5, d6, d7)
LiquidCrystal(rs, enable, d0, d1, d2, d3, d4, d5, d6, d7)
LiquidCrystal(rs, rw, enable, d0, d1, d2, d3, d4, d5, d6, d7)

But my display has 2 enable lines
« Last Edit: July 28, 2012, 05:41:24 am by Bemused » Logged

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

Quote
It will handle - the method begin () is your friend.
No it won't.

There is a library written specifically for the 40x4 displays.  Start here: http://code.google.com/p/liquidcrystal440/

Also - there's another method using two instances of the regular library mentioned here: http://arduino.cc/forum/index.php/topic,113807.msg856018.html#msg856018


Don

« Last Edit: July 28, 2012, 09:32:11 am by floresta » Logged

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

Hi Don
The two instances of the regular library looks a little trick for me regarding incorporation into what I already have.
The liquidcrystal440 looks ideal but I am unsure of which download to take.
I assume LiquidCrystal440.zip/enhanced arduino liquidcrystal library /Apr 2010 will not be compatible with IDE1.0.1

Is this (top one on download page) the version I need to take LiquidCrystal1.0.zip/LiquidCrystal for Arduino 1.0/Sep 2011

Many thanks
Tony
Logged

Leeds, UK
Offline Offline
Edison Member
*
Karma: 80
Posts: 1729
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Using the two instances method, if you know what line you want to print on, you can use this method:
Code:
byte line = 2; //This is which line you want, it could come from anywhere
lcd[(line/2].setCursor(0,(line%2));
lcd[(line/2].cursor();
lcd[(line/2)?0:1].noCursor();
lcd[(line/2)].println("Prints to the correct line");

If you chose the other library, the version for 1.0 will almost certainly work fine with 1.0.1
« Last Edit: July 28, 2012, 04:28:19 pm by Tom Carpenter » Logged

~Tom~

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

Well I feel as though I am getting closer   smiley

I renamed the LiquidCrystal library that came with IDE1.0.1

I then copied in the new library from LiquidCrystal1.0.zip/LiquidCrystal for Arduino 1.0/Sep 2011
as 'LiquidCrystal'

I then changed the code
//New line below
//Syntax
//LiquidCrystal lcd(RS,RW,Enable1,Enable2, data3,data2,data1,data0);
LiquidCrystal lcd(13,255,12,7, 11,10,9,8);

// Old line below
//LiquidCrystal lcd(13, 12, 11, 10, 9, smiley-cool;

In the void setup() I put
lcd.begin(40, 4);    // Set up the LCD's number of columns and rows:

On compile I get
no matching function for call to 'LiquidCrystal::LiquidCrystal(int,int,int,int,int,int,int,int)
MyProgName:345: error: no matching function for call to 'LiquidCrystal::LiquidCrystal(int, int, int, int, int, int, int, int)'
C:\arduino-1.0.1\libraries\LiquidCrystalorg/LiquidCrystal.h:56: note: candidates are: LiquidCrystal::LiquidCrystal(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)

I notice the compile error refers to LiquidCrystalorg, I renamed the original library to org

I have tried restarting IDE


Edit
I have now moved the  LiquidCrystalorg out of the Library folder whilst IDE was shutdown and get a good compile.
It seems as though IDE tracked the rename of the original library and did not like the additional parameters I passed in.
Will try the hardware tomorrow
Thanks
« Last Edit: July 28, 2012, 10:42:33 am by Bemused » Logged

Leeds, UK
Offline Offline
Edison Member
*
Karma: 80
Posts: 1729
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you rename a library, or change its file path, or add a new one, you have to restart the IDE to get it to register the changes.
Logged

~Tom~

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

If you use the two instance technique then you will have to deal with two cursors (if you use visible cursors).  I believe that John took care of this in LiquidCrystal440 and in LiquidCrystal1.0.

Don
Logged

Leeds, UK
Offline Offline
Edison Member
*
Karma: 80
Posts: 1729
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Good point. I changed the code snippet I posted to account for the cursor problem.
Logged

~Tom~

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

Working fine

Thanks all
Logged

Pages: [1]   Go Up
Jump to: