// villogtassunk ledet
var toggle=1;
setInterval(function() {
toggle=!toggle;
LED1.write(toggle);
}, 500);
// csinaljunk fenyefektet
var leds = [LED1, LED2, LED3, LED4, LED5, LED6];
var states = [1,0,1,0,1,0];
setInterval(function() {
leds.forEach(function(elm, index) {
states[index] = ! states[index];
elm.write(states[index]);
});
}, 200);
// fenyfuzer
var leds = [LED1, LED2, LED3, LED4, LED5, LED6];
var states = [1,0,0,0,0,0];
var states2 = [1,0,1,0,1,0];
var states3 = [1,1,1,1,1,1];
var index = 0;
var run = 0;
setInterval(function() {
run++;
if(run < 13) {
leds.forEach(function(elm, index) {
elm.write(states[index]);
});
var next = ( index + 1 < 6 ? index + 1: 0);
states[index] = 0;
states[next] = 1;
index = next;
} else if(run < 25) {
leds.forEach(function(elm, index) {
states2[index] = ! states2[index];
elm.write(states2[index]);
});
} else {
leds.forEach(function(elm, index) {
states3[index] = ! states3[index];
elm.write(states3[index]);
});
}
if(run > 37) { run = 0; }
}, 200);