Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 23:49 25 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : LCD drivers

Author Message
centrex

Guru

Joined: 13/11/2011
Location: Australia
Posts: 320
Posted: 01:11am 12 May 2012
Copy link to clipboard 
Print this post

Has anyone used the LCD drivers for the maximite, the ones in the basic library on Geoff Grahams site.
Both sets of lcd software work but how does one add information to a line to be displayed.
Printing a text string to the LCD works fine but how do I add a variable ie..
"The temperature is.." variable.
Do I have to convert everything to asc and then send the lot as one string.
Any suggestions welcome.
regards
cliff
Cliff
 
djuqa

Guru

Joined: 23/11/2011
Location: Australia
Posts: 447
Posted: 01:17am 12 May 2012
Copy link to clipboard 
Print this post

Correct syntax is to use the Str$ function (page 28 of the Manual) to convert the numeric value of the variable into a string representation and concatenate (join) to the end of text message.

"the temperature is .."+STR$(Variable)

an example using the LCD routine is
PrintLCD 1,"Current Ambient temp is "+STR$(Ambient_temp)Edited by djuqa 2012-05-13
VK4MU MicroController Units

 
centrex

Guru

Joined: 13/11/2011
Location: Australia
Posts: 320
Posted: 01:28am 12 May 2012
Copy link to clipboard 
Print this post

Thanks djuqa
That works fine, I new if I asked I would be put on the right track.
regards
cliff
Cliff
 
djuqa

Guru

Joined: 23/11/2011
Location: Australia
Posts: 447
Posted: 01:31am 12 May 2012
Copy link to clipboard 
Print this post

No problems.
All part of the service.
David
(David J Underhill, Qld. Aust.)
VK4MU MicroController Units

 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 03:36pm 12 May 2012
Copy link to clipboard 
Print this post

Another option to display it would be:


PrintLCD 1,"Current Ambient temp is " + format$(Ambient_temp, "%+7.2f")

This will give a + or - symbol and the temperature with 2 digit precision
and alignment all in one. :)

The alignment and width is important if it has to be aligned with other values on the display. Adding a ; to the end of that line will allow you to display more info on the same line with the next PrintLCD command, like it is now the cursor will go to the start of the next line

* I am not sure if PrintLCD works exactly the same as Print with the ; at the end.
Maybe you can test that and report back.



Edited by TZAdvantage 2012-05-14
Microblocks. Build with logic.
 
centrex

Guru

Joined: 13/11/2011
Location: Australia
Posts: 320
Posted: 01:28pm 18 May 2012
Copy link to clipboard 
Print this post

Here is a picture of a 4X20 lcd using the subroutines from the Maximite site, the 22 to the right on the screen is where I was putting the temperature from the information in the previous posts.



Once the lcd is initialised the print routine can be called from anywhere within the program.
very happy.
regards
cliff

Cliff
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024