Immemorial
New Member
Hello,
I'm relatively new to picaxe and came here to request some help. I'm using the chip factory software to create a double safety switch -A system where the user must press two buttons within a certain time limit (say 2 seconds) of each other. Pressing switch 1 should start the timer and light one of the LED's, failing to press switch 2 within the time limit should turn off the LED. Pressing switch 2 within the time limit will turn on another LED. Ideally the switches should be pressed together at the same time.
This is what I have came up with so far, like I said I'm just starting out and have very basic understanding of PIC.
I have exported the .chp file to basic below.
The part that I'm stuck with is adding a timer to the program in order to achieve the above, is this possible using chip factory via the software and the chip factory programmer? At this moment the program only turns on the LED's.
Any input is very much appreciated.
I'm relatively new to picaxe and came here to request some help. I'm using the chip factory software to create a double safety switch -A system where the user must press two buttons within a certain time limit (say 2 seconds) of each other. Pressing switch 1 should start the timer and light one of the LED's, failing to press switch 2 within the time limit should turn off the LED. Pressing switch 2 within the time limit will turn on another LED. Ideally the switches should be pressed together at the same time.
This is what I have came up with so far, like I said I'm just starting out and have very basic understanding of PIC.
I have exported the .chp file to basic below.
Code:
'Chip Factory BASIC Conversion
'(c) Revolution Education Ltd 2001
'www.rev-ed.co.uk
'BASIC program output is suitable for PICAXE system.
'(NB. All sound commands are mapped to output pin 6).
line00: if pin2 = 1 then line01
line01: if pin2 = 0 then line00
line02: if pin2 = 1 then line02A
goto line03
line02A: high 1
line03: if pin2 = 1 then line08
line04: if pin2 = 1 then
line05: if pin3 = 1 then line12
line08: if pin3 = 1 then line08A
goto line09
line08A: high 2
line09: if pin3 = 0 then line08
line10: if pin3 = 1 then line00
line12: if pin2 = 1 then line12A
goto line13
line12A: high 1
line13: if pin3 = 1 then line13A
goto line14
line13A: high 2
line14: goto line00
Any input is very much appreciated.