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

  #7 (permalink)  
Old 01-04-2009, 07:27 PM
bradbaum's Avatar
bradbaum bradbaum is online now
The Great Pumpkin
 
Join Date: Mar 2008
Location: Parker, CO
Posts: 439
Default

I ordered a PICAXE08M a few days ago to experiment with.

By the time you add the cost of the PCB, voltage regulator and other required parts you are at the cost of the Prop-1.

I downloaded the free software for the PICAXE and I do like it, the simulate mode is really cool, It allows you to turn the inputs on and off and set the analog input values then you can watch the program run and see if you have made any mistakes.

When the chip gets here, I'll prototype the circuit and see if everything works. Then I can run a total on the parts required for this type of prop controller.

My plan is to have two pots one set the entry delay time the other with set the on time for the prop. The other two pins, one will be the trigger input and the other will drive a relay to control the prop.

Here is the program:

#picaxe 08m
let dirs = %00010001 ' switch pin 4 to output
let pins = %00010001 ' switch on output4 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:
let w1 = b1 * 35 ' calculate input delay time
pause w1 ' wait for input 1 delay time
high 4 ' prop on
let w2 = b2 * 35 ' calculate prop on time
pause w2 ' wait for input 2 time on time
low 4 ' switch prop off
goto main ' return to waiting for trigger
__________________
- Brad

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