Skip to main content
F3D
Đèn trang trí hình UFO độc đáo 1

6 images

DIY

Đèn trang trí hình UFO độc đáo

By G4ZO

Downloads
10
Likes
5
Views
130

Files 5 5.9 MB

  • Upper_half_1774703695.stlSTL · 2.8 MB
  • Lower_half_1774703695.stlSTL · 1.7 MB
  • light_beam_With_diffuser_1774703696.stlSTL · 110.3 KB
  • light_beam_1774703697.stlSTL · 93.8 KB

Make a variant with AI

Build another version of this model.

Open Studio

Description

UFO lamp using Arduino and WS2812B LED 

To build this you need:
1 Arduino pro mini
3 WS2812B LED strip, 60LEDs/meter, each with 9 LEDs
The UFO closes with 10*2mm magnets or you can just glue the 2 halves together.

Connect the data pin of the three LED strips together to pin 11 on the Arduino.



----------------------------------------------------

Arduino code

----------------------------------------------------

// Adafruit NeoPixel library
#include <Adafruit_NeoPixel.h>
#ifdef AVR
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif

// Which pin on the Arduino is connected to the NeoPixels?
#define PIN 11

// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS 9

Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
// These lines are specifically to support the Adafruit Trinket 5V 16 MHz.
// Any other board, you can remove this part (but no harm leaving it):
#if defined(AVR_ATtiny85) && (F_CPU == 16000000)
clock_prescale_set(clock_div_1);
#endif
// END of Trinket-specific code.

pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
pixels.clear();

}

void loop() {
for(int i=8; i+1>0; i--) {
pixels.setPixelColor(0, pixels.Color(0, 100, 0)); //reset last led

//First wave
// pixels.Color() takes RGB values, from 0,0,0 up to 255,255,255
pixels.setPixelColor(i, pixels.Color(60, 220, 0));
if(i<9) pixels.setPixelColor(i+1, pixels.Color(00, 100, 0)); //reset last led

//Second wave
if(i+5<9) pixels.setPixelColor(i+5, pixels.Color(60, 200, 0));
else pixels.setPixelColor(i-4, pixels.Color(60, 220, 0));
if(i+5<9) pixels.setPixelColor(i+6, pixels.Color(00, 100, 0)); //reset last led
else pixels.setPixelColor(i-3, pixels.Color(0, 100, 0)); //reset last led

pixels.show(); // Send the updated pixel colors to the hardware.
delay(120); // Pause before next pass through loop
}
}

Read more Show less

Print spec

Formats
3mfstl
Model files
5
Total size
5.9 MB
Largest file
2.8 MB

0 comments

See all