Now that we have installed all of the dependencies, we can try to run one of the Adafruit IO example sketches.
Navigate to the adafruitio_00_publish
sketch by opening the File -> Examples -> Adafruit IO Arduino menu.
Click on the config.h
tab, and replace the placeholders with your Adafruit IO info and WiFi connection credentials.
Since we are using AirLift with Adafruit IO Arduino, make sure to uncomment the line #define USE_AIRLIFT
line in the sketch so it looks like the following:
// uncomment the following line if you are using airlift #define USE_AIRLIFT
If you do not see this line, upgrade the Adafruit IO Arduino Library to the latest version.
If you're using an externally connected AirLift module (such as a breakout), you'll need to configure your ESP32's pins in the section of config.h
where the ESP32 pins are defined:
If you're using an AirLift All-in-One board, you don't need to perform pin configuration - Adafruit IO does this for you automatically based on the board's ESP pin definitions.
Then, compile and upload the sketch to your board.
Once the sketch is uploaded, you can now click the serial monitor icon to view the output of the sketch.
If everything goes as expected, you should see counter values being sent to Adafruit IO.
- If you are not connecting to Adafruit IO, check your WiFi and Adafruit IO credentials in config.h and try uploading your sketch again using the process above.
Congrats - you've sent a value to an Adafruit IO Feed!
Adafruit IO Usage
While you sent data to Adafruit IO, how do you know that Adafruit IO is receiving this data?
One of the most important places to check is the Adafruit IO Monitor Page. This page displays incoming data from your active feeds and any errors which might've occurred.
To do this, log into Adafruit IO and navigate to the monitor page.
If everything worked correctly, you should see an incrementing value sent to the counter feed while the code is running.
Next Steps
You've successfully connected your Arduino board to Adafruit IO - so, now what?
Would you like to add a sensor to your project? What about displaying your data on a graph? Control a motor from the internet? Set the colors of a RGB LED from the internet? Monitor the temperature and humidity of a room from across the world?
To continue your educational journey with Adafruit IO, click here to visit the Adafruit IO Basics series for guides about the topics listed and more!
Need some inspiration for your next project? We have lots of Adafruit IO-specific guides on the Adafruit Learning System. Click here to view more projects and guides for Adafruit IO.
Text editor powered by tinymce.