Adafruit IO Configuration

Configuration

Each Arduino sketch for this guide uses a single config.h file that stores your WiFi and Adafruit IO credentials.  There are placeholders in that file that need to be replaced with values specific to your WiFi network and Adafruit IO account. Make changes and use that file with each of the sketches on subsequent pages in this guide: copy it into the directory for each sketch. The ESP/Adafruit IO guide walks you through making those changes.

/************************ Adafruit IO Config *******************************/

// visit io.adafruit.com if you need to create an account,
// or if you need your Adafruit IO key.
#define IO_USERNAME    "your_username"
#define IO_KEY         "your_key"

/******************************* WIFI **************************************/

// the AdafruitIO_WiFi client will work with the following boards:
//   - HUZZAH ESP8266 Breakout -> https://www.adafruit.com/products/2471
//   - Feather HUZZAH ESP8266 -> https://www.adafruit.com/products/2821
//   - Feather M0 WiFi -> https://www.adafruit.com/products/3010
//   - Feather WICED -> https://www.adafruit.com/products/3056

#define WIFI_SSID       "your_ssid"
#define WIFI_PASS       "your_pass"

// comment out the following two lines if you are using fona or ethernet
#include "AdafruitIO_WiFi.h"
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);


/******************************* FONA **************************************/

// the AdafruitIO_FONA client will work with the following boards:
//   - Feather 32u4 FONA -> https://www.adafruit.com/product/3027

// uncomment the following two lines for 32u4 FONA,
// and comment out the AdafruitIO_WiFi client in the WIFI section
// #include "AdafruitIO_FONA.h"
// AdafruitIO_FONA io(IO_USERNAME, IO_KEY);


/**************************** ETHERNET ************************************/

// the AdafruitIO_Ethernet client will work with the following boards:
//   - Ethernet FeatherWing -> https://www.adafruit.com/products/3201

// uncomment the following two lines for ethernet,
// and comment out the AdafruitIO_WiFi client in the WIFI section
// #include "AdafruitIO_Ethernet.h"
// AdafruitIO_Ethernet io(IO_USERNAME, IO_KEY);

Libraries

To build the code in this guide you will need to use the Arduino Library Manager to install the latest versions of the Adafruit_SeesawAdafruit_IO_Arduino, and ArduinoHTTPClient libraries. If you haven't installed Adafruit libraries into your Arduino environment before, see this guide.

This guide was first published on Jul 18, 2018. It was last updated on Jul 18, 2018. This page (Adafruit IO Configuration) was last updated on Sep 19, 2019.