Ok, I've implemented this code in my program, but I can't quite get it to work.
After putting probes everyhwere to see what was happening, I discovered that everythign goes fine untill the 5th itteration of the loop. The output of the shift register on the while loop works fine and outputs the sums nicley before resetting to zero. But on the 5th itteration, after going through the tunnel into the event structure, the array wipes out! It only does this on the 5th itteration when it's supposed to average. So you get the array adding up like it's supposed to, ie (for a hypothetical voltage measurment of ~25v) 25 on the first, 50 on the second, 75 on the 3rd, 100 on the 4th, but then on the 5th outside the tunnel to the even structure, it records 125, but inside it has a blank array, which then obviolusly averages to nothing! I'm a little stumped to be honest... Any suggestions appreciated...
EDF.