MessageTorch - torch fire animation with WS2812 leds + message display

I just added a new config variable (line 24) to swap X and Y which turns the image 90°. I don’t have the same matrices as yours to test, but I hope it will work. If not, let me know :wink:

For your 64x8 array, the settings would be:

ledsPerLevel = 64;
levels = 8;
swapXY = true;

Depending on how your matrices are wired, you might also need reversedX and alternatingX.

You might also want to set the default for the text base line (text_base_line on line 532) to 0 or 1 instead of 8 so text will be visible without run time “param” tweaking.

2 Likes

@luz, it works well, I had to put every direction parameter to true and it displays well.
Thanks a lot for this.
I uploaded 2 video’s on youtube.
There is some flickering in the video, I assume it is a power issue as afterwards it was gone.

The second video is without flames

Nevertheless, thanks a lot for the change to the code.
KR,
Rudy

3 Likes

I made one! I used a vodka bottle as the center tube and 3D printed a base to hide all the electronics. The STL files are posted to Thingiverse with a hat-tip to this thread. :wink:

On my desk at work keeping me warm in this freezing cold basement!

Default NeoPixel Rainbow

6 Likes

@luz , just received my Photons and the code also works great on them :smiley:
KR,
Rudy

2 Likes

I now have mine set up to flare up any time something is displayed in a Slack channel we use for work. We get Trello and git updates posted to a specific channel. Any time something is posted in that channel, Slack pings a PHP script (using @harrisonhjones’s phpSpark library) that calls a function on the torch to make it flare up. It’s subtle yet awesome!

4 Likes

Sounds great! Would you mind sharing the code?

Here’s the MessageTorch + Slack integration stuff.

3 Likes

Hi,

Now with the Photon, I disassembled my old Torch to build a new one. Now I use a smaller tube inside the milky outer tube. So no LED is visible as such. I will use the lamp in my hobby room and of cource for christmas too. At the moment I am working on the code to show some patterns.

More details in the next days…

2 Likes

Since the arrangement of the LEDs is different to the original torch, I have to calculate relative position of the LEDs.

uint16_t calcAbsLedPos(uint16_t x, uint16_t y)
{
  uint16_t OffsetX = 0;
  uint16_t OffsetY = 0;

  //calculate X offset
  if (x > 0) {
    OffsetX = x * ledsY;
  }
  //calculate Y offset
  if ((x / 2) * 2 == x) {// Even number => normal direction for Y Offsets
    OffsetY = y;
  } else {
    OffsetY = ledsY - y - 1; // reverse counting
  }
  return OffsetX + OffsetY;
}

void DoCycle()
{
    // simple color wheel animation
    byte r,g,b;
    byte wheeldivider = numLeds / 128;
    uint16_t LEDcntr = 0;
    cyclecnt += 2;
    for(uint16_t y=0; y<ledsY; y++) {
      for(uint16_t x=0; x<ledsX; x++) {
        uint16_t LedPos = calcAbsLedPos(x,y);
        wheel(((LEDcntr / wheeldivider) - cyclecnt) , r, g, b);
        ws2812_setColorDimmed(LedPos, r, g, b, 64);
        LEDcntr++;
      }
    }
    ws2812_disableInterrupts();
    ws2812_transmitBuffer();
    ws2812_enableInterrupts();
}
7 Likes

The current version of the code already has support for zig-zag and swapped x/y layouts (see the comment from April 29th above), which I guess should cover your new LED arrangement:

Just set swapXY=true because your layout has the LED chains running vertically and set alternatingX=true because the chain runs up and down.
Depending on where your chain starts, you might also want to set reversedX

2 Likes

I love it when running code shows enlighten results. :smile:

Police Lights
Lighthouse

This time, I handle the LEDs like an XY array. 24 LEDs at X axis, 54 LEDs at Y axis.
It is very easy to fill some areas with some color.

This is the code

void fill_XYrange(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, RGBPixel p, uint8_t brightness)
{
  for(uint16_t y = y1; y <= y2; y++) {
    for(uint16_t x = x1; x <= x2; x++) {
      uint16_t LedPos = calc_AbsLedPos(x,y);
      set_ColorDimmed(LedPos, p, brightness);
    }
  }
}

I changed the code to use RGBPixels as default instead of using r, g, b as single variables

Some color definition makes it much easier too

// COLORS
const RGBPixel colorBlack   {0,0,0};
const RGBPixel colorWhite   {255,255,255};
const RGBPixel colorRed     {255,0,0};
const RGBPixel colorLime    {0,255,0};
const RGBPixel colorBlue 	  {0,0,255};
const RGBPixel colorYellow  {255,255,0};
const RGBPixel colorCyan    {0,255,255};
const RGBPixel colorMagenta	{255,0,255};
const RGBPixel colorSilver  {192,192,192};
const RGBPixel colorGray 	  {128,128,128};
const RGBPixel colorMaroon 	{128,0,0};
const RGBPixel colorOlive 	{128,128,0};
const RGBPixel colorGreen 	{0,128,0};
const RGBPixel colorPurple 	{128,0,128};
const RGBPixel colorTeal 	  {0,128,128};
const RGBPixel colorNavy    {0,0,128};
5 Likes

Would love to see some Haloween and Christmas animations! I’m thinking about getting some flat panels for some seasonal fun. Santa rolling by on a flat led panel would be awesome!

@digixx,

I just love projects like this that continue to blow themselves up in favor of even greater results.

Lighthouse! you gotta be kidding me, that is ridiculously cool!!!

inspiring

I might be missing something here, but did you need to use a logic-level shifter between your Core and/or Photon and the WS2812’s?

@johnventions, some people used a level shifter but I have not used one.

1 Like

Seems I can’t edit the original post any more - but today at 32c3 I met the creator and can now give him credit for the original torch: Thanks a lot for this great idea, Simon at gimp dot org!

1 Like

https://vine.co/v/5e3ADEM6Oie

This is a vine of mine in action. Thanks @luz

5 Likes

@Julian very nice, what display is this and where to get it ?
Rudy

Thank you very much. I made the display from laser cut mdf and strings of 50 ws2811 rgb bullet style LEDs. It is 20x20. I made a smaller one and then got a bit daft and made a big one😝

I was careful to power the strings at several places in the matrix so that the power is evenly distributed.

1 Like

This is amazing!! I’m not going to lie when I saw this the song all of the lights pop’d into my head :grin: