Once I figured out how to use posts to control the behavior of LEDs (outputs), it occurred to me that I still didn't know how to use a Photon to read the value of sensor data (inputs). After many failed experiments, blindly attempting to alternate between digital and analog pins to figure out how they worked, I bought an ebook titled Programming the Photon: Getting Started with the Internet of Things and started reading it. In the process, I figured out why a web hook I’d created (linking my Photon to a channel on ThingSpeak) was returning nonsense data. That data was “float” data, which is generated when a microcontroller’s analog pin (in this case A0) isn’t actually attached to a sensor. The book gave me the idea to connect a photocell and resistor to my Photon. In the process, I discovered that the web hook actually did work, and I was actually able to get data from my device to populate a chart on a Thing Speak channel I created for this purpose!
My next step is to figure out how to make this data more meaningful, and how I might use it (or some other type of data from my device) to talk with a wearable or book that I make. I also need to figure out how to use some of the other features of Thing Speak, because I don't yet understand how to use MATLAB code or apply most of the Thing Speak apps.
No comments:
Post a Comment
Thanks for commenting.