Simple switch issues
Posted: 07 Jan 2017, 17:09
hi all,
I'm trying to use a simple pushbutton to turn a LED on locally for testing purposes but having hard times achieving it.
I have a LED connected to gpio 12 and a push button on pgio 16. I already tried a lot of combinations of the switch configuration but still struggling. (tried both bringing the pin high, low, pullup on/off).
Could someone help me with this?
Ultimately I'd like to send a http command when the gpio 16 will go high due to PIR activation.
The rules I have now for testing are :
on switchon do
gpio 12,1
endon
on switchoff do
gpio 12,0
endon
on test#Switch do
if [test#Switch]=1
event switchon
else
event switchoff
endif
endon
I'm trying to use a simple pushbutton to turn a LED on locally for testing purposes but having hard times achieving it.
I have a LED connected to gpio 12 and a push button on pgio 16. I already tried a lot of combinations of the switch configuration but still struggling. (tried both bringing the pin high, low, pullup on/off).
Could someone help me with this?
Ultimately I'd like to send a http command when the gpio 16 will go high due to PIR activation.
The rules I have now for testing are :
on switchon do
gpio 12,1
endon
on switchoff do
gpio 12,0
endon
on test#Switch do
if [test#Switch]=1
event switchon
else
event switchoff
endif
endon