Shop OBEX P1 Docs P2 Docs Learn Events
Time and timemeasures to present on a VGA screen ! — Parallax Forums

Time and timemeasures to present on a VGA screen !

Johan1968Johan1968 Posts: 22
edited 2008-02-08 13:10 in Propeller 1
Is there any one that have a sample of to present time and measuerd time at a VGA Screan on a Propeller ?
Regards Johan ( Novice in Propeller )

Comments

  • RaymanRayman Posts: 14,162
    edited 2008-02-06 20:43
    Do you mean real time from a real-time clock like the DS1307? Or, elapsed time from some event?
  • Johan1968Johan1968 Posts: 22
    edited 2008-02-08 12:19
    Hello !
    i mean processtime. from two Inputs .
    Have you some sample ?
    Regards Johan
  • Johan1968Johan1968 Posts: 22
    edited 2008-02-08 12:20
    Oh sorry !

    i meant elapsed time from some event, from two inputs . for eg. P5, P6


    ·
  • RaymanRayman Posts: 14,162
    edited 2008-02-08 13:10
    Well, I have a complex example that shows charge time that I'll try to wittle down a bit:
    
    
     
    OBJ
      snum :  "simple_Numbers"  'for 0 padded numbers
     
    Var
      long Charging_tinit
      long Charging_tsecs
      
    PUB Start_Charging
      tinit:=cnt  'record counter at start
      tsecs:=0    'init seconds 
      repeat
        CalculateAndShowTime
     
    PRI CalculateAndShowTime
      'update charge seconds
        repeat until (cnt-charging_tinit)<clkfreq
          charging_tsecs++
          charging_tinit+=clkfreq
        ttenths:=10*(cnt-charging_tinit)/clkfreq  
        
      'show seconds
        row:=20
        col:=10
        print_string(string("  Charge Time: "))
        print_string(snum.decf(charging_tsecs,3))
        print(".")
        print_string(snum.decx(ttenths,1))
        print_string(string(" sec"))
    

    This is the core of it...
Sign In or Register to comment.