Hi all
I am very new to the arduino coding and am looking for some help please.
I am currently building a model ship where I am after 3 leds at the front of the ship, 3 leds at the rear of the ship and a couple of leds in the central upper area. I can sort of get the lights built and running constantly on but the issues start in that I want a flashing white led at the top of the ship which will act like a sort of morse code signalling light. I have managed to get the lights to light 1-5 and actually have led flashing, but led 7 now wont come on and leds 8-10 come on after a few seconds. i have been nit picking online code and am using the following:
int ledPins[] = {1,2,3,4,5,6,7,8,9,10,11,12};
int delayTime = 0; void setup() { for(int i = 0; i < 13; i++) pinMode(ledPins*,OUTPUT);*
}
void loop() { digitalWrite(ledPins[0], HIGH);
delay(delayTime);
digitalWrite(ledPins[1], HIGH);
delay(delayTime);
digitalWrite(ledPins[2], HIGH);
delay(delayTime);
digitalWrite(ledPins[3], HIGH);
delay(delayTime);
digitalWrite(ledPins[4], HIGH);
delay(delayTime);
digitalWrite(ledPins[5], HIGH);
delay(delayTime);
int ledPin = 6;
- {*
- pinMode(ledPin, OUTPUT);*
} - digitalWrite(ledPin, HIGH);*
- delay(300);*
- digitalWrite(ledPin, LOW);*
- delay(300);*
- digitalWrite(ledPin, HIGH);*
- delay(300);*
- digitalWrite(ledPin, LOW);*
- delay(300);*
- digitalWrite(ledPin, HIGH);*
- delay(1100);*
- digitalWrite(ledPin, LOW);*
- delay(1100);*
- digitalWrite(ledPin, HIGH);*
- delay(1100);*
- digitalWrite(ledPin, LOW);*
- delay(1100);*
- digitalWrite(ledPin, HIGH);*
- delay(300);*
- digitalWrite(ledPin, LOW);*
- delay(300);*
digitalWrite(ledPins[7], HIGH);
delay(delayTime);
digitalWrite(ledPins[8], HIGH);
delay(delayTime);
digitalWrite(ledPins[9], HIGH);
delay(delayTime);
digitalWrite(ledPins[10], HIGH);
delay(delayTime);
digitalWrite(ledPins[11], HIGH);
delay(delayTime);
digitalWrite(ledPins[12], HIGH);
delay(delayTime);
}
Would anyone be kind enough to have a look at this code and maybe give me some ideas on a better way forwards, I would be eternally grateful. Kind regards.
Terry