String ioUsername = "YOUR_ADAFRUIT_IO_USERNAME";
String ioKey = "YOUR_ADAFRUIT_IO_KEY";
String feed = "YOUR_FEED_NAME"; // Replace with your Adafruit IO feed name
String adafruitIOUrl = "https://io.adafruit.com/api/v2/" + ioUsername + "/feeds/" + feed + "/data";
void setup() {
size(200, 200);
background(50);
fill(200);
String[] lines = loadStrings(adafruitIOUrl + "?x-aio-key=" + ioKey);
if (lines != null) {
for (String line : lines) {
println("Response from Adafruit IO: " + line);
}
} else {
println("Failed to retrieve data from Adafruit IO");
}
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter