From a31ba6befbf9bd5502fdaeacb7744a61e132cb80 Mon Sep 17 00:00:00 2001 From: lubiana Date: Fri, 24 May 2024 15:55:46 +0200 Subject: [PATCH] add raupencode --- RAUPE.ino | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 RAUPE.ino diff --git a/RAUPE.ino b/RAUPE.ino new file mode 100644 index 0000000..18e021d --- /dev/null +++ b/RAUPE.ino @@ -0,0 +1,41 @@ +#include +#define NUM_LEDS 200 +#define DATA_PIN 10 +#define LEDTYPE WS2812B +#define DOSERIAL 0 + +CRGB leds[NUM_LEDS]; + +int fadeAmount = 2; // Set the amount to fade I usually do 5, 10, 15, 20, 25 etc even up to 255. +int brightness = 50; +int delayTime = 60; +int lowerBound = 10; +int upperBound = 200; + +void setup() { + FastLED.addLeds(leds, NUM_LEDS); + Serial.begin(9600); //This pipes to the serial monitor + Serial.println("Initialize Serial Monitor"); +} + +void loop() { + for (int i = 0; i < NUM_LEDS; i++) { + leds[i] = CRGB::SandyBrown; // Set Color HERE!!! + FastLED.setBrightness(brightness); + } + + if (DOSERIAL == 1){ + Serial.println(brightness); + Serial.println(fadeAmount); + Serial.println('-'); + } + + FastLED.show(); + // reverse the direction of the fading at the ends of the fade: + if (brightness < lowerBound || brightness > upperBound) { + fadeAmount = -fadeAmount; + } + brightness = brightness + fadeAmount; + + delay(delayTime); // This delay sets speed of the fade. I usually do from 5-75 but you can always go higher. +}