one button, three relays.
Posted: 23 Nov 2022, 18:57
Help with the rules, I want to control three relays with one button. Each press turns on the next relays and so on in a circle. How to implement this? There used to be such rules, now they do not work.
Code: Select all
on prg#prg do
if [prg#prg]=0 and [sw2_p1#sw2_p1]=0 and [sw3_p2#sw3_p2]=0 and [sw4_p3#sw4_p3]=0
gpio,14,0
gpio,12,0
gpio,4,1
endif
endon
on prg#prg= do
if [prg#prg]=0 and [sw2_p1#sw2_p1]=1 and [sw3_p2#sw3_p2]=0 and [sw4_p3#sw4_p3]=0
gpio,4,0
gpio,12,1
gpio,14,0
endif
endon
on prg#prg do
if [prg#prg]=0 and [sw2_p1#sw2_p1]=0 and [sw3_p2#sw3_p2]=1 and [sw4_p3#sw4_p3]=0
gpio,12,0
gpio,4,0
gpio,14,1
endif
endon
on prg#prg do
if [prg#prg]=0 and [sw2_p1#sw2_p1]=0 and [sw3_p2#sw3_p2]=0 and [sw4_p3#sw4_p3]=1
gpio,4,0
gpio,14,0
gpio,12,0
endif
endon