Arduino Uno digital pins 4 to 7 problem

Hi All,

I just got myself an arduino kit to try my hand at electronics. I have no experience with arduino or electronics in general except for my electronics course in college. Anyway, I was trying out this innocent looking array program and notices that the LEDs connected to pins 4 to 7 were not lighting up…

// Project 5 - LED Chase Effect
byte ledPin = {4, 5, 6, 7, 8, 9, 10, 11, 12, 13}; // Create array for LED pins
int ledDelay(65); // delay between changes
int direction = 1;
int currentLED = 0;
unsigned long changeTime;
void setup() {
for (int x=0; x<10; x++) { // set all pins to output
pinMode(ledPin, OUTPUT); }
changeTime = millis();
}

void loop() {
if ((millis() - changeTime) > ledDelay) { // if it has been ledDelay ms since
last change
changeLED();
changeTime = millis();
}

}
void changeLED() {
for (int x=0; x<10; x++) { // turn off all LED’s
digitalWrite(ledPin, LOW);
}
digitalWrite(ledPin[currentLED], HIGH); // turn on the current LED
currentLED += direction; // increment by the direction value
// change direction if we reach the end
if (currentLED == 9) {direction = -1;}
if (currentLED == 0) {direction = 1;}
}

So then I decided to check the pins individually by running a slightly modified ‘blink’ program (the only other program I know :frowning: )

int led = 7;
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.

pinMode(led, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

…replacing the variable ‘led’ every time to check the pins and the LEDs connected to them did not light up. I also noticed the little LED on the board itself marked ‘L’ didn’t light up either like it does when I channel the program through to pins 8 and up.

The board is not an arduino uno clone by kuman. Is it faulty? should I ask the seller to send me a new one? Or am I doing something wrong here? Please let me know.

shadocon89: I also noticed the little LED on the board itself marked 'L' didn't light up either like it does when I channel the program through to pins 8 and up.

The above makes me believe the LED chase code is working properly since the on-board LED (pin 13) turns on and off; it appears to be more a wiring/LED polarity issue OR the size of the current limiting resistor is too high.

Edit: Correction - I just caught the sentence "LEDs connected to pins 4 to 7 were not lighting up.."

Do you a VOM to check the pin output w/o connections to the LEDs? The assumption is tht each output has its own current limiting resistor.

Yellow text. How unique. Not.