Monday, November 7, 2016

Interactive NeoPixels with Photon and Twitter (#IoT)

Today, I spent time experimenting with code and playing around with  If Then Than That (IFTTT), which recently changed its set-up.  My goal was to start merging programs on my Photon.  So far, I've got a servo and NeoPixels running in one program, but I'd still like to add in code for a buzzer and LEDs that will be triggered by a light sensor.

My most exciting breakthrough was figuring out how to use IFTTT's "New Tweet From Search" feature, which makes it possible to trigger a web request by filtering a search in Twitter.  In the case of my experiment, I created Applets, formerly referred to by IFTTT to as recipes, that can control the colors of NeoPixels connected to my Photon, in much the same way that CheerLights work!


This could provide an interesting way to interact with a wifi-connected book.  A reader could send a tweet to change the color of LEDs in the book or scan a QR code to achieve the same effect, by triggering a Maker Event (also set up in IFTTT).  While I'd already figured out how to do this with my own Tweets, I now know how to allow other peoples' tweets to interact with my Photon.  My next step is to add code to the program so that a musical function is called in response to data received on a light sensor.