lockman_akim
Advanced Member level 1
i give an example of my problem,
i try to make simple alarm.
i attach the vibrate sensor to pic..when sense vibrate, it will execute subroutine A but if i push button it will jump out from that subroutine A to subroutine B ..the problem is, it only read the "if" command at first it go in the subroutine A..so button will not function at all..
how can i solve this?
my program is in BASIC
alarm_on:
if portd.0 = 0 then
goto alarm_off
end if
portb.0 = 1
delayms 1000
portb.0 = 0
delayms 1000
portb.0 = 1
delayms 1000
portb.0 = 0
delayms 1000
portb.0 = 1
delayms 1000
portb.0 = 0
delayms 1000
goto start
i try to make simple alarm.
i attach the vibrate sensor to pic..when sense vibrate, it will execute subroutine A but if i push button it will jump out from that subroutine A to subroutine B ..the problem is, it only read the "if" command at first it go in the subroutine A..so button will not function at all..
how can i solve this?
my program is in BASIC
alarm_on:
if portd.0 = 0 then
goto alarm_off
end if
portb.0 = 1
delayms 1000
portb.0 = 0
delayms 1000
portb.0 = 1
delayms 1000
portb.0 = 0
delayms 1000
portb.0 = 1
delayms 1000
portb.0 = 0
delayms 1000
goto start