LCD - Print both string/variable AND single character in one command?

Hi,

Is it possible to print a string or variable on an LCD followed by an '?' (or any other symbol for that matter) on the same line in ONE command? If so - how?

For example:

lcd.print(dlyTime) - would print the variable dlyTime. But I want that to be immediately followed by a '?'. (Hex 0X3F, DEC 63).

Example:

lcd.print(myVar)+?

You can print what you want using one lcd.print() command but need to have put the data into a buffer first, then you print the contents of the buffer. Do some research into the sprintf() function and you will see what I mean.

UKHeliBob: You can print what you want using one lcd.print() command but need to have put the data into a buffer first, then you print the contents of the buffer. Do some research into the sprintf() function and you will see what I mean.

Looks promising, but when I try to use sprintf, I get: test.ino:155:11: error: 'class LiquidCrystal' has no member named 'sprintf'

You sprintf into a character string and then print that string. You need an intermediate buffer to hold the formatted message you want to print.

Looks promising, but when I try to use sprintf, I get: test.ino:155:11: error: 'class LiquidCrystal' has no member named 'sprintf'

No one said that sprintf() was a member of the LiquidCrystal class. Learn to use google or some other search engine.

Yes sir.. with google, why do we even need a forum for asking and seeking help with problems? I tend to learn more if I have the chance to communicate and ask questions. Assumed that's why there is a forum here for that purpose, but I guess not. Google here I come (btw, I know about google and I know it has a search bar).

why do we even need a forum for asking and seeking help with problems?

You come here to get help with what to search for and other clues.

Do some research into the sprintf() function

Classes have members. Non-class code blocks are functions. Had UKHeliBob said “use the sprintf() method”, you would have been justified in making the assumption that you did. But, he didn’t.

Ok.. I may have misunderstood the forum then. Thought it was okay to ask questions and maybe someone would be helpful. You were ALOT of help in my last thread. But yes, sprintf is a hint.. and I will research into that. (Thanks UKHeli)

But thing is... I'm still in the process of learning the language here, so when I'm met with "Ask google", it's the same as if to say that to a foreigner in my country, asking how to say "Thank you". He may get the words and how to spell them, but no way will he be able to use them correctly or pronounce them the right way, just because google translate shows him "Tak skal du have".

But anyway.. arguing and discussing irrelevant stuff like this isn't what this forum is for. I know that much. Just hope I didn't break any rules. :) Will look into it.

Thought it was okay to ask questions and maybe someone would be helpful.

It is OK, and someone (UKHeliBob) was helpful. He told you what function to use. Since it is a standard C function, one assumes that you would grab a C programming book and look up that function. Or use google, if that’s more your style.

We see a lot of questions every day. It’s impossible to remember who speaks English natively, and who doesn’t. It’s impossible to remember who’s just beginning and who’s somewhat more advanced.