Page 1 of 1
3 way selector controlled by single push button?
Posted: Thursday 10 November 2016 0:25
by maninblack30
Hello all!
I'm looking for some advice, I'd like to use a single input on a Pi to cycle through 3 states of a selector eg:
off>0n1>on2>off>on1>on2......and so on.
Any ideas on how I can do it?
Cheers,
Fraser
Re: 3 way selector controlled by single push button?
Posted: Thursday 10 November 2016 6:38
by Egregius
Simple, somthing like:
Code: Select all
if($s['switch'=="Off") sw($i['switch'],'On1');
elseif($s['switch'=="On1") sw($i['switch'],'On2');
elseif($s['switch'=="On2") sw($i['switch'],'Off');
Re: 3 way selector controlled by single push button?
Posted: Sunday 13 November 2016 5:07
by maninblack30
if($s['switch'=="Off") sw($i['switch'],'On1');
elseif($s['switch'=="On1") sw($i['switch'],'On2');
elseif($s['switch'=="On2") sw($i['switch'],'Off');
Any chance you could help me by showing how I could do it in Blocky, using an input on the Pi called Button 3?
Sorry for my complete lack of knowledge here!
Re: 3 way selector controlled by single push button?
Posted: Sunday 13 November 2016 5:25
by maninblack30
When I push button 3, test tank light always goes to "off"
http://www.domoticz.com/forum/download/ ... ew&id=8372