Interface 32

PHOTO EMBED

Sun Jan 07 2024 18:40:03 GMT+0000 (Coordinated Universal Time)

Saved by @马丽

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");
  }
}
content_copyCOPY