Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 21:09 01 Jul 2025 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 : More info on Text line

Author Message
mikedownunder

Newbie

Joined: 03/03/2016
Location: Australia
Posts: 26
Posted: 05:13am 14 Mar 2016
Copy link to clipboard 
Print this post

Hi Guys

Back again.
Doing quite well with my little program, but have another enquiry.

I want a countdown clock and as such I have 3 variables. Hrs, Mins, Secs and I want to display the following on the ILI9341 display.

"Hrs", Hrs, "Mins", Mins, "Secs", Secs. Counting down to zero.

How do I go about this as the text command looks like it only wants to display a string?

Thanks for the great help.

Mike
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10180
Posted: 05:24am 14 Mar 2016
Copy link to clipboard 
Print this post

The "STR$" function is your friend

text 0,0,str$(hrs,2,0,"0")+":"+str$(Mins,2,0,"0")+":"+str$(Secs,2,0,"0")

will output HH:MM:SS with leading zeroes for each value if less than 10
 
mikedownunder

Newbie

Joined: 03/03/2016
Location: Australia
Posts: 26
Posted: 01:50pm 14 Mar 2016
Copy link to clipboard 
Print this post

Thanks Matherp

It's been a long time since I saw that particular command, back in the days of the commodore 64 etc.
Anyhow thanks again to everybody for the great help.

Mike
 
Print this page


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

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025