Candle!

Started by using the lathe on a cuboidal wooden block, formed a cylindrical shape.

Drilled a 1 inch hole through the cylinder wood piece so it formed a pipe.

Drilled random holes on the pipe structure for light emissions.

What made me do this?

  1. I wanted to use the lathe and learn how to use it
  2. A flame structure I saw in Austin, Texas at Torchy’s Tacos on South Congress road apparently subconsciously stuck in my head

Materials – Arduino Uno, Adafruit neopixel jewel, wood

THE CANDLE!

The candle encasing has a very rough look, partially cause I’m still learning to sand and partly because I like the ruggedness.

I like the shadows it creates cause the rough cuts and I like that wood is a non-reflective surface that seems to be a good shade.

 

A piece of plastic was used as a diffuser as suggested by Aaron Parsekian which spread the light equally.

Code –

#include <Adafruit_NeoPixel.h>
#include <Interval.h>

const int neoPixelPin = 6;
const int numPixels = 7;
int level = 255;
float difference = 10;

Adafruit_NeoPixel strip = Adafruit_NeoPixel(numPixels, neoPixelPin, NEO_GRBW + NEO_KHZ800);

unsigned long keyColors[] = {0xED9912, 0xEDC512, 0xED5012, 0xDBED12}; //colors changed
unsigned long targetColor[numPixels]; 
unsigned long pixelColor[numPixels]; 

int numColors = sizeof(keyColors) / 4;
Interval flickerInterval;

void setup() {
 strip.begin(); 
 strip.clear(); 
 strip.show(); 
 flickerInterval.setInterval(flickerPixels, 100);
}

void loop() {
 flickerInterval.check();
 strip.show();
}


void flickerPixels() {
 
 for (int thisPixel = 0; thisPixel < numPixels; thisPixel++) {

 strip.setPixelColor(thisPixel, 0, 0, 0, level);
 if (level < 0) 
 level = 255;
 level = level - 60; //difference manipulated
 }

 if ((level >= 255) || (level <= 0)) { 
 difference = -difference; 
 }
 level += difference; 
 
 
}

unsigned long compare(unsigned long thisColor, unsigned long thatColor) {

 byte r = thisColor >> 16;
 byte g = thisColor >> 8;
 byte b = thisColor;

 byte targetR = thatColor >> 16;
 byte targetG = thatColor >> 8;
 byte targetB = thatColor;

 if (r > targetR) r--;
 if (g > targetG) g--;
 if (b > targetB) b--;

 if (r < targetR) r++;
 if (g < targetG) g++;
 if (b < targetB) b++;

 unsigned long result = ((unsigned long)r << 16) | ((unsigned long)g << 8) | b;
 return result;
}

 

 

One comment on “Candle!

Leave a Reply

Your email address will not be published. Required fields are marked *