I had a look on the forum and couldn't find exactly the answer I'm looking for.
I'm setting up a strobe to image a spinning object (70 Hz or 4200rpm). My motor generates a digital pulse each time it passes a particular location - so at max speed I get 70 rising edges per second.
I'd like to step this down to ~5Hz - this is the speed I need to acquire images and saves on strobe life-time and also hardware. What I'd like to do is detect the rising edge from my motor and output it from another pin on the arduino, and then ignore any subsequent rising edges for 200ms.
I can live with a 1-2 degree rotation lag between the input and the output. At 70 Hz, a 1 degree lag is ~40us. I'm going to work with an Arduino Uno Rev3. My question is - is it feasible to detect the input on a digital input put and then transmit the output within this 40us window? I've only used Arduino for a few very simple tasks so I'm not an expert and have no idea how quickly this can happen. Also a mechanical engineering so wouldn't have a great electronics or programming background either.
Separately, if it is feasible should I try and poll and empty loop but set up a rising edge interrupt to start my timer as the best option? Or run the main loop to poll the input pin and start my timer based on it going from low to high. So something like:
- If input is low wait 20us
- If input is high set output high and wait 10ms
- Set output low
- Wait 190ms
Thank you and kind regards,