Haunted Pumpkin Workshop

Completed Circuit Board

Get introduced to the exciting world of electronics and embedded technology with a two hour workshop on building a Haunted Pumpkin.

You will:

When & How

We’ll meet via a private video link at 10am on Saturday, October 17. You’ll receive an email invitation with the proper link and calendar entry.

If that time doesn’t work for you, contact me via email to arrange an alternate time.

Before that date, you will receive a packet of electronics parts in the mail. Please be certain that your shipping information is accurate.

Materials

You will need to acquire some materials before the workshop begins.

You can also use the sides of a plastic milk jug as a difuser. Just cut out a slightly oversized shape, and use hot glue to cover the opening on the inside. The difusion won’t be as effective, but it will have a nice ominous depth to it.

Tools

Tools

Haunted Pumpkin Parts

The software running on the board.

void setup(void)
{
    pinMode(1, OUTPUT);
    randomSeed(analogRead(0));
}

void loop(void)
{
    for (int i = 0; i < 255; i++)
    {
        analogWrite(1, i);
        delay(10);
    }
    digitalWrite(1, HIGH);

    delay(random(5,60) * 1000);

    for (int i = 255; i > 0; i--)
    {
        analogWrite(1, i);
        delay(10);
    }
    digitalWrite(1, LOW);

    delay(random(20, 120) * 1000);
}

We also fooled around with learning how to code for our device. After three hours of fooling around, it looks like this:

bool is_light_on = false;

void setup(void)
{
    pinMode(1, OUTPUT);
    randomSeed(analogRead(0));
}

void fade_on() {
  fade_on_at_speed(10);
}

void fade_on_at_speed(int speed) {

    if (is_light_on) {
      return;
    }
  
    for (int i = 0; i < 255; i++)
    {
        analogWrite(1, i);
        delay(speed);
    }
    digitalWrite(1, HIGH);
    is_light_on = true;
}

void fade_off() {
  fade_off_at_speed(10);
}

void fade_off_at_speed(int speed) {

    if (is_light_on == false) {
      return;
    }
  
    for (int i = 255; i > 0; i--)
    {
        analogWrite(1, i);
        delay(speed);
    }
    digitalWrite(1, LOW);
    is_light_on = false;
}

void normal_blink(void) {
    fade_on();
    delay(random(30, 120) * 1000);

    fade_off();
    delay(random(5, 30) * 1000);
}

void wink(void) {
  fade_off_at_speed(1);
  delay(250);
  fade_on_at_speed(1);  
}

void two_blink(void) {
  fade_on();
  delay(10 * 1000);

  wink();
  delay(400);
  wink();
  
  delay(10 * 1000);
}

void loop(void)
{
  if (random(1,5) == 1) {
    two_blink();
  } else {
    normal_blink();
  }
}

Sign Up

Registration is currently closed.

Comments

comments powered by Disqus