Hello everyone. This is my first time posting and I have a problem that I hope that you can help me out with. I am a teacher who is trying to use the Arduino for the first time with my students. We are trying to do a pre-made experiment with the following code. There are 8 lights that are suppose to blink on and off in sequence but when we compile there is an error.
The error is
'lt' was not declared n this scope
exit status 1
'lt' was not declared in this scope.
Here is the code that we are using.
The third last line of code is where this error happens. }
for(int thisPin = lowestPin;thisPin <= highestPin;thisPin++)
Any help with this would be greatly appreciated. Thank you to all who will help us out.
//
const int lowestPin = 2;//the lowest one attach to
const int highestPin = 9;//the highest one attach to
//
void setup()
{
//set pins 1 through 6 as output
for(int thisPin = lowestPin;thisPin <= highestPin;thisPin++)
{
pinMode(thisPin,OUTPUT); //initialize thisPin as an output
}
}
/****************************************/
void loop()
{
//iterate over the pins
//turn the led on from lowest to the highest
for(int thisPin = lowestPin;thisPin <= highestPin;thisPin++)
{
digitalWrite(thisPin,HIGH);//turn this led on
delay(100);//wait for 100 microseconds
}
//fade from the highest to the lowest
for(int thisPin = highestPin;thisPin>=lowestPin;thisPin--)
{
digitalWrite(thisPin,LOW);//turn this led off
delay(100);//wait for 100 microseconds
}
for(int thisPin = highestPin;thisPin>=lowestPin;thisPin--)
{
digitalWrite(thisPin,HIGH);//turn this led off
delay(100);//wait for 100 microseconds
}
for(int thisPin = lowestPin;thisPin <= highestPin;thisPin++)
{
digitalWrite(thisPin,LOW);//turn this led on
delay(100);//wait for 100 microseconds
}
}