Jump to content
Sign in to follow this  
Guest ridgell

how to make a stop watch

Recommended Posts

Guest ridgell

(P:ABSOLUTE TIME, seconds) flr 60 % )the above turns absolute time into a number from 1-60 counting down.im monkey see monkey do programer, dont really know what the flr does, know it means floor but what that is ..no clue.i know some has done this, press a button and the stop watch starts, press again stops,resets to 12:00. minute and second hands only.can some one get me started?

Share this post


Link to post
Share on other sites

Hi Here is the code I used for the stop watch in My tiger mothhttp://library.avsim.net/sendfile.php?Loca...=ftp&DLID=62066its a mod of the one thats comes with the wright flyercheersWozza (L:Stop Watch,bool) 1 == if{ (** Init T0 if not already initialized **) (G:Var1) 0 == if{ (P:Local time,seconds) (>G:Var1) } (** Calculate delta time **) (** dT = T1 - T0 **) (P:Local time,seconds) (G:Var1) - (>L:Watch_ElapsedTime,seconds) } els{ (** Reset the clock **) 0 (L:Stop Watch,bool) } (L:Watch_ElapsedTime,seconds) 60 / flr 60 % (L:Watch_ElapsedTime,seconds) flr 60 %(L:Watch_ElapsedTime,minutes) 60 / flr 60 % 0 (>G:Var1) 0 (>L:Watch_ElapsedTime,seconds,seconds) (L:Stop Watch,bool) 0 (>L:Stop Watch,bool) ! (>L:Stop Watch,bool)

Share this post


Link to post
Share on other sites
Guest ridgell

thanks man! this is what i came up with....man it was ugly! but it worked and in positive numbers (G:Var1) (P:ABSOLUTE TIME, seconds) - (>G:Var2) (G:Var2) 30 - 60 / (>G:Var3) (G:Var3) -1 * (>G:Var3)(G:Var2) flr 60 % -1 *(G:Var3) 1 - (P:ABSOLUTE TIME, seconds) (>G:Var1) 0 (>G:Var3)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...