Search models, users, collections, and posts

UFO lamp

GIF

Print Profile(1)

All
P2S
X1E
A1
P1S
X1 Carbon
H2D
H2D Pro
X1
H2S
P1P
H2C
X2D
A2L

0.2mm layer, 2 walls, 20% infill
0.2mm layer, 2 walls, 20% infill
Designer
10.9 h
3 plates

Open in Bambu Studio
Boost
3
9
0
0
4
1
Released 

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
 }
}

Comment & Rating (0)

(0/1000)