Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 08:05 08 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 : uM2(+): The impossible takes a bit longer

     Page 2 of 2    
Author Message
isochronic
Guru

Joined: 21/01/2012
Location: Australia
Posts: 689
Posted: 11:46pm 31 Jul 2016
Copy link to clipboard 
Print this post

Impressive lcd work
Just wondering, what compiler version do you recommend for the pic32mx470s ?
I see the latest supports position independent code, but I don't know if it is ok
for the '470 yet
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 09:37am 11 Aug 2016
Copy link to clipboard 
Print this post

Peter
This works beautifully and I've managed to get the position and size of the hands exactly how I want them
I do have one question
Is it possible to make the smaller bottom half of the second hand any smaller than it is?
I've tried but all I succeed in doing is making the top thinner
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 08:58pm 11 Aug 2016
Copy link to clipboard 
Print this post

Question for anyone

secs=Val(Right$(Time$,2))
mins=Val(Mid$(Time$,4,2))
hours=Val(Left$(Time$,2))


Should secs be secs=Val(Right$(Time$,2)
or shouldn't it be secs=Val(Right$(Time$,7,2) ?
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 09:03pm 11 Aug 2016
Copy link to clipboard 
Print this post

With RIGHT$ you count the number of digits you want from the right.
LEFT$ obviously from the left.
MID$ takes a string anywhere out of the string so you need two numbers. The start and how many characters you want.

MID$(Time$,7,2) will give the same result as RIGHT$(Time$,2).
You just choose the one that is easiest to understand. Which in this case is the RIGHT$ as there is no guessing or counting needed to know which characters you want.

Microblocks. Build with logic.
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 09:25pm 11 Aug 2016
Copy link to clipboard 
Print this post

ah that makes sense Jean, thank you so much
I hadn't actually noticed it said "Right$"
 
     Page 2 of 2    
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