Pin x.Y as input
portx.y as output

do
if pinx.y=0 then
while pinx.y = 0
wend
toggle port x.y
end if
loop

MfG Loki