add raupencode

This commit is contained in:
Jonas 2024-05-24 15:55:46 +02:00
parent 413ef96128
commit a31ba6befb
Signed by: lubiana
SSH key fingerprint: SHA256:gkqM8DUX4Blf6P52fycW8ISTd+4eAHH+Uzu9iyc8hAM

41
RAUPE.ino Normal file
View file

@ -0,0 +1,41 @@
#include <FastLED.h>
#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<LEDTYPE, DATA_PIN>(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.
}