
i have an 3 way switch and try to do something like this, but it wont work

sure the problem is me

if the switch is in position "up" i want to switch MCPGPIO,1,1 (works already)
if the switch is in middle position i want MCPGPIO,1,0 (does not work)
if the switch is in position "down" i want MCGPIO,1,StateOfmcp#29 (does not work)
Code: Select all
on mcp#18=1 do // Switch position "up"
MCPGPIO,1,1
endon
on mcp#18=0 do // Switch position "middle"
if mcp#17=0 // to make sure Switch is not in position "down"
MCPGPIO,1,0
endif
endon
on mcp#17=1 do // Switch is in Position "down"
if mcp#29=1 do
MCPGPIO,1,1
else
MCPGPIO,1,0
endif

Thank you very much !!
Have a great day