Skip to content

rlauzon54/xmaslights

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xmaslights

Christmas lights using Adafruit Mega Pixels and Arduino

Hardware

Set up

Read the Adafruit NeoPixel Überguide

Female DC Power adapter - Connect power to Arduino 5V input - Connect ground to Arduino ground - Connect power and ground to NeoPixels power/ground - Connect capacitor across terminals

alt text alt text alt text Video of the lights in action

The data line from the NeoPixels to pin 11 on the Arduino (adjust in code if you want to use a different pin).

Explanation

The code is set up for 150 pixels. If you are using a different size strip, you need to change this line:

Adafruit_NeoPixel strip = Adafruit_NeoPixel(150, PIN, NEO_GRB + NEO_KHZ800);

Be aware that the NeoPixels tend to take up alot of memory. So if you want to do more pixels, you might need to update to something with more memory than an Uno.

The algorythm is this:

  • Assign all LEDs a random color. The color is set by a red/green/blue value. The random(0,2) effectively acts like a boolean to turn off/on that color component.
  • Every loop ++ For each pixel reduce the brightness of the red, green or blue (randomly chosen) by a random amount. ++ If the pixel is dark (i.e. red/green/blue all zero), reset to random bright color.

The end result is a slowly diming, color changing set of pixels. While they all start bright, the will dim a varying rates and quickly go to a slowly diming/brightening mode.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages