Ok, it went a step further now - the switch will go to off (down), then on (up) but stops there.

I was thinking about the variable active_tri; should I have a statement for when it equals 0?