sheamcn
Posts: 3
Joined: Thu Mar 06, 2014 3:17 pm

Timing Circuit

Thu Mar 20, 2014 4:22 pm

I'm trying to run a simple timing circuit, whereby the Raspberry Pi will time how long it takes for a product to go through a sensor and then stop when another sensor is activated.

I'm new to this so any help on the coding would be greatly appreciated. Thanks

User avatar
joan
Posts: 14959
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Timing Circuit

Thu Mar 20, 2014 5:21 pm

The timing will be trivial.

Code: Select all

import time
...
start_time = time.time()
...
end_time = time.time()
...
print("It took {} seconds".format(end_time - start_time))
How will the sensors be connected to the Pi?

Return to “Python”