hi guys,

so i was looking around for an effect and found almost exactly what i needed, i was able to utilise the code from this topic 3 years back

the code being this

```
#include <math.h> // mathematical functions
#define ledNumber 4 // number of leds used
int ledPins[ledNumber] = { 11, 10, 9, 6 }; // assign the PWM pins
float fadingInterval[ledNumber]; // fading time variable
int remainingIntervals[ledNumber];
void setup() {
randomSeed(analogRead(0));
for (int i = 0; i < ledNumber; i++) {
fadingInterval[i] = random(1000, 4000); // assign random fading time
remainingIntervals[i] = fadingInterval[i];
}
}
void loop() {
for ( int i = 0; i < ledNumber; i++) {
uint8_t b = (exp(sin(remainingIntervals[i] / fadingInterval[i] * PI)) - 0.36787944) * 108.0;
analogWrite(ledPins[i], b);
if (!--remainingIntervals[i]) {
fadingInterval[i] = random(1000, 4000);
remainingIntervals[i] = fadingInterval[i];
}
}
}
```

now i managed to expand it easily enough to encompass a fourth led. however upon further reading it begins to talk about sine waves and so on to bring the leds down to full off.

i dont understand this and i was kind of hoping someone might be able to help me out in the sense im asking if someone can make the required code changes to add in the sine wave or other method mentioned but not take them down completely off, maybe a value of 20 out of 255 so they are just heavily dimmed?

i know thats alot to ask, but hey, if you dont ask, you get right? or if someone can explain (in stupid step my step terms cause i really dont understand much) how to add this in myself that would be amazing also because then i'd learn a little.