Need help with my Alarm project

hello,:(
i am trying to program my alarm so that it has an entry delay, so that before the actual program goes off full blast there is a chance for the theif to rethink. The attachment shows my idea, but it is obviosly wrong. Because the "wait" command is used inaccurately, i think. But I don't know any other commands that could do this. The way the circuit is meant to work is that if the push switch is held for 1 second, then the circuit goes off for 5 seconds, but if the push switch is held for 5 seconds then the circuit goes of for 20 seconds.

By the way,
g0= siren
g2= green LED
g3= trigger switch

problem:there is another LED but it doesnt show up in the options for the different pins, this other LED, the red LED, is connected to g1, but it doesnt show, any reasons why?:confused::mad:

The circuits a mess, but ive been playing with it for hours and still can't get this "entry delay" that I want, could you please tell me if there is a command to achieve this ? i am using a program called circuit wizard, it has quite a lot of commands, i dont think "wait" can be used to create the delay.?
thanks:cool:
 

Attachments

manie

Senior Member
Try a loop such as:

Code:
For b0 = 1 to 60
pause 1000
next b0
This will loop 60 times, each time it pauses for 1000 mS = 1 second. So this example will pause for 1 minute.
Manie
 

SilentScreamer

Senior Member
I think your problem is the 3 "G3 on?"s. It needs to all be put into the same loop (i think atleast, you may have to wait a while for replies as few people know flowcharts here).
 

Andrew Cowan

Senior Member
I don't understand the program - it seems to be random which column it goes down (depending on when it is chacking the input).

A
 

MPep

Senior Member
@Andrew,

I suspect that the G3 is sampled 3 times. In the first instance, G2 high is set.
The other 2 cases are in effect the same. The siren and the Green LED are switched on.
The only difference, from what I can see, is that the delay is changed from 5 to 20.

Sounds like multiple IF..THEN statements should be used.

@CnF:
Where exactly does G1 fit in. More info required. Purpose?

Please post a diagram of what you are trying to achieve.

MPep
 

SilentScreamer

Senior Member
I suspect that the G3 is sampled 3 times.
How? They either scroll through (skipping all of them). Or pick one at near enough to random. It looks to me like:

Code:
do
	if pin1=1 then Label_1
	if pin1=1 then Label_2
	if pin1=1 then Label_3
loop
 
G3 is sampled three times. When it is touched just a little bit, the green LED, G2 stays on until the whole circuit is reset, this is so that the user knows the alarm was disturbed.
Then, if G3 stays on for 3 seconds, (if the tilt switch is moved for 3 seconds) I want the buzzer and red LED to go on for 5 seconds. If G3 stays on for longer, 5 seconds, want the buzzer and red LED to go on for 20 seconds and then I want it to begin again at the green LED stage,
Please help, I looked but I don't think there is an IF...THEN statement in the flowchart version, there is only one word symbols like "wait" ... "pause" but none of them do what I want them to.. there is another option, callede "analogue" but since the push to make switch is not analogue I can't use it.
 

SilentScreamer

Senior Member
"if...then" is the same as a diamond shape in flowcharts (its the BASIC (code) equivalent).

I think what you actually want is something like I've attached (test it then say any issues that it has, I've only briefly looked at it).

It is only quickly made on paint but you should get the idea.
 

Attachments

Tricky Dicky

Senior Member
Chips

I think your problem is with the program you are using. The flowchart program in Circuit Wizard 1.5 is not designed to work with PICAXE it is only designed to work with NWC's own propriety range of chips which though similar to PICAXE have a different bootstrap program . If you want to use flowcharts use Logicator for PICs and PICAXE.

Richard
 

slimplynth

Senior Member
Language Chips! no-one else on here swears... did you reference this thread in your write up, seein as you practically did nothing but ask for help and show an unwillingness to learn?
 
Top