ZappBots wishes a warm welcome to everyone.

Especially our visitors from
Savage///Circuits and Parallax!!!


Please take a look our new forums, we hope you register and become an active user.

The ZappBots forums are being run on phpBB 3.1.4 software which is different then the vBulletin used on the Savage///Circuits and Parallax forums.
Therefore, things look and work a little different, especially creating posts and uploading images / attachments.


The important thing is we have a place toTalk, Learn and Showcase our projects.

Maleficent Halloween Staff

The place for members to showcase their completed projects.
User avatar
Sparky
Member
Member
Posts: 17
Joined: Sat May 09, 2015 11:08 am
Contact:

Maleficent Halloween Staff

Postby Sparky » Mon Jun 01, 2015 2:44 pm

Originally posted on the Savage///Circuits Forums
October 28th, 2014, 03:48 PM
by electromanj


Hello.
A few weeks ago I started building a Maleficent staff for my granddaughter's Halloween costume.

Maleficent as she appears in Disney's Sleeping Beauty
Image

I started on it two Saturday mornings ago thinking that I would have plenty of time. Then I found out that they were going to "Boo at the Zoo" that evening.

Given the time crunch, and the size limitations I decided to use a PropStick USB. To allow me to retrieve the PropStick later I cut a piece of strip board and soldered a dip socket onto it, as well as a 9 volt battery clip and servo cable to connect to the led.

Image
Image
Image
Image

I've had some ws2812 led's for a while and thought it would be perfect for this project. The "orb" was a crystal clear plastic Christmas ornament from Hobby Lobby. I sanded the outside of it to diffuse the light. I then hot glued the ws2812 into the opening. I also hot glued the strip board to a piece of card board so it would fit tightly inside of the cardboard tube of the staff. One thing I had to watch was the colors on the servo cable. The way it fits onto the breakout board for the led, red is VSS and black is VDD.

I used JonnyMac's driver from the OBEX for the led. The first program I wrote for it set the color to green and faded it on and off slowly. My Step Daughter Hot Glued the cardboard tubes together and painted them. After she brought the staff over I put the electronics in the staff and she hot glued a bunch of feathers onto the staff. Got it done just in time and off they went to the Zoo.

Here is photo of the staff in action. My Step Daughter also made the costume from scratch!
Image

Done deal! Well not really. The beauty of programmable hardware is the ease of adding features, and I'm just not the type of guy to leave well enough alone... Yesterday I made a few changes.

I soldered on two more wires and a pull up resistor to the strip board. The new wires run to a snap action microswitch that is easy for tiny fingers to press. Then I added more routines to the program.

First press: Fading green
Second press: Constant green full brightness
Third press: Strobe Green
Forth press: Cycle through all colors with a fading effect. ( I didn't write that one. It was from the demo of the driver).
Fifth press: Loop through all routines with different timing to showcase all of the effects.
Sixth press: Turn off led, and wait for next press to start the cycle over again.

Image

Original Program:

Code: Select all

obj
  strip : "jm_ws2812"                                           ' WS2812 LED driver

var
  byte  index
 
pub main | pos
  strip.start_b(LEDS, STRIP_LEN)                                ' start led driver
  strip.off
  green_fader
Pub green_fader
index := 0
repeat
  repeat 255
    index++
    waitcnt(clkfreq/100+cnt)
    strip.set_green(0,index)
  repeat 255
    index--
    waitcnt(clkfreq/100+cnt)
    strip.set_green(0,index)


Latest Version:

Code: Select all

con
  _clkmode = xtal1 + pll16x                                     ' 16x required for WS2812                             
  _xinfreq = 5_000_000                                          ' use 5MHz crystal
  button_pin =  0     '11     
 
obj
  strip : "jm_ws2812"                                           ' WS2812 LED driver
var
  long stack[1000]    'An array of 1000 longs for the various cogs to use.
  byte  index
  byte button_index
  long current_cog
  long timer_cog
  byte time
pub main
  strip.start(24, 1)                               
  strip.off
  cognew (button_check,@stack[0])
Pub button_check
  dira[button_pin] := 0
  button_index := 0
  repeat
    repeat until ina[button_pin] == 0
    button_index ++
    waitcnt(clkfreq/2+cnt)
    if button_index == 1
      cognew(green_fader,@stack[100])
    if button_index == 2
      cogstop(current_cog)
      cognew(green_on_full_bright,@stack[200])
    if button_index == 3
      cogstop(current_cog)
      cognew(green_strobe,@stack[300])
    if button_index == 4
      cogstop(current_cog)
      cognew(rainbow(100),@stack[400])
    if button_index == 5
      strip.off
      cogstop(current_cog)
      cognew (medley,@stack[500])
    if button_index == 6
      cogstop(current_cog)
      cogstop(timer_cog)
      strip.off
      button_index := 0
     
Pub green_fader
current_cog := cogid
index := 0
repeat
  repeat 255
    index++
    waitcnt(clkfreq/100+cnt)
    strip.set_green(0,index)
  repeat 255
    index--
    waitcnt(clkfreq/100+cnt)
    strip.set_green(0,index) 
waitcnt(clkfreq/2+cnt)
Pub green_on_full_bright
current_cog := cogid
repeat
  strip.set_green(0,255)
  waitcnt(clkfreq+cnt)
waitcnt(clkfreq/2+cnt)
 
pub green_Strobe
current_cog := cogid
repeat
  strip.set_green(0,255)
  waitcnt(clkfreq/20+cnt)
  strip.set_green(0,0)
  waitcnt(clkfreq/20+cnt)
waitcnt(clkfreq/2+cnt)
 
pub rainbow(ms) | pos, ch
current_cog := cogid
repeat
  repeat pos from 0 to 255
    repeat ch from 0 to strip.num_pixels-1
      strip.set(ch, strip.wheel((pos + ch) & $FF))
    waitcnt(clkfreq/10+cnt)
pub medley
cognew(timer,@stack[600])
repeat
  time := 5
  cognew(green_on_full_bright,@stack[200])
  timer
  cognew(green_fader,@stack[100])
  time:=8
  timer
  cognew(green_strobe,@stack[300])
  time := 5
  timer
  cognew(rainbow(100),@stack[400])
  time := 25
  timer
  strip.off
 
pub timer
  timer_cog := cogid
  repeat time
    waitcnt(clkfreq+cnt)
  cogstop(current_cog)


Video:
https://youtu.be/zntqxBRP610

Schematic:
Image

User avatar
JDISME
Member
Member
Posts: 69
Joined: Thu May 21, 2015 1:02 am
Location: Billings, Montana
Contact:

Re: Maleficent Halloween Staff

Postby JDISME » Tue Jun 02, 2015 12:18 am

This is a very cool project. I am a big fan of the PropStick USB, I have used it for development a number of times. Have you since changed the design to use the regular DIP chips or kept with the PropStick?

Great job, I think electronics are a great way to give costumes a HUGE advantage of those store bought ones.
Joshua Donelson


Return to “Completed Projects”

Who is online

Users browsing this forum: No registered users and 2 guests