Ok I programmed and there are a couple of issues.
There needs to be a time delay between each step up or down that the button is pressed. Right now, pressing either button and it is too fast to set a desired level. This delay cant be put into the loop though as the response of the regulator will be to slow.
Also it doesnt fully turn off and seems to settle at a very low duty cycle when it should be zero.
Code:
IF but_0 then
pause 75
eNDIF
if !but_0 then
if SETPOINT>0 then
SETPOINT=SETPOINT-1
endif
endif
IF but_1 then
PAUSE 75
ENDIF
if !but_1 then
if SETPOINT<19 then
SETPOINT=SETPOINT+1
endif
endif
This button code used before worked well.
Bookmarks