I'm trying to make a function which takes an initialized array of some size, and within a while loop, creates an array such that
array[i] = total time elapsed,
where i is the current loop iteration. According to numeric indicators, the behaviour of elapsed time and iterations is correct, but nothing is ever inserted into the array. All elements are still 0. What might be wrong? I've attached my code below.
Solved! Go to Solution.
It's getting inserted into the array. The problem is that on the next iteration of the loop, you act on the original initialized array and the actions from your previous loop iteration were discarded. Only the last iteration of the while loop outputs the last value you inserted.
You need shift registers on those array tunnels so the results of the first loop iteration are "shifted" to the beginning of the loop and available for the next loop iteration.