ok, so this isn't running as smoothly as i'd like!
i've sacked off A and E and i'm running the whole thing inside a switch.
i have 4 modes;
1 - fade in leds upwards
2 - fade in leds downwards
3 - fade out all leds
4 - all leds stay off
int switchbutton = 0;
switch (whichbutton) {
case 1: // bottom step
// ACCENT LIGHTING
// UP LIGHTING
// LANDING LIGHTING
whichbutton = 3;
break;
case 2: // top step
// ACCENT LIGHTING
// DOWN LIGHTING
whichbutton = 3;
break;
case 3: // all off
// STEPS OFF
// LANDING OFF
// ACCENT OFF
whichbutton = 0;
break;
default: // all off
// ALL LEDS OFF
break;
} end of switch
so the running system is; 2 buttons (which button) trigger case 1 (whichbutton = 1) , or case 2 (whichbutton = 2) respectively, and then following case 1, or case2, whichbutton is set to 3 (whichbutton = 3) at the end of case3 whichbutton is set to 0, and defaults to all off.
what i seem to get is when which button is set to 3 inside the switch routine, it takes a couple of runs to realise and then jump to case 3, when in case 3 it takes a few runs and then it jumps to case 0, all off.
it works, its just not hardy!