Contributors

Finishing Up

Previously, we created a function that would send your accelerometer data to Adafruit IO. Now we need to call this function whenever there's an update. We can call our postAccelerometerDataX() function inside of the startAccelerometerX()function so whenever an update happens, our sensor data will be sent to our Adafruit IO feed.

Now, whenever there are any update events that happens, the postAccelerometerDataX function sends current accelerometer x position data to Adafruit IO.

Setting up the Switch

With this switch, we'll be able to start and stop updates. In the stateChange function, if the switch is set to On, then we'll run the startAccelerometerX function. If not, it'll run the stopAccelerometerX function.

Which means that it'll send our sensor data straight to Adafruit IO and can be seen on a graph. Below shows a graph of my acceleration data from my iPhone.

Congrats!

You've successfully created your own app that not only displays your iOS device's sensor data, but also sends data using REST to Adafruit IO.

Now that you've completed this learn guide, download Adafruit IO Connect to use as a reference to send different sensor data. This version makes it possible to send accelerometer, magnetometer, or gyroscopic data to Adafruit IO.

OUT OF STOCK NOTIFICATION

YOUR NAME

YOUR EMAIL

You have been successfully subscribed to the Notification List for this product and will therefore receive an e-mail from us when it is back in stock!

For security reasons, an e-mail has been sent to you acknowledging your subscription. Please remember that this subscription will not result in you receiving any e-mail from us about anything other than the restocking of this item.

If, for any reason, you would like to unsubscribe from the Notification List for this product you will find details of how to do so in the e-mail that has just been sent to you!