Pause problems
Sabai
Posts: 27
I have a problem that I do not know how to fix.
My program has a main routine and two Sub routine. The problem is that the sub routine need to stop for 2 minutes in order to do the task, opening a ventilation hatch.
My sub:
Alarm :
IF ((tc/10)<AlarmTmp) THEN
HIGH Closeled ' Close hatch
PAUSE Motortm ' Time to run motor
LOW Closeled ' Stop motor
ENDIF
The problem is that this sub is checking for user input, system set up.
In side Main:
GOSUB Get_165
IF switches.BIT7 = 1 THEN GOSUB menu
But is sub Alarm is pausing for 2 minutes when the user cannot enter the system menu by pressing the button they will need to wait two minutes.
My first ide was to change Alarm to:
Alarm :
IF ((tc/10)<AlarmTmp) THEN
DO WHILE cycleTm < motorTm
HIGH Closeled ' Close hatch
cycleTm = cycleTm + 1
GOSUB Get_165
IF switches.BIT7 = 1 THEN GOSUB menu
LOOP
LOW Closeled ' Stop motor
ENDIF
But for some strange reason did it not work! Can anybody clear this up for me?
B
My program has a main routine and two Sub routine. The problem is that the sub routine need to stop for 2 minutes in order to do the task, opening a ventilation hatch.
My sub:
Alarm :
IF ((tc/10)<AlarmTmp) THEN
HIGH Closeled ' Close hatch
PAUSE Motortm ' Time to run motor
LOW Closeled ' Stop motor
ENDIF
The problem is that this sub is checking for user input, system set up.
In side Main:
GOSUB Get_165
IF switches.BIT7 = 1 THEN GOSUB menu
But is sub Alarm is pausing for 2 minutes when the user cannot enter the system menu by pressing the button they will need to wait two minutes.
My first ide was to change Alarm to:
Alarm :
IF ((tc/10)<AlarmTmp) THEN
DO WHILE cycleTm < motorTm
HIGH Closeled ' Close hatch
cycleTm = cycleTm + 1
GOSUB Get_165
IF switches.BIT7 = 1 THEN GOSUB menu
LOOP
LOW Closeled ' Stop motor
ENDIF
But for some strange reason did it not work! Can anybody clear this up for me?
B
Comments
This might work better.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't worry. Be happy
Post Edited (dev/null) : 10/8/2009 6:10:30 AM GMT