I'm using a busy loop to check when a condition is true and take a picture, but I need to have less than 10millisecond delay when the condition is true, and when my loop detects it. Is this loop viable?
This is running on a slow raspberry pi zero.
for (;;) {
for (pin = 0; pin < 8; ++pin) {
// Some other thread changed counter, gets detected here
if (globalCounter[pin] != myCounter[pin]) {
//Take picture
}
}
}
full code I'm looking to adopt: https://github.com/WiringPi/WiringPi/blob/master/examples/isr.c