Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#include
#define NUM_LEDS 30 // Number of LEDs in your strip #define DATA_PIN 6 // Data pin connected to your LED strip #define LED_TYPE WS2813 // Type of LED strip (e.g., WS2812B, NeoPixel) #define BRIGHTNESS 255 // Global brightness (0-255) #define SATURATION 255 // Global saturation (0-255) CRGB leds[NUM_LEDS]; // Array to store LED colors void setup() { FastLED.addLeds
(leds, NUM_LEDS); FastLED.setBrightness(BRIGHTNESS); } void loop() { // Create a moving rainbow effect for (int j = 0; j < 255; j++) { // Loop through hues for (int i = 0; i < NUM_LEDS; i++) { // Assign a hue based on LED position and the current 'j' value leds[i] = CHSV(i * (255 / NUM_LEDS) + j, SATURATION, BRIGHTNESS); } FastLED.show(); // Update the LED strip delay(25); // Control animation speed } }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)