So I want to create a code so that Arduino remembers how many times it has gone through that part of the code and accordingly take a reading from an analog pin and store it as "gone i""(i. = No of times Arduino has gone through that part )"Eg if the code is run for first time let's say we introduce a variable i and thus now i=1 and "gone1" should contain the value And if i=2 then "gone2" should contain the value
int gone[40]; // an array of 40 gone varaibles. each int to hold the output of an analogRead()
void someFunction(){ static byte index = 0; gone[index] = analogRead(A0); index ++;}