I'm trying to do a basic LED loop flashing the LEDs on back and forth, my code is
int LED = 2; //Set the initial LED pin to 2
int LEDDirection = 1; //Set the direction LEDs flash in
void setup() {
pinMode(LED, OUTPUT);
}
void loop() {
LED = LED + LEDDirection;
digitalWrite(LED, HIGH);
if (LED == 2 || LED == 13) { LEDDirection = -LEDDirection; }
delay(100);
}
Yea, my commenting kind of died off early
And my circuit is pins 2-13 have jumpers coming from them into the bread board, current limiting resistors jump to the LEDs (two values, 100 and 330) then all 12 LEDs go to the negative rail, and I have a single jumper jumping to the GND pin
(offtopic: Does anyone know of a decent open source/free circuit drawing program? (Google's after hitting post))
The problem, only the first (13) LED lights up (though the first in the sequence is supposed to be 2), 13 blinks rather randomly, sometimes it'll be on for two or three seconds, sometimes it blinks on and off in half a second...
All of the other LEDs are dimly lit, and some of them flash randomly as well...
*shrug* if you need further clarification of anything, just ask