Jump to content



Photo
- - - - -

proper time formating for segment?


  • Please log in to reply
5 replies to this topic

#1 Steve Paradis

Steve Paradis

    Pinball Fan

  • Members
  • PipPipPipPip
  • 555 posts
  • Location:Montreal,Qc Canada

  • Flag: Canada

  • Favorite Pinball: RFM



Posted 22 February 2010 - 12:21 AM

Does anyone has the time to make me a sub that can format time (min:sec) properly?

I actually just use a timer to calculate the time :


Dim incrementTime
incrementTime=120

sub myTimer_expired()
if incrementTime>0
incrementTime=incrementTime-1
TimeDisplay.Text=incrementTime
myTimer.Set true ,1000
end sub

but what I'd like to show is : 01:25 (0 before first digit included)

Thx!


Steve
I like poutine...Not the russian guy but the fries and gravy and cheese curds stuff.

#2 ruckage

ruckage

    Enthusiast

  • VIP
  • 70 posts
  • Location:UK

  • Flag: United Kingdom

  • Favorite Pinball: Tales from the crypt



Posted 22 February 2010 - 01:20 AM

Hi Steve,

Shouldn't be a problem, I can do that for you if you like.


#3 Steve Paradis

Steve Paradis

    Pinball Fan

  • Members
  • PipPipPipPip
  • 555 posts
  • Location:Montreal,Qc Canada

  • Flag: Canada

  • Favorite Pinball: RFM



Posted 22 February 2010 - 01:31 AM

QUOTE (ruckage @ Feb 21 2010, 08:20 PM) <{POST_SNAPBACK}>
Hi Steve,

Shouldn't be a problem, I can do that for you if you like.



smile.gif

send t to me when done




I like poutine...Not the russian guy but the fries and gravy and cheese curds stuff.

#4 Steve Paradis

Steve Paradis

    Pinball Fan

  • Members
  • PipPipPipPip
  • 555 posts
  • Location:Montreal,Qc Canada

  • Flag: Canada

  • Favorite Pinball: RFM



Posted 22 February 2010 - 02:49 AM

got your message ruckage but there is an important part of the time formating who is missing
and that's mostly the part I don't know how to implement. the semiColon ":" that separate minutes from seconds
that's is why It need to be a 5digits segment.

---------------------------------------------------------------------------
Dim incrementTime
Dim timeformat

incrementTime=65


sub myTimer_expired()

if incrementTime>0 then
incrementTime=incrementTime-1

timeformat=""

if incrementTime<600 then timeformat=timeformat&"0" end if
timeformat=timeformat&cstr(int(incrementTime/60))
'timeformat=timeformat&"."
if incrementTime mod 60<10 then timeformat=timeformat&"0" end if
timeformat=timeformat&cstr(incrementTime mod 60)

TimeDisplay.Text=timeformat
myTimer.Set true ,1000
end if

end sub

I like poutine...Not the russian guy but the fries and gravy and cheese curds stuff.

#5 ruckage

ruckage

    Enthusiast

  • VIP
  • 70 posts
  • Location:UK

  • Flag: United Kingdom

  • Favorite Pinball: Tales from the crypt



Posted 22 February 2010 - 11:52 AM

Unfortunately it isn't possible to display a semicolon on a gas segment display. The options are to either use a dmd instead or we can fake it.
First of all we need a 5 segment display and change the line of code that inserts a "." to instead insert a space " "

CODE
Dim incrementTime
Dim timeformat

incrementTime=65


sub myTimer_expired()

if incrementTime>0 then
incrementTime=incrementTime-1

timeformat=""

if incrementTime<600 then timeformat=timeformat&"0" end if
timeformat=timeformat&cstr(int(incrementTime/60))
timeformat=timeformat&" " 'Now inserting a space instead of a "."
if incrementTime mod 60<10 then timeformat=timeformat&"0" end if
timeformat=timeformat&cstr(incrementTime mod 60)

TimeDisplay.Text=timeformat
myTimer.Set true ,1000
end if

end sub


Then you can carefully position a overlay with a semicolon image in the vacant space.

#6 pinballwizard02

pinballwizard02

    Hobbyist

  • Members
  • PipPip
  • 37 posts

  • Flag: ---------

  • Favorite Pinball: Tee'd off

Posted 20 July 2010 - 08:28 AM

I made a demo table that has a hurry up function and display to "count down" until it reaches zero or you get the ball in a kicker. I used only three timers for it. (One for the hurry up, the others for the kicker). Are you using the displays for a hurry up function?

Edited by pinballwizard02, 20 July 2010 - 08:29 AM.