ahadik:
I need to query sensors while running an algorithm simultaneously. The sensor querying updates an array that is referenced by the algorithm. That is, I need the algorithm to access values in the array and know that they are the most recent values observed. I have a function for querying the sensors attached to an interrupt, which I believe means the sensors will be queried at a consistent time step.
If the individual values take up more than one byte of RAM then you'll need to guard
access to them in your main program using noInterrupts() and interrupts() around the
accesses so you see consistent values.
Also find out about the volatile keyword.