IR receiver extend no volts

Thread Starter

sirchuck

Joined Feb 14, 2016
150
His code is not going to work he has a 2 second delay in his code so it will not catch nothing fast
No, the thrown-together code has a problem in that it uses analog instead of digital for speed, but the delay is just to tell me there was a hit for 2 seconds so it doesn't blip by on the serial output. It does not delay unless it sees a hit.
 

Thread Starter

sirchuck

Joined Feb 14, 2016
150
That was the original program. I believe it has been corrected with an interrupt command.
I haven't used an interrupt yet. I need to learn how to do it in the correct way. From what I understand you want to set it so the GPIO triggers an interrupt.

Currently the only change I made was switching from an analog read to a digital read. If you happen to have handy a good reference for some GPIO's triggering an inetrupt I'd be happy to take a look. If not, google-fu will eventually find something on it i'm sure. :D
 

BobTPH

Joined Jun 5, 2013
11,524
Polling 30 inputs is a non starter. For that, an interrupt is the only option.

To the TS: do you understand why polling 30 inputs is not going to work?
 

Thread Starter

sirchuck

Joined Feb 14, 2016
150
I'm not familiar with Arduino code but explain how your code works presently. It seems it must be polling all 30 inputs which takes time.
Currently my code was only testing for 1 input and was failing on my finger test. Which means it would fail miserably on a bullet test.

Switching from analog reads to digital reads fixed it, at least for my finger.

I'm not sure exactly where the threshold is, like just how many microseconds we can get that read time down to yet but it would be GREAT to have those numbers available. Then we could all simply do a little math to figure out if it would catch a bullet and at what speed.
 

Thread Starter

sirchuck

Joined Feb 14, 2016
150
Polling 30 inputs is a non starter. For that, an interrupt is the only option.

To the TS: do you understand why polling 30 inputs is not going to work?
Yea, processor is going to be very busy reading one then another. My next sketch will be to learn how to use GPIO interupts.
 

sghioto

Joined Dec 31, 2017
8,634
hen we could all simply do a little math to figure out if it would catch a bullet and at what speed.
For catching the bullet it's not really necessary knowing exactly which LED receiver was activated. Combining the outputs from all receivers needs only one GPIO input.
 

Thread Starter

sirchuck

Joined Feb 14, 2016
150
For catching the bullet it's not really necessary knowing exactly which LED receiver was activated. Combining the outputs from all receivers needs only one GPIO input.
Yup, I'd still like to be able to figure out the maximum threshold for a GPIO pin to read so I know at what maximum speed of bullet I can catch.

Is the limit 2ms, 2ns, 2ps? They don't make these numbers easy to know.

Specifically interested in this controller:
https://www.amazon.com/dp/B0C8C5RCPV?psc=1&ref=ppx_yo2ov_dt_b_product_details

But that speed detail on any ESP32 would be useful to ballpark.
 
Top