/* * Simple HTTP get webclient test */ #include #include const char* ssid = "ssid"; const char* password = "password"; #define HOST "api.twitch.tv" #define PATH "/kraken/streams/adafruit" #define REFRESH 20 // seconds between refresh #define LED 13 #define PIN 12 Adafruit_NeoPixel strip = Adafruit_NeoPixel(30, PIN, NEO_GRB + NEO_KHZ800); // change to NEO_GRBW + NEO_KHZ800 if using RGB + white strips // Fill the dots one after the other with a color void colorWipe(uint32_t c, uint8_t wait) { for(uint16_t i=0; i>> Client Timeout !"); client.stop(); return; } } boolean isStreaming = false; while (client.connected()) { if (client.find("\"stream\":{\"_id\":")) { isStreaming = true; } } Serial.print("Streaming status: "); Serial.println(isStreaming); digitalWrite(LED, isStreaming); if (isStreaming) { colorWipe(strip.Color(255, 0, 0), 50); // Red } else { colorWipe(strip.Color(10, 10, 10), 50); // Off } Serial.println("disconnecting from server."); client.stop(); delay(REFRESH*1000); }