Request Urgent Help

mcknight87

New Member
Gday all,i got a problem for you guys and ur help will be greatly appreciated but it relates only to flow charts, not BASIC programming. Using a 18x picaxe chip btw.
input 0 potentiometer(smoke/heat detector)
input 1 LDR(light/dark detector)
input 2 opto-interrupter(infrared motion detector)
input 6 pushbutton switch(activates burglar/smoke alarm on/off)
output 0 green led
output 1 amber led
output 2 red led
output 3 solenoid(operates sprinkler system)
output 4 sound/buzzer(audible warning device)
output 6 motor forward(operates security grill)
output 7 motor reverse (same as above)


The general problem is this:
a security company is required to install a combined fire and burglar alarm in a small factory unit.
The alarm picaxe microcontroller needs to be programmed with the following features:
-activated by pushbutton
- only when smoke/heat is detected than
1. sound audible and light alarm
2. turn on sprinkler system
The burglar alarm has the following features:
-also operated by the same push button but only works during hours of darkness
-than when motion sensor detecs movement than:
1.sound audible and light alarm(diff. to fire alarm)
2. motor forward for 15 sec
3.pause 5 secs
4. motor reverse for 10 sec

There are a lot of flaws but my teacher isnt the smartest of tools :S but ignore the flaws and any help will b greatly appreciated.
Also if anyone has the knowledge to help me do loops as i am thinknig of incorporating loops into the system it will appreciated. Any help with be awesome.
Cheers
 

BeanieBots

Moderator
My thoughts too:rolleyes:
The "Urgent" part suggests maybe LATE homework.
Nobody is going to "do it for you" but we will help.

So mcknight87, which part are you struggling with?
Loops are simple enough. You enter a routine, your code does something, then you go back to the start of that routine again.

It is often useful to define a method of comming out of the loop or it could end up going around for ever. For example, a fixed number of times around the loop or jump out when some 'event' happens.
 

MartinM57

Moderator
The only question seems to be about how to do a loop in a flowchart (even though a specific PICAXE processor is mentioned) - to which the answer is usually an upwards control flow arrow to some previous point in the flow chart.

A few minutes googling for "burglar alarm flowchart" finds some potentially useful ideas on how to set about flowcharting a solution.

Hardware and software design of a real system to meet the stated requirements (and the many unstated requirements that would also need to be considered) is probably beyond 'urgent' help - it would be a significant piece of (home) work to do such a thing....
 

hippy

Ex-Staff (retired)
As BeanieBots and MartinM57 say, loops are simply program paths which go back to repeat something. In the following example the program loops until Pin3=1 ...
 

Attachments

Last edited:

hippy

Ex-Staff (retired)
Seems my black lines were transparent so while I could see them no one else can. I've re-uploaded the image. Thanks for spotting that.
 

mcknight87

New Member
mm

well i got everything done and sorted except loops
i no how to do a normal loop, but i need to no how to do a continous loop
once that used a counter, and it loops say a sub program 25x and then continues with the main program. thats what im having troubles with, i can do it on basic easy enuf just flowhcart is weird
 

hippy

Ex-Staff (retired)
This program loops ten times. On the first "Gosub", A=1, then A=2, and so on up to A=10, after that A increments to 11 and the loop no longer repeats. The "A=1" and "A=A+1" are using the "Express." flowchart blocks. The "A <= 10" decision is a "Compare" flowchart block.
 

Attachments

mcknight87

New Member
sweet thats awesome i get it now cheers :D
another quick questions
how do u create the little numbers in the circles with a dotted line. they kinda act like a "go to" thing, like for example, u finished a program in sub 1, and u use this "number in circle" to take the program into half way through ur main instead of saying "end" or attaching a line from sub 1 to the main program
 

Svejk

Senior Member
The alarm picaxe microcontroller needs to be programmed with the following features:
-activated by pushbutton
- only when smoke/heat is detected than
1. sound audible and light alarm
2. turn on sprinkler system
if you touch that make sure you comply with 4512
 

hippy

Ex-Staff (retired)
@ mcknight87 : I don't know if those 'goto circles and labels' are supported. You may have to draw all program flow lines explicitly, though I do not have a lot of experience with the flowcharting tools. Talking of which - my examples were for Logicator for PICAXE, but you may be using the Programming Editor flowchart tools.

@ Svejk : I think this is a proof of concept exercise for education, emulating the alarm rather than being installed as an active system.
 

slurp

Senior Member
how do u create the little numbers in the circles with a dotted line.
Are you talking about connecting points? (between draw lines and label on the flow chart button bar)

It helps with layout one to one links rather than subroutines for multiple use... for that you'd be better looking below the "sub" button.

regards,
Colin
 

Attachments

Top