See my working code below:
I would like to know how to make a sketch for loop that assigns a variable for the 0-255 and starting over again when finished (loop). So i assume there needs to be a variable assigned and some command to increment it through each loopthrough? Please advise...be kind, I am totally new to Arduino and coding. Thanks,
Jeff
int ledPin = 13; // LED connected to digital pin 13
void setup()
{
pinMode(ledPin, OUTPUT); // sets the pin as output
}
void loop()
{
analogWrite(ledPin,5); // analogRead values go from 0 to 1023, analogWrite values from 0 to 255
delay(1000);
analogWrite(ledPin,255); // analogRead values go from 0 to 1023, analogWrite values from 0 to 255
delay(1000);
}