1 / 4
Just Another Christmas Tree — zdjęcie 1
1 / 4

Just Another Christmas Tree

Zamów wydruk tego modelu

Obliczymy ostateczną cenę na podstawie wybranego pliku. Sprawdzisz ją i zaakceptujesz przed płatnością.

Zapisane na tym urządzeniu.

Flashing multicolor lights.

Ocena
0 / 5
Polubienia
2
Pobrania
6
Wydruki
0
Wyświetlenia
60
Oceny
0

Aktualizacja u źródła:

Informacje o modelu

Źródło
Printables
Licencja
Creative Commons — Attribution — Noncommercial

This project uses WS2812b addressable LEDs to create colorful lighting effects. The LEDs are controlled by a microcontroller. In my case, I used a Digispark Attiny85 USB, but you can use alternatives such as ESP32, ESP8266, or Raspberry Pi Pico/W.

If you want advanced control over the lighting patterns, you can flash the WLED firmware and manage everything via Wi‑Fi. I kept it simple and stuck with the Digispark since I already had one available and didn’t need to change the patterns.

Materials Needed

  • 🎄 WS2812b LED strip or ring

  • 🔌 Microcontroller (Digispark Attiny85, ESP32, ESP8266, Pico/W, etc.)

  • ⚡ Power supply (USB or external 5V)

  • 🛠 Jumper wires and breadboard (optional)

  • 🧵I used green and transparent filaments. The latter to cover the LEDs 😉

Wiring

  1. Connect the DIN pin of the LED strip to the microcontroller’s output pin.

  2. Connect VCC to 5V and GND to ground.

  3. Add a capacitor (1000 µF, 6.3V or higher) across VCC and GND to smooth power.

  4. (Optional) Add a resistor (330–470 Ω) between the microcontroller pin and DIN to protect the LEDs.

Code Basics

The code is straightforward:

  • Use a library like Adafruit NeoPixel or FastLED.

  • Define the number of LEDs and the pin used.

  • Write simple functions to set colors, animate patterns, or loop through effects.

Example snippet (FastLED):

#include <FastLED.h>

#define LED_PIN 0

#define NUM_LEDS 28

#define LED_TYPE WS2813

#define COLOR_ORDER GRB

#define BRIGHTNESS 140

CRGB leds[NUM_LEDS];

void setup() {

FastLED.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS);

FastLED.setBrightness(BRIGHTNESS);

random16_set_seed(analogRead(1));

}

void loop() {

for (int i = 0; i < NUM_LEDS; i++) {

if (random8() < 30) {

leds[i] = CHSV(random8(), 255, random8(80, 255));

} else {

leds[i].fadeToBlackBy(random8(10, 40));

}

}

FastLED.show();

delay(40);

}

Tagi