I suspect the switch is connected between the pin and ground effectively giving you a logic low for a switch press. That is why the colors are cycling.
If this is truly the case, then you can do well to change these lines in switchloop
Code:if SwitchPin = 0 then ButtonCount = ButtonCount+1 if ButtonCount > 3 then ButtonCount = 1 while SwitchPin = 0: wend ' wait here while the switch remains pressed endif




Bookmarks