Ski Ramp

Measure how long it takes a ball to role down a ramp.
Setup the ramp so that the first gate goes to B1 and the second to B2.

Program


---

Ski Ramp Program

Measure how long it takes a ball to role down a ramp.

Setup the ramp so that the first gate goes to B1 and the second to B2

---


prog_vars =

d/count 0

d/start_time 0.0

d/stop_time 0.0

d/interval 0.0

d/results[10] 0.0

d/run_no 0

prog_vars.


prog_start =

pclear

print "Ski Program Start"

-- Setup the gates

get b1

get b2

btp a1 calc_time

btp a2 display_results

prog_start.


prog_loop =

-- main program loop

inc /count

any /count >= 10000 -> exitprog


prog_loop.

calc_time =


inc /run_no

sub /s_atb2 /s_atb1 -> /interval

print "Ball run /run_no interval /interval"

-- Store the result

/results[/run_no] /interval

calc_time.


display_results =


print "Ski Results"

/run_no 1

repeat 10 ->

print "run /run_no time /results[/run_no]"

inc /run_no

repeat.



display_results.



prog_stop =

print "Bye"

prog_stop.