liquid crystal library is rubbish

I am becoming very disappointed with Arduino as of late. I'm not an idiot, I code C on AVR. I use Arduino for quick and dirty jobs hat will never have more than one made of them. The whole point of using Arduino was the good documentation making it easy to hack something together without writing my own libraries because it's pointless trying to reverse engineer anyone elses undocumented library...

So the liquid crystal library. Firstly I see no clear distinction between write and print but never mind.

States: data: the data to print (char, byte, int, long, or string)

Yet so far no variable type works producing a compile error. I take it that the only acceptable variable type is char and that my int number needs manually breaking down.....

write will send straight the byte value. Print will transform your argument in ASCII

so lcd.write('C'); is indeed the same as lcd.print('C'); or as lcd.print("C"); but lcd.write(67) and lcd.print(67); are very different. The write will output a 'C' because 67 is the ASCII code for 'C' (the associated char) whereas the print will output "67" on the screen, the ASCII representation of the number (the associated text)

That's what the doc states (if you read carefully and go check also what print and write in Stream do a put some good will into it :)) )

print()

Description --> Prints text to the LCD.

write()

Description --> Write a character to the LCD.

It's difficult I know. I detest most (all?) of these third-party libraries as well. Still, without seeing any code and/or error message, then it's just a rant. I happen to use the LiquidCrystal library (one of very few) quite a bit and without any problems, compile or otherwise.

SparkyLabs:
I am becoming very disappointed with Arduino as of late. I'm not an idiot, I code C on AVR. I use Arduino for quick and dirty jobs hat will never have more than one made of them. The whole point of using Arduino was the good documentation making it easy to hack something together without writing my own libraries because it's pointless trying to reverse engineer anyone elses undocumented library...

So the liquid crystal library. Firstly I see no clear distinction between write and print but never mind.

print formats a number intro a string so lcd.print(45) will produce "45"
write simply sends the data so lcd.print(45) will produce the ascii(45) which is '-'

LiquidCrystal - Arduino Reference

States: data: the data to print (char, byte, int, long, or string)

Yet so far no variable type works producing a compile error. I take it that the only acceptable variable type is char and that my int number needs manually breaking down.....

Nope, they all work just fine. Why don't you post your code and people will be able to help you?

Yet so far no variable type works producing a compile error.

Post some examples and the associated error messages

lcd.write( lane1_time100, DEC );

race_end:34:35: error: no matching function for call to 'write(char&, int)'

Yep I got print and write mixed up seems to be working now but I stand by what I said the documentation is poor. Considering this is for kids and artists all i can say is good luck

Most of it's volunteer work. You could make it much better.

SparkyLabs:
lcd.write( lane1_time100, DEC );

race_end:34:35: error: no matching function for call to 'write(char&, int)'

Yep I got print and write mixed up seems to be working now but I stand by what I said the documentation is poor. Considering this is for kids and artists all i can say is good luck

indeed you were calling an investing write() function (this prototype does not exist);

Kids and artist should stick with print :slight_smile:

I'd have to reverse engineer it to understand it remember. Only those that wrote it know how it works. Seem's everyone else know's how it works so why are the examples and explanations not more extensive?

I don't know who writes the instructions but they do make and sell the boards that i buy so it's not like it is free. i paid £35 for a PCB that is massed produced.

SparkyLabs:
I'd have to reverse engineer it to understand it remember. Only those that wrote it know how it works. Seem's everyone else know's how it works so why are the examples and explanations not more extensive?

usually one comes to print and write form the Serial class, so the context is already understood. Again if you don't need to mess around with sending bytes value, stick to print and life will be glorious and beautiful.

(agree that if you read the doc it's not great)

SparkyLabs:
I'd have to reverse engineer it to understand it remember.

Well, it wouldn't require THAT much reverse engineering. If you'd bother to spend two minutes looking at the library's source code, you'd see that the LiquidCrystal class inherits from the Print class -- as does HardwareSerial, SoftwareSerial, etc. So the basic interface should already be familiar to you.

The source code is always the definitive documentation.

(deleted)

I never called you a kid or artist. I was referring to the official blurbs.

I really don't get the "google it". It's a poor excuse for poor documentation.

I think the Print interface is document quite well, even the source code is included.

So the hypothetical child or artist needs to be fluent in "C"? OK fair enough.

SparkyLabs:
So the liquid crystal library. .

In my mind, the squealing of car tyres and tortured brake discs.

Which "liquid crystal library"?

Firstly I see no clear distinction between write and print but never mind.

Well, nevermind.

SparkyLabs:
So the hypothetical child or artist needs to be fluent in "C"? OK fair enough.

No, C++.
But not fluent, just acquainted.
Like you are with English

Hmm. I agree that the LCD.print/write documentation is painfully brief. It should look more like the Serial documentation, or at least refer to that, for a better description of what formatting is supported.
(I think it assumes that people will already be familiar with Serial.xxx() usage, which it "inherits" in the best C++ traditions.

SparkyLabs:
So the hypothetical child or artist needs to be fluent in "C"? OK fair enough.

Usually being not an idiot is sufficient.

ooh, ooh, OK. If you say so..... I'm obviously an idiot that should stick to writing his own libraries...