Thread: Electronic/Software: Basic Stamp Versus Pickaxe
View Single Post

  #10 (permalink)  
Old 01-18-2009, 03:08 PM
bradbaum's Avatar
bradbaum bradbaum is online now
The Great Pumpkin
 
Join Date: Mar 2008
Location: Parker, CO
Posts: 439
Default

I recieved my PICAXE08M and built the attached ciruit around it.

It seems to work pretty well, and programming was pretty easy.

J3 is the trigger input, I designed it to work off of 12V instead of 5, to keep false triggers to a minimum, the only problem is that the transistor inverts the input so the program has to be written to activate with a low instead of a high.

R9 sets the delay from when the trigger is detected to when the prop fires.

R10 sets how long the prop stays on.

There are two outputs, output 0 turns on as soon as the trigger is detected and turns off when when the time set by R10 expires. The second output turns on after the delay time set by R9 has expired and then turns off when the time set by R10 expires.

My idea is that output 0 will turn on an MP3 player, while output 4 turns on the prop. I attempted to make this generic to allow it to be used on most of the props I build each year.

Here is the code that I put in the PICAXE08M:

#picaxe 08m
let dirs = %00010001 ' switch pin 0 and 4 to outputs
let pins = %00010001 ' switch on output 0 and 4

main:
readadc 1,b1 ' read value into b1
readadc 2,b2 ' read value into b2
if pin3 = 1 then gobaby ' wait for trigger
goto main ' cycle if no trigger

gobaby:
high 0 ' turn on output 0
let w1 = b1 * 35 ' calculate input delay time
pause w1 ' wait for input 1 delay time
high 4 ' prop on (output 4)
let w2 = b2 * 35 ' calculate prop on time
pause w2 ' wait for input 2 time on time
low 4 ' Turn off output 4
low 0 ' Turn off output 0
goto main ' return to waiting for trigger

This code is very similar to the code that the Prop-1 and Prop-2 use, so it was very easy to move from writing code for a Prop-1 to writing code for a PICAXE.

I am still unsure how much the controller will wind up costing, I will keep you guys updated.
Attached Images
File Type: jpg controller.jpg (81.0 KB, 19 views)
__________________
- Brad

---------------------------
Haunt at Red Clover
Parker, Colorado
Reply With Quote