commit 9577db42bcd760e5fdde8984055080670a527c34 Author: Mal Date: Fri Jan 16 21:59:15 2026 +0100 Init diff --git a/PortalATtiny.ino b/PortalATtiny.ino new file mode 100644 index 0000000..575d622 --- /dev/null +++ b/PortalATtiny.ino @@ -0,0 +1,46 @@ +#include + +/* Change LEDS to the number of your leds */ +#define LEDS 43 + +#define PIN 3 + +#define RED 255 +#define GREEN 64 +#define BLUE 0 + +Adafruit_NeoPixel strip(LEDS, PIN); + +float SPEED[LEDS]; + +float getIntensity(const unsigned int *id, const unsigned long *timestamp) { + return 0.1 + (cos((float)*timestamp * 0.01 * SPEED[*id]) + 1.0) * 0.45; +} + +void setup() { + strip.begin(); + strip.show(); + + for (int s = 0; s < LEDS; s++) { + SPEED[s] = (float)random(100, 1000) / 1000.0; + } +} + +void loop() { + unsigned long timestamp = millis(); + + for (int led = 0; led < LEDS; led++) { + float intensity = getIntensity(&led, ×tamp); + + strip.setPixelColor( + led, + (float)RED * intensity, + (float)GREEN * intensity, + (float)BLUE * intensity + ); + } + + strip.show(); + + delay(2); +} \ No newline at end of file