diff --git a/create_map/Karte_Deutschland.svg b/create_map/Karte_Deutschland.svg new file mode 100644 index 0000000..203dcee --- /dev/null +++ b/create_map/Karte_Deutschland.svg @@ -0,0 +1,423 @@ + + + +image/svg+xml + + + + + + + + + + +generated: 28.01.2020 + \ No newline at end of file diff --git a/create_map/Karte_Deutschland_backside.svg b/create_map/Karte_Deutschland_backside.svg new file mode 100644 index 0000000..efc0576 --- /dev/null +++ b/create_map/Karte_Deutschland_backside.svg @@ -0,0 +1,1099 @@ + + + +image/svg+xml + + + + + + + + + + + + +0 + +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 + +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +48 +57 +56 +55 +54 +53 +52 +51 +50 +49 +47 + \ No newline at end of file diff --git a/show_leds/show_leds.ino b/show_leds/show_leds.ino index 56eaa1f..bdb455d 100644 --- a/show_leds/show_leds.ino +++ b/show_leds/show_leds.ino @@ -4,19 +4,21 @@ #include - +#define OWN_PIN 28 +#define FREE_CYCLES 10 #define PIN 2 -#define NUMPIXELS 12 +#define NUMPIXELS 58 const char* ssid = "CTDO-LEGACY"; -const char* password = "******"; +const char* password = "****"; const char* apiEndpoint = "http://spacepanel.stablerock.de/leds"; const int pollInterval = 10000; HTTPClient http; -Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); +Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_RGB + NEO_KHZ800); int delayval = 500; +int freecycles = 0; void setLED(int i, String value) { String value_short = value.substring(1); @@ -34,8 +36,7 @@ void setLED(int i, String value) { Serial.print(g); Serial.print(", "); Serial.println(b); - pixels.setPixelColor(i, pixels.Color(r/255,g/255,b/255)); - pixels.show(); + pixels.setPixelColor(i, pixels.Color(r/25,g/25,b/25)); } void setup() { @@ -62,16 +63,23 @@ void loop() { DynamicJsonDocument doc(capacity); deserializeJson(doc, json); for (int i = 0; i < NUMPIXELS; i++) { - Serial.print("LED" + String(i) + ": "); - const char* element = doc[i]; - String value = String(element); - setLED(i, value); - Serial.print("LED" ); - Serial.print(i); - Serial.print("Color: "); - Serial.println(value); + if (i == OWN_PIN && freecycles < FREE_CYCLES) { + setLED(i, "#00ff00"); + } + else { + Serial.print("LED" + String(i) + ": "); + const char* element = doc[i]; + String value = String(element); + setLED(i, value); + Serial.print("LED" ); + Serial.print(i); + Serial.print("Color: "); + Serial.println(value); + } } + pixels.show(); + freecycles++; } else { Serial.println("Error: Statuscode" + httpCode); }