Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 22:50 09 May 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 : Help with MMBasic

Author Message
Talbit
Senior Member

Joined: 07/06/2011
Location: Australia
Posts: 210
Posted: 03:11am 22 Jun 2011
Copy link to clipboard 
Print this post

Geoff designed a simple 2 x 16 lcd display and runs it with a bit of code lcd.bas. In line 20 he has LCD_Line1$ = " HELLO WORLD " and line 30 is similar.
It displays it on the lcd nicely.
I'm designing a clock (don't ask) and I have hh$ equal to hours, mm$ equal to minutes and ss$ equal to seconds. I don't want to change Geoff's LCD code.
How can I plug my hh$ mm$ ss$ into line 20 so that it will eventually display
hh:mm:ss in the first line.
Thanks for your help
Talbit
Talbit
 
captainbill

Newbie

Joined: 16/06/2011
Location: United States
Posts: 37
Posted: 03:27am 22 Jun 2011
Copy link to clipboard 
Print this post

Howdy

Try this.

LCD_Line1$=hh$+":"+mm$+":"+ss$

You can add strings together.

Hope this helps.

Bill
Old school. Still interested. Head in the clouds.
 
Talbit
Senior Member

Joined: 07/06/2011
Location: Australia
Posts: 210
Posted: 04:19am 22 Jun 2011
Copy link to clipboard 
Print this post

Thanks Captainbill!
That worked beautifully! I wasn't aware of adding the +
Now I'm going to really push the friendship. When I reach single digits I need to add leading zeros on the display. Can this be implimented in this setup?
I can send all of my code if you want it.
Talbit
Talbit
 
captainbill

Newbie

Joined: 16/06/2011
Location: United States
Posts: 37
Posted: 05:23am 22 Jun 2011
Copy link to clipboard 
Print this post

Howdy

Try this.

if len(hh$)=1 then hh$="0"+hh$

Bill
Old school. Still interested. Head in the clouds.
 
Talbit
Senior Member

Joined: 07/06/2011
Location: Australia
Posts: 210
Posted: 05:51am 22 Jun 2011
Copy link to clipboard 
Print this post

Spot on. It works!
Thanks for your help.
I just need Geoff to impliment his serial in so that I can use a gps NMEA string and the PPS to run my super accurate clock.
Talbit
Talbit
 
Print this page


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

© JAQ Software 2024