Page 1 of 1

Timing Circuit

Posted: Thu Mar 20, 2014 4:22 pm
by sheamcn
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

Re: Timing Circuit

Posted: Thu Mar 20, 2014 5:21 pm
by joan
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?