WoW, Thank you all for the support and input.
the first sketch (I know that it is a mess, will clean up soon) is 10 x led in a heart formation, pin 2 - 11.
I did the heart to involve my 7 year young daughter.
int timer = 100; // The higher the number, the slower the timing.
int ledPins[] = {
2, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11,
2, 11, 3, 10, 4, 9, 5, 8, 6, 7,
2, 4, 6, 8, 10, 11, 9, 7, 5, 3,
2, 7, 11, 7, 3, 7, 10, 7, 4, 7,
9,
7, 5, 7, 8, 7, 6, 7, 2, 7, 3,
8, 4, 9, 5, 10, 6, 11, 7, 2, 8,
3, 9, 4, 10, 5, 11, 6, 2, 7, 2,
2,
2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
7,
7, 8, 8, 9, 9, 10, 10, 11, 11, 2,
2,
}; // an array of pin numbers to which LEDs are attached (7 < 10 - GFWORX)
int pinCount = 96; // the number of pins (i.e. the length of the array)
void setup() {
int thisPin;
// the array elements are numbered from 0 to (pinCount - 1).
// use a for loop to initialize each pin as an output:
for (int thisPin = 0; thisPin < pinCount; thisPin++) {
pinMode(ledPins[thisPin], OUTPUT);
}
}
void loop() {
// loop from the lowest pin to the highest:
for (int thisPin = 0; thisPin < pinCount; thisPin++) {
// turn the pin on:
digitalWrite(ledPins[thisPin], HIGH);
delay(timer);
// turn the pin off:
digitalWrite(ledPins[thisPin], LOW);
}
// loop from the highest pin to the lowest:
for (int thisPin = pinCount - 1; thisPin >= 0; thisPin--) {
// turn the pin on:
digitalWrite(ledPins[thisPin], HIGH);
delay(timer);
// turn the pin off:
digitalWrite(ledPins[thisPin], LOW);
}
}
Thank You for the tip Crossroads and JAMES C4S.
Thank you to the creator of the code, I only added pin configuration in order to teach my self how to modify the code.
Second is a Sketch from the library as well. I unfortunately did not save the re worked code earlier this evening.
This is the sketch that i tried to modify for the use of 10 x LED.
I would like to set multiple pins high, both in the flashing pattern and in the fading pattern, at the same time / within the same sketch, with both fast and slow speed. (Merge the two functions of the code, flash / fade, as well as change timing of individual patterns within the same code.
i hope that this make sense to you.
int ledPin = 9; // LED connected to digital pin 9
void setup() {
// nothing happens in setup
}
void loop() {
// fade in from min to max in increments of 5 points:
for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=5) {
// sets the value (range from 0 to 255):
analogWrite(ledPin, fadeValue);
// wait for 30 milliseconds to see the dimming effect
delay(30);
}
// fade out from max to min in increments of 5 points:
for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=5) {
// sets the value (range from 0 to 255):
analogWrite(ledPin, fadeValue);
// wait for 30 milliseconds to see the dimming effect
delay(30);
}
}
I started at the top of the sketch and added pin 2 - 11 = 10 x LED
run the code and worked on the error codes all the way to the end of the sketch.
I eventually got a java error.
I do apologize for the Essay.
Once again, thank You all
Kind regards
Gert