im watching these videos produced by a supposed high school instructor he is introducing while loops
he had a code that flashed a red led 5 times and then a yellow led 5 times using two for loops so he said lets modify this code to use while loops and does one as an example.
Code:
void loop
{
int j = 1
while ( j <= numblinks )// numblinks is a global variable
{
//do stuff
}
for (int j =1: j <= numblinks; j = j+1)
{
//do stuff
}
}
this code is then compiled and uploaded to the arduino and runs
2 questions arise
1)can you not use j++ or even j += 1 on the arduino
2)even more importantly does the arduino not care that j is declared twice
coop