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.
This blog is a place where I write about tools and ideas related to teaching, technology, and making.
Showing posts with label ifttt. Show all posts
Showing posts with label ifttt. Show all posts
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.
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.
Tuesday, October 25, 2016
Triggering a Rickroll on a Photon with a QR Code (#IoT)
Over the past couple of days, there has been a lot of news circulating about security issues present in gadgets connected to the Internet of Things. Keeping that in mind, I'm cautiously continuing my experimentation with the Photon, trying to be mindful of the fact that there are privacy risks involved in transforming ordinary objects into smart objects.
Thinking about ways that music might contribute to the creation of an interactive book that I'm going to be creating, I started tinkering with the code from Spark Fun's Music Time tutorial that plays Rick Astley's song "Never Going to Give You Up." I tweaked the code by creating a new Particle function that only plays the music when the function is triggered by a web call. I used the Maker Channel on If Then Than That to trigger it and linked it to a QR code (see previous post).
Even though electronic buzzer music can be a little annoying, I'm thinking that it would be interesting if QR codes embedded into a book could trigger different tunes or sound effects to help advance a narrative.
Friday, October 21, 2016
Triggering a Photon Servo with a QR Code (#IoT)
In my last post, I got a servo running on a Photon by using web requests sent from Node.js and Twitter. After getting to that point, I wondered how I might automate the process so that someone else could trigger my servo, if I were to integrate one into a wifi-connected book. Today, I had an idea that this might be achieved by creating a QR code. I wasn't sure whether this was possible until I came across a blog by Trevor Fox. While his post was related to a completely different (albeit clever) use of the QR code, I noticed that he was using If Then Than That (IFTTT) like I was, when I created my web request for Twitter. This prompted me to do some experimenting which ended up working!
The last time I played with my servo, I created a recipe that paired Twitter with an "Action" on the Maker Channel. The "Action" was a web POST. When paired with the hashtag #servo, it triggered a Particle function that made the servo move. This time, I needed to create a "Trigger" to receive a web request.
The "Trigger" became a unique URL that I could then paste into a QR code generator to produce a QR code.
To learn more, visit "How to Trigger Events" on the Maker Channel page.
WARNING: Using a QR could become a security issue, if someone really wanted to try to figure out your IFTTT key.
Subscribe to:
Posts (Atom)


