LiquidCrystal.begin()

I'm looking at the liquidCrystal library which comes with arduino 0018 and I'm wondering what the cols parameter is used for. I know it's supposed to represent the number of columns on the display, but as far as I can see, it isn't used anywhere in the code..... (but then again, I might be wrong, that's why I ask)

you mean in the code?

It is often used as

lcd.begin(cols, rows);

rather than using

lcd.begin(16, 2);

The definitions of cols and rows are then at the top of the code for easy modification.

I presume that is what you are referring to.

No, I mean, if you look in the library code itself, cols is never used (as far as I can see)

right, not sure what you mean.

You mean it's defined in the library but never used?
Does it matter? :smiley:

I would recommend liquidcrystal440 anyway. Newer and works much better.

Mowcius

You mean it's defined in the library but never used?

It's worse than that. Not only is 'cols' not used, but 'rows' is only checked to see if it is greater than 1, the actual value isn't used.

If they had used the 'cols' value then they could have made the 16x4 displays function correctly, right now they offset the third and fourth rows.

Another unusual characteristic is that the library defaults to a 16x1 display if you don't invoke LiquidCrustal.begin(). Those displays are relatively rare, most 16x1s are actually 8x2 internally and should be invoked as such.

I suppose the values are defined for future expansion such as that done by jrraines in his LiquidCrystal440 library.

Don

I suppose the values are defined for future expansion such as that done by jrraines in his LiquidCrystal440 library.

I would hope that in the next arduino IDE, it is included as standard as the liquidcrystal library has many issues.

Mowcius

Quote:
You mean it's defined in the library but never used?

It's worse than that. Not only is 'cols' not used, but 'rows' is only checked to see if it is greater than 1, the actual value isn't used.

If they had used the 'cols' value then they could have made the 16x4 displays function correctly, right now they offset the third and fourth rows.

Another unusual characteristic is that the library defaults to a 16x1 display if you don't invoke LiquidCrustal.begin(). Those displays are relatively rare, most 16x1s are actually 8x2 internally and should be invoked as such.

thanks, that's indeed what I ment and saw