Hi people and many thanks for taking time out to read my request for help with a Relay Shield project.
I’m using my Spark Core and Relay Shield to switch some mains powered lamps sitting in our office. I’ve got everything set up and working nicely and we have a little web service that let’s people change pin states using a function exposed to Spark Cloud.
One problem I am having is that when the web service loads it does not know the current state of each pin. I want to create a new function, or a Spark.variable, that outputs the state of each pin, as a STRING array: “HIGH | LOW | HIGH | HIGH”, for example.
I’m having difficulty wrapping my head around the Variables because I can’t find much in the way of documentation. I can think of some long winded ways around this but in the interest of streamlining the code I am in the market for some advice.
Has anyone done this for another project they can point me to? If not, does anyone have suggestions?
Thanks in advance!