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[x], 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[x], 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
)
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.