3D-модель · Printables

Thunderflash Disco Lights for Hercules DJ Controller

Сведения о модели

Площадка
Printables
Цена
Бесплатно
Лицензия
CC-BY-NC
Можно печатать и изменять для себя с указанием автора; продавать модель и отпечатки нельзя.
Форматы
STL
  • 10 Лайки
  • 14 Загрузки
  • 0 Напечатали
  • 0 Комментарии
  • 836 Просмотры

Автор:Mindutis

Опубликована

Описание

My kids saw a Hercules mixing console on Printables and wanted to buy it immediately. But instead of purchasing it right away, we decided to try winning it first. To come up with a great idea, we conducted a classroom survey to see what would be best. The winning idea? Flashing disco lights, of course!

We chose to use a WS2812B Neopixel LED strip, with the option of controlling it using either a Raspberry Pi Pico or an ESP32 WROOM. The lights can be pre-programmed, or we can use the WLED project ( https://kno.wled.ge/ ), allowing others to control them as well.

Around 50 LEDs will be placed around the holder, meaning we need approximately 1 meter of a WS2812B LED strip (60 LEDs/m, 10mm width, 5VDC). All can be powered with a powerbank.

The holder is assembled using dowels, which can either be glued in place or simply press-fitted. Instead of gluing the front logo, two holes for dowel pins were added for easy attachment.

Below is a code example for controlling the lights, similar to the video demonstration.

Hope someone will find it useful.

Example code using Arduino IDE with ESP32-WROOM-DA Module:

#include <Adafruit_NeoPixel.h>

#define LED_PIN 13 // Pin connected to the LED strip #define NUM_LEDS 51 // Number of LEDs in the strip #define BRIGHTNESS 127 // Set brightness (0-255). Lower it to half if USB power is poor.

Adafruit_NeoPixel strip(NUM_LEDS, LED_PIN, NEO_GRB + NEO_KHZ800);

void setup() { strip.begin(); strip.show(); // Initialize all pixels to 'off' strip.setBrightness(BRIGHTNESS); }

void loop() { masterpieceDiscoShow(30000); // Disco show for 30 seconds }

void masterpieceDiscoShow(int duration) { unsigned long startTime = millis(); while (millis() - startTime < duration) { int effect = random(1, 7); // Choose a random effect switch (effect) { case 1: stereoBlast(); // Stereo synchronized blast break; case 2: randomBeatBlasts(); // Aggressive random beat flashes break; case 3: policeStrobe(3000); // Chaotic police-style strobe break; case 4: waveEffect(); // Flowing wave pattern break; case 5: bassDropExplosion(); // Epic bass drop flashes break; case 6: lightningStorm(); // Unpredictable lightning effect break; } } }

void stereoBlast() { for (int i = 0; i < NUM_LEDS / 2; i++) { strip.setPixelColor(i, strip.Color(255, 0, 0)); // Left half Red strip.setPixelColor(NUM_LEDS - 1 - i, strip.Color(0, 0, 255)); // Right half Blue strip.show(); delay(10); } delay(80); strip.clear(); strip.show(); delay(120); }

void randomBeatBlasts() { for (int i = 0; i < 6; i++) { strip.clear(); for (int j = 0; j < NUM_LEDS; j++) { if (random(0, 5) > 2) { // Randomized spread strip.setPixelColor(j, strip.Color(random(100, 255), random(100, 255), random(100, 255))); } } strip.show(); delay(60); strip.clear(); strip.show(); delay(200); } }

void policeStrobe(int duration) { unsigned long startTime = millis(); while (millis() - startTime < duration) { for (int i = 0; i < NUM_LEDS; i++) { strip.setPixelColor(i, (random(0, 3) > 1) ? strip.Color(255, 0, 0) : strip.Color(0, 0, 255)); } strip.show(); delay(50); strip.clear(); strip.show(); delay(50); } }

void waveEffect() { for (int j = 0; j < 256; j += 30) { for (int i = 0; i < NUM_LEDS; i++) { int colorVal = (i * 256 / NUM_LEDS + j) & 255; strip.setPixelColor(i, strip.Color(colorVal, 255 - colorVal, colorVal / 2)); } strip.show(); delay(50); } }

void bassDropExplosion() { for (int i = 0; i < 4; i++) { for (int j = 0; j < NUM_LEDS; j++) { strip.setPixelColor(j, strip.Color(255, 255, 255)); } strip.show(); delay(30); strip.clear(); strip.show(); delay(400); } }

void lightningStorm() { for (int i = 0; i < 5; i++) { int flashCount = random(2, 6); for (int j = 0; j < flashCount; j++) { for (int k = 0; k < NUM_LEDS; k++) { strip.setPixelColor(k, strip.Color(255, 255, 255)); } strip.show(); delay(random(30, 100)); strip.clear(); strip.show(); delay(random(100, 250)); } delay(500); } }

Теги

Комментарии

Загружаем комментарии…
Ещё по теме

Похожие модели

Названия используются только для указания источника результата. Polyzon не аффилирован с перечисленными площадками.