Skip to content
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Cannot retrieve contributors at this time
// Adafruit IO Publish Example
// Adafruit invests time and resources providing this open source code.
// Please support Adafruit and open source hardware by purchasing
// products from Adafruit!
// Written by Todd Treece for Adafruit Industries
// Copyright (c) 2016 Adafruit Industries
// Licensed under the MIT license.
// All text above must be included in any redistribution.
/************************** Configuration ***********************************/
// edit the config.h tab and enter your Adafruit IO credentials
// and any additional configuration needed for WiFi, cellular,
// or ethernet clients.
#include "config.h"
/************************ Example Starts Here *******************************/
// this int will hold the current count for our sketch
int count = 0;
// set up the 'counter' feed
AdafruitIO_Feed *counter = io.feed("counter");
void setup() {
// start the serial connection
// wait for serial monitor to open
while(! Serial);
Serial.print("Connecting to Adafruit IO");
// connect to
// wait for a connection
while(io.status() < AIO_CONNECTED) {
// we are connected
void loop() {
//; is required for all sketches.
// it should always be present at the top of your loop
// function. it keeps the client connected to
//, and processes any incoming data.;
// save count to the 'counter' feed on Adafruit IO
Serial.print("sending -> ");
// increment the count by 1
// Adafruit IO is rate limited for publishing, so a delay is required in
// between feed->save events. In this example, we will wait three seconds
// (1000 milliseconds == 1 second) during each loop.