Hi all, for a new project I need to light up 16 NeoPixel Rings, for which I got a solution. But at the same time, I want to connect 16 momentary buttons/switches to the Spark and as one is going HIGH/LOW I want to capture that info and send that info out to the web.
the first problem is how get 16 inputs done - I intend to use this MUX board https://www.sparkfun.com/products/9056 which means I consume 4 digital pins on the Spark to get a total of 16 channels. I would then loop through the channels and check if a button has gone LOW for example. Does anyone see an issue with using the 16channel breakout board - or is there a smarter and better way to connect 16 buttons? I still need a few other pins, so I don’t want to consume all the spark pins
I need to get that info out to the web, that’s where it is - still - getting a bit tricky. Callbacks and server-sent events are not yet supported, if they were I would use them (Does anyone have a rough timeline? If a beta is out in 2 weeks I’d wait…). My current plan is to save the open buttosn in a variable, e.g. like “b1,b2” whcih means b1 is open and b2 is open. Then I could poll for that variable from outside. I hate polling, but it seems to be the only solution right now.
Can I expose String variables with Spark.variable()? How long may these Strings be?
And again, if anyone from Spark had a rough timeline when to expect the event/server sent event/callback feature, that would be super great!!!