Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 09:43 26 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Inkey$ in large loop

Author Message
pcaffalldavis

Senior Member

Joined: 17/10/2011
Location: United States
Posts: 187
Posted: 04:48am 27 Sep 2012
Copy link to clipboard 
Print this post

I have a large loop program to run my boiler. It is time to add menus and start adjusting variables without having to reboot.

The MM program monitors the boiler. When the firebox air intake is open for 15 min and the water temp does not go up it means the fire is out. If the fire is out the air intake closes and the combustion blower turns off. As long as the fire remains out (FIRE=0)the boiler won't try to reopen the air intake and start the blower to raise the water temperature regardless of how cold the water temperature gets.

I added a program line just before the end of the main loop: FIRE$=INKEY$, and the next line: IF FIRE$ <> "" THEN END

The program does not end when I press any key on the keyboard (except Control +C). It keeps going even when I hold down any key continuously for the whole loop.

First I tried using the Y key with IF FIRE$="y" OR FIRE$="Y" THEN FIRE=1. This would let the program know I built and am lighting a new fire, which is what I want to do without having to reboot. But, as I've noted, Inkey$ does not seem to be trapping my keyboard input.

Why is Inkey$ not trapping my keyboard input?

I'm running MM version 2.7B on this bench unit.Edited by pcaffalldavis 2012-09-28
We're all here 'cause we're not all there.
 
BobD

Guru

Joined: 07/12/2011
Location: Australia
Posts: 935
Posted: 07:56am 27 Sep 2012
Copy link to clipboard 
Print this post

You could try replacing THEN END with a GOTO line number and at that line number have an END command.
1000 FIRE$=INKEY$
1001 IF FIRE$ <> "" GOTO 9000



9000 END


 
pcaffalldavis

Senior Member

Joined: 17/10/2011
Location: United States
Posts: 187
Posted: 10:08am 27 Sep 2012
Copy link to clipboard 
Print this post

Okay, I had an snippet just before the LOOP command that pointed at the LOOP line number thereby skipping over the newly installed Inkey$ lines just before the LOOP line.

Problem solved.

Thank you!
We're all here 'cause we're not all there.
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024