Should be simple...but i'm new!
Posted: Mon Sep 10, 2012 9:41 pm
Hi,
I have been teaching myself electronics for a while now but have only recently started teaching myself about PIC and programming them, I have flowcode V5 and am so far able to do simple things like make outputs react with inputs.
So I thought id try make a simple program for the following application but I am having trouble.
Basically its a light controller with a pir sensor.
When the pir sensor is triggered it turns the light on.
There is a control panel that controls it all.
The control panel consists of 3 buttons each with a status led.
So my inputs are as follows:
Button one: Power, Nothing works without power being on - Connected to A0
Button two: Buzzer, If this is selected a buzzer sounds when the PIR is triggered - Connected to A1
Button three: Timer, If this is selected the light/buzzer only lights for 1minute. Also acts as a reset, when pressed turns off alarm light - Connected to A2
Alarm Input: Connected to A3
So my outputs are as follows:
LED one: Power LED, Indicates On/Off - Connected to B0
LED two: Buzzer LED, Lights if the buzzer will sound - Connected to B1
LED three: Timer LED, Lights if the light/buzzer will only sound for 1minute - Connected to B2
Alarm Light: Lights when power is on, and A3 is triggered - Connected to B3
Buzzer: Sounds when A0 in on, A1 is on and A3 is on.
I thought it should be quite easy. (If you actually understand what I want to accomplish)
But all I have managed to do is create the on / off section, anything inside of this decision doesn't seem to work.
Any suggestions on how you would do it?
I'll try and upload what I've achieved when I'm back on my windows machince
I have been teaching myself electronics for a while now but have only recently started teaching myself about PIC and programming them, I have flowcode V5 and am so far able to do simple things like make outputs react with inputs.
So I thought id try make a simple program for the following application but I am having trouble.
Basically its a light controller with a pir sensor.
When the pir sensor is triggered it turns the light on.
There is a control panel that controls it all.
The control panel consists of 3 buttons each with a status led.
So my inputs are as follows:
Button one: Power, Nothing works without power being on - Connected to A0
Button two: Buzzer, If this is selected a buzzer sounds when the PIR is triggered - Connected to A1
Button three: Timer, If this is selected the light/buzzer only lights for 1minute. Also acts as a reset, when pressed turns off alarm light - Connected to A2
Alarm Input: Connected to A3
So my outputs are as follows:
LED one: Power LED, Indicates On/Off - Connected to B0
LED two: Buzzer LED, Lights if the buzzer will sound - Connected to B1
LED three: Timer LED, Lights if the light/buzzer will only sound for 1minute - Connected to B2
Alarm Light: Lights when power is on, and A3 is triggered - Connected to B3
Buzzer: Sounds when A0 in on, A1 is on and A3 is on.
I thought it should be quite easy. (If you actually understand what I want to accomplish)
But all I have managed to do is create the on / off section, anything inside of this decision doesn't seem to work.
Any suggestions on how you would do it?
I'll try and upload what I've achieved when I'm back on my windows machince