Here's the basic principle of using the flag method:
Code:
UpButton VAR PortB.0   			' Active high button
DnButton VAR PortB.1   			' Active high button

Setting VAR BYTE
SettingChanged VAR BIT
DutyCycle VAR BYTE

Main:

  If UpButton THEN
    Setting = Setting + 1              ' Increment setting
    If Setting = 6 THEN Setting = 5    ' Make sure it doesn't go beyond 5
    SettingChanged = 1                 ' Set flag indicating new setting
  EndIf


  If DnButton THEN
    Setting = Setting - 1
    If Setting = 255 THEN Setting = 0  ' Make sure it doesn't go below 0
    SettingChanged = 1                 ' Set flag indicating new setting
  EndIf

  If SettingChanged THEN
    LOOKUP Setting, [12,23,34,45,56], DutyCycle
    SettingChanged = 0                 ' Clear flag
  EndIf


  
  ' Your regulator code here...
  ' Your regulator code here...
  ' Your regulator code here...

Goto Main
/Henrik.