ady624 / webCoRE

webCoRE is a web version of CoRE
GNU General Public License v3.0
249 stars 976 forks source link

How to implement a tri-state switch? #27

Closed ScottChapman closed 7 years ago

ScottChapman commented 7 years ago

So, I am getting up to speed on WebCoRE. What I am trying to do is create a tri-state switch for controlling my HVAC states (Cooling, Heating, off).

I thought I would create 3 virtual switches for each state, and when one is turned on it will turn off the others.

What I am not sure about how to do is can the actuating switch set the state of the other switches WITHOUT triggering the piston for that switch?

Does that make sense?

ScottChapman commented 7 years ago

I ended up implementing this myself, wasn;t hard actually. Used a global variable to control whether pistons should perform actions or just change state.

MikeBishop commented 6 years ago

I know you implemented it a different way long since, but I would implement this by having no actions on a switch turning off. I would trigger actions on any switch turning on (which would include turning off the other switches), and then on all switches being turned off.)