I have two while loops side by side both with shift registers is that a problem?? I'm trying to take an average reading of 10 samples over time from the first while loop, use that value to add into an array in the second while loop which is also using shift registers to store all of the previous average readings? Every time I trigger it to take another average reading and add to its array it seems to be lagging behind e.g.. "click button" values 1 array says 0, "Click button" value 2, array says 1 and so on. Any advice would be welcome.