LED ColorCycle

This script was requested by DivineZeus. It cycles through all the LEDs 16 color combination. Press the touchpad to cycle the color. After every color combination it turns off. Then on again when you press touchpad again. Please enjoy. -Token
Version1.00
Authortoken
Publish DateSun, 6 Apr 2014 - 22:46
Last UpdateSun, 6 Apr 2014 - 22:46
Downloads129
RATE


2

0

Code: Select all
define Skip = 0;
data(Skip,2,2,2,0,0,0,1,0,0,1,0,0,0,1,1,0,1,0,0,0,1,0,1,0,1,1,0,0,1,1,1,1,0,0,0,1,0,0,1,1,0,1,0,1,0,1,1,1,1,0,0,1,1,0,1,1,1,1,0,1,1,1,1);
int Variable;
int ColorCounter = 0;
int Y=FALSE;
main {
 
 
set_val(TRACE_1,ColorCounter);
set_val(TRACE_2,Variable);
set_val(TRACE_3,Y);
 
    if(event_press(PS4_TOUCH) && Y) combo_run(ColorCycle);
    if(event_press(PS4_TOUCH) && !Y) combo_run(Terminate);
    if(event_press(PS4_TOUCH)) Y = !Y
    if(event_press(PS4_TOUCH) && !Y && ColorCounter <= 15) ColorCounter = ColorCounter + 1;
    else if(ColorCounter > 15) {ColorCounter = 0; Y = FALSE; reset_leds()}
 
}
combo ColorCycle {
Variable=(ColorCounter*4)-1;
set_led(LED_1, dbyte(Variable+1));
set_led(LED_2, dbyte(Variable+2));
set_led(LED_3, dbyte(Variable+3));
set_led(LED_4, dbyte(Variable+4));
}
 
combo Terminate{
set_led(LED_1, 0);
set_led(LED_2, 0);
set_led(LED_3, 0);
set_led(LED_4, 0);
}