https://github.com/danesparza/halloweenfire
:jack_o_lantern: Arduino sketch for multiple neopixels to create spooky 'fire' effect
https://github.com/danesparza/halloweenfire
adafruit arduino electronics fire halloween led leds multiple-neopixels neopixels
Last synced: 7 months ago
JSON representation
:jack_o_lantern: Arduino sketch for multiple neopixels to create spooky 'fire' effect
- Host: GitHub
- URL: https://github.com/danesparza/halloweenfire
- Owner: danesparza
- License: mit
- Created: 2015-09-06T15:07:32.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2020-10-08T13:51:29.000Z (about 5 years ago)
- Last Synced: 2025-03-24T03:24:04.776Z (8 months ago)
- Topics: adafruit, arduino, electronics, fire, halloween, led, leds, multiple-neopixels, neopixels
- Language: C++
- Homepage:
- Size: 6.84 KB
- Stars: 32
- Watchers: 3
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Halloweenfire
Arduino sketch for multiple NeoPixels to create spooky 'fire' effect
I have tested this with an [Adafruit Metro Mini 5v](https://www.adafruit.com/product/2590) and an [Adafruit Pro Trinket 3v](https://www.adafruit.com/products/2010) successfully. You'll also need to get your hands on some [NeoPixels](https://www.adafruit.com/search?q=neopixel&b=1) and the [NeoPixel library](https://github.com/adafruit/Adafruit_NeoPixel).
I recommending powering this with a USB [battery charger](http://www.amazon.com/Anker-Generation-Astro-mini-Lipstick-Sized/dp/B005X1Y7I2).
Remember to indicate what pin you're using and how many NeoPixel LED's are in your chain:
```cpp
#define PIN 6
// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(4, PIN, NEO_GRB + NEO_KHZ800);
```
You can also adjust some parameters of the sketch to easily tweak the fire effect. Here, we are using an orange flame effect by default:
```cpp
RGB flameColors[] = {
{ 226, 121, 35}, // Orange flame
{ 158, 8, 148}, // Purple flame
{ 74, 150, 12}, // Green flame
{ 226, 15, 30} // Red flame
};
```
I also recently tweaked this sketch to make use of a momentary push button. Pushing the button will cycle to the next item in the color array (effectively changing the color):
```cpp
// The button pin
const int buttonPin = 2;
```