Okay I have it working now in ICD mode but not in real life I guess its a timing issue, how would I get into setup as soon as soon as the button is pressed and not having to wait until it is in the loop for setup mode.
Okay I have it working now in ICD mode but not in real life I guess its a timing issue, how would I get into setup as soon as soon as the button is pressed and not having to wait until it is in the loop for setup mode.
Use an interrupt. Or inside of every loop have a GOSUB to check the button.
Dave
Always wear safety glasses while programming.
To me a Timer interrupt is the most valuable and transparent solution.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Thanks for the help and I have tried mister_e's suggestion about interrupts
I have tried with the on interrupt with odd results
the program goes into setup mode with the lcd flickering i guess it is due to the
goto setsetpoint to refresh the lcd .
the problem is it will never leave the loop when i press save ( 1 for active 0 inactive)
I noticed by mistake the if i hold down save the program runs again as soon as i let go it stops, I want the save save to be pressed once and resume running the program.
I am guessing that I made an error in the code below but it compiles just fine.
Thanks in advance for any more help.
SetSetPoint:
DISABLE
LCDOut $FE,1, "Setpoint at", #SetPoint, "F"
if Incr = 1 then 'change the setpoint
pause 500
SetPoint=SetPoint+1
if Setpoint>80 then SetPoint=60 'Allow setpoint from 60 to 80
goto SetSetPoint 'refresh LCD with new setpoiont
endif
If Save = 0 then goto SetSetPoint
Resume
ENABLE
Try adding
beforeCode:IF Save = 1 then GOTO loop
Code:If Save = 0 then goto SetSetPoint
Dave
Always wear safety glasses while programming.
Thanks tried your suggestion but still not working.
When save = 1
I want it to exit the loop and resume running the program, am I missing something obvious, or not so obvious since I am new at this ???
Maybe it is a debounce problem. Add a "PAUSE" at the beginning of "loop".
Code:loop: PAUSE 250 'Give a little time to get off the button if Setup = 1 then
Dave
Always wear safety glasses while programming.
Bookmarks