Best way to toggle a flag 0 to 1 and back
Posted: Thu May 18, 2017 9:55 pm
Hey group,
I would like to toggle a flag on a button push.
is there a better / simpler way??
thanks in advance
dwight
I would like to toggle a flag on a button push.
Code: Select all
btn = io(pi,3)
if btn = 0 then
if flag = 0 then flag = 1
else
if flag = 1 then flag = 0
endif
is there a better / simpler way??
thanks in advance
dwight