We have been working hard on a new version of the Adafruit IO Arduino Library. We are releasing it in ‘beta’ form today for existing IO users to try, and we will be adding new tutorials and updating existing tutorials with usage examples very soon.
v2.0.0 of the library provides a simple device independent interface for interacting with Adafruit IO.
This allows you to switch beween WiFi (ESP8266, M0 WINC1500, & WICED),
Cellular (32u4 FONA), and Ethernet (Ethernet FeatherWing) with only a two line change
in your sketch. No changes are required to the sketch to switch between any of the
supported Feather WiFi boards.
The included examples focus on specific concepts without extra boilerplate related to setting up the specific WiFi, cell, or ethernet hardware being used. This will allow you to prototype your sketch on WiFi hardware, and easily move to cellular or ethernet with a very small change to your config file.
The library makes it simple to publish GPS location info with your data. For example, if you wanted to publish your location with your current speed, you would send it like this:
car->save(speed, lat, lon, ele);
You could then use the map block on io.adafruit.com to display your location info. The included
adafruitio_04_location example demonstrates how to send and receive location info.
The library adds type conversion helpers for both publishing and receiving data. You can
publish any data type to the
save(value) method of your feed, and you can use helpers
toFloat() to easily convert received messages to the appropriate
data type. The included
adafruitio_05_type_conversion example demonstrates converting to and from
all available types.
Updating to v2.0.0
The README for the library
has more info about required dependencies, and you should check there
to make sure you have all of the requirements for the hardware you are using. Make sure you
v2.0.0 or higher of the Adafruit IO Arduino Library, and
v0.16.0 of the Adafruit MQTT
Library using the Arduino IDE’s Library Manager.