Make Yours A Ghoulish Tech Pumpkin this Halloween… With Arduino!

 

Throw out those candles and opt instead for an Arduino sketch to light up those Pumpkins this year. With our simple sketch and the exclusive library it couldn’t be simpler to take your pumpkin to the next level! And remember, don’t throw out the flesh or seeds! We made a lovely pumpkin pie and two batches of roasted seeds (one sweet, one savoury). Yum! Take a look at the video from our youtube channel at the bottom of the page.

What You’ll Need

 

First you’ll want to carve out those pumpkins! Whether you do this with the kids, or on your own… it’s a huge amount of fun – although a little gooey! Poke a small hole in the back (bottom) of your pumpkin to push the wires through. Once carved and ready to light up it’s time to get your tech head on.

The connections for the wires are as follows:

 

That’s the hard part out of the way. Now download the exclusive library from our support forum here or from our github page here and be sure to place it in the correct folder.

On Windows:
My Documents\Arduino\libraries\

On Mac:
Documents/Arduino/libraries/
or similarly for Linux.

 

Use the sketch below to program the Arduino – It’s all commented up so you know which bits to change to alter the lights in different ways.

 

/* Include the HCWS2812 library */
#include "HCWS2812.h"

/* Create an instance of the library */
HCWS2812 HCWS2812;

void setup() 
{
  /* Set the R,G,B background colours to RED */ 
  HCWS2812.SetBG(150, 0, 0);
}

void loop() 
{

  /* Add a random level of green to each LED to make yellow */
  for(byte i = 0; i < 16; i++)
    RGBBuffer[GREEN][i] = random(0,150);
  
  /* Send the output buffer to the LEDs */
  HCWS2812.Refresh();

  /* Wait a moment before doing it again */
  delay(random(50,100));

  /* Clear the buffer to removed the green element */
  HCWS2812.ClearBuffer();

}

Voila! Ghoulish Tech Pumpkin!

2 thoughts on “Make Yours A Ghoulish Tech Pumpkin this Halloween… With Arduino!

Leave a Reply

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