.
And the question is?
I need help programming two photo gate on same spot but different height. so lets say the first photo gate is 10cm off ground and the second one is at 20cm. if i pass a 15cm object though the gates, only the first photo gate should be "LOW". i also need to track how many object passed the gate, and what object turned off the first photogate or both photogate
Schematic?
ive attached it in this post
Theguy:
I need help programming two photo gate on same spot but different height. so lets say the first photo gate is 10cm off ground and the second one is at 20cm. if i pass a 15cm object though the gates, only the first photo gate should be "LOW". i also need to track how many object passed the gate, and what object turned off the first photogate or both photogate
What have you tried so far? Please post your code. And when you were asked for a schematic, he meant a diagram showing the wiring of the photogates and any resistors or capacitors, and what Arduino pins they are connected to.
If you are completely lost, here's a way to get started.
- In your Arduino folder, there should be an examples directory.
- Load up some examples. Run them, Look at the code, and try to understand what the code is doing.
- One of the examples you try should be Digital->Button.
This sketch will show you how a digital input works. If your photogates are digital, this sketch can be built on to make your own program. If the photogate is analog, well, you can try the example for Analog->AnalogInput. Again, run it, read it, try to understand it.
Once you have done this, hook up ONE (and only one) photogate and try to read it. Shine light on it, shade it, etc, to see how it changes. Get everything working with one photogate, then you can move on to two.