I have been using the arduino for some time now and the following problem has started. :~
If I use a for, while or do..while loop they do not produce any results the IDE just seems to be ignoring them.
I have created the following to show problem, only 255 and 0 are displayed in the serial monitor window (the led dims and brightens as expexted) :-
int led = 5;
int count = 0;
int increment = 1;
void setup()
{
pinMode(led, OUTPUT);
Serial.begin(9600);
}
void loop()
{
count = count + increment;
if(count >= 255)
{
Serial.println(count);
increment = -1;
}
else
if(count <= 0)
{
Serial.println(count);
increment = 1;
}
analogWrite(led,count);
delay(10);
for(int i = 0; i >=10; i++)
{
Serial.println(i);
}
}