Driver for Diving Flashlite

Ok, now i read some more about reading states, so my code will not work. my intention was to read the status (pwm 128) of the output pins as:

    if (whiteledPin == 128 && blueledPin == 0)

then set the output to the next mode (pwm 254):

 analogWrite(ledPinwhite,254

but now i know that this will not work.

Now i need a idea how to switch to the next mode...

thanks, markus