First of all, thanks for your patience since this may be a really noobish question.
I have a couple of arrays with a maximum of 5 values between the two of them. FWIW These values actually relate to digital pins 9 - 13. The array values are selected by user input and can be reset during operation.
As it stands now I fill these two arrays with zeroes whenever the values are to be redefined since more or less positions may be filled the next time around. Elsewhere in the sketch these arrays are used to indicate which pins should be set HIGH or LOW based on other “user-set” timing variables.
Right now, I just count through all the array positions with a for-loop no matter how many “real” (non-zero) values are in there. Essentially the sketch will set pin 0 HIGH (or LOW) when the count reaches positions in the array beyond the values the user intends.
Is there any “real” action taken when the chip is told to set pin zero HIGH or LOW? Should I append a special value to indicate the array is over? Should I check that the value extracted from the array is > zero? Is there some other accepted method of counting through an array of unknown length?
I just don’t have the experience to know if this extra effort is even necessary.
Right now I am declaring these arrays as int syncdArray and int oppArray.
Am I correct in thinking that I could instead use byte instead of int when declaring the arrays since all the values are positive and between 0-255?
Thanks so much for your help and input.
PS If I call function loop(); to get out of an option selection menu, is that okay? It seems to work.