I want to use a loop(n) function so it loops something n number of times.
My program has two main subs. One sub is triggered by a timer1, another one is a big loop.
Inside this loop I want something to happen n number of times, depending on what value n gets.
For some reason I get syntax errors when I put loop() inside main void loop() function.
Can I nest loops?
Do loops only accept char as a value?
Do I cast variables but placing (int)charvar1 or (float)intvar1?
Do I have to use a special algorithm of rounding to convert int to char?
Looks like loop() is a "special" function that I must work around.
I wish Arduino developers would make a change in future versions of the Arduino compiler and differentiate loop() and loop(n) with a variable in the parentheses.
I wish Arduino developers would make a change in future versions of the Arduino compiler and differentiate loop() and loop(n) with a variable in the parentheses.
Ain't going to happen. There is nothing magic about the name. Use something that means something in your application.
loop() does not perform any magical function of looping. It just happens to be a function that is called over and over again inside a looping program structure elsewhere. The actual keywords that CAUSE looping are "while", "do ... while", and "for"