I am having a bit of trouble with the setup presented here.
I made it to work and I got accurate readings but I can't measure fast speeds. If I power the photocell to 5v I get nothing. If I power it to 3.3v it works.
The thing is that when I power everything up and the photocell is covered or in low light conditions I get a lot of values around 10000 microseconds. They are so many that I can't read the test I've done. If I light it up, the values stop until I turn off the light and than display the desired value among the other 10000 microseconds values.
To partially solve this I've made a small change to the code. Instead of the
if(duration != 0 )
if(duration > 10000 )
This blocks everything under 10000 microseconds(that's 1/100 for shutter speeds) and I can use the tester for slow speeds with good results but obviously this is useless for faster speeds because it blocks them too. I can't test anything faster than 1/90 on my shutter.
This is my first arduino project, btw.
Help would be appreciated.