What was wrong with what I told you here?
For three:
#include <FadeLed.h>
//91 step sine table 0 = 0 degree, 90 = 90 degree
const flvar_t SineTable[91] PROGMEM = {
0, 4, 9, 13, 18, 22, 27, 31, 35, 40,
44, 49, 53, 57, 62, 66, 70, 75, 79, 83,
87, 91, 96, 100, 104, 108, 112, 116, 120, 124,
127, 131, 135, 139, 143, 146, 150, 153, 157, 160,
164, 167, 171, 174, 177, 180, 183, 186, 190, 192,
195, 198, 201, 204, 206, 209, 211, 214, 216, 219,
221, 223, 225, 227, 229, 231, 233, 235, 236, 238,
240, 241, 243, 244, 245, 246, 247, 248, 249, 250,
251, 252, 253, 253, 254, 254, 254, 255, 255, 255,
255};
//Make FadeLed object with a sine lookup table of 91 (0 to 90 including)
FadeLed sines[3] = {{9, SineTable, 90}, {10, SineTable, 90}, {11, SineTable, 90}};
const byte NrSines = sizeof(sines)/sizeof(sines[0]);
void setup(){
for(byte i = 0; i < NrSines; i++){
sines[i].setTime(1000); //halve period, 0% to 90% or 90% to 0%
}
//start the first
sines[0].on();
}
void loop(){
FadeLed::update();
//if first is >50% (45 degree) and second is not fading and off
if((sines[0].get() >= 45) && !sines[1].done() && (sines[1].get() == 0)){
sines[1].on();
}
//if first is >50% (45 degree) and second is not fading and off
if((sines[1].get() >= 45) && !sines[2].done() && (sines[2].get() == 0)){
sines[2].on();
}
//if sin is 100% (90 degree), fade back down
if(sines[0].done() && sines[0].get()){
sines[0].off();
}
//if sin is 100% (90 degree), fade back down
if(sines[1].done() && sines[1].get()){
sines[1].off();
}
//if sin is 100% (90 degree), fade back down
if(sines[2].done() && sines[2].get()){
sines[2].off();
}
}
Or with a handy loop:
#include <FadeLed.h>
//91 step sine table 0 = 0 degree, 90 = 90 degree
const flvar_t SineTable[91] PROGMEM = {
0, 4, 9, 13, 18, 22, 27, 31, 35, 40,
44, 49, 53, 57, 62, 66, 70, 75, 79, 83,
87, 91, 96, 100, 104, 108, 112, 116, 120, 124,
127, 131, 135, 139, 143, 146, 150, 153, 157, 160,
164, 167, 171, 174, 177, 180, 183, 186, 190, 192,
195, 198, 201, 204, 206, 209, 211, 214, 216, 219,
221, 223, 225, 227, 229, 231, 233, 235, 236, 238,
240, 241, 243, 244, 245, 246, 247, 248, 249, 250,
251, 252, 253, 253, 254, 254, 254, 255, 255, 255,
255};
//Make FadeLed object with a sine lookup table of 91 (0 to 90 including)
FadeLed sines[3] = {{9, SineTable, 90}, {10, SineTable, 90}, {11, SineTable, 90}};
const byte NrSines = sizeof(sines)/sizeof(sines[0]);
void setup(){
for(byte i = 0; i < NrSines; i++){
sines[i].setTime(1000); //halve period, 0% to 90% or 90% to 0%
}
//start the first
sines[0].on();
}
void loop(){
FadeLed::update();
for(byte i = 0; i < NrSines; i++){
//for all but last (who has no next)
if(i < (NrSines - 1)){
//if >50% (45 degree) and next is not fading and is off
if((sines[i].get() >= 45) && !sines[i + 1].done() && (sines[i + 1].get() == 0)){
sines[i + 1].on();
}
}
//if sin is 100% (90 degree), fade back down
if(sines[i].done() && sines[i].get()){
sines[i].off();
}
}
}
Although I do apologize for not updating the release
But the nightly should be fine 