Quote Originally Posted by Darrel Taylor View Post
OK, so let's go with Steve's idea and put it in EEPROM.

88 words.
Code:
supply_in  VAR BYTE
max_duty   VAR BYTE
ItemNo     VAR BYTE
Temp       VAR BYTE
'
supply_Max  DATA 252,250,248,245,240,237,234,231,229,226,223,220,218,215,212,210,207,204,201,199,196,193,187,0
Set_duty    DATA 154,155,156,157,159,160,161,163,165,167,169,172,175,179,181,182,184,188,191,195,214,238,251,255
'
FOR ItemNo = 0 TO (Set_duty - supply_Max)
    READ (supply_max + ItemNo), Temp
    IF supply_in > Temp THEN
        READ  (Set_duty + ItemNo), Temp
        max_duty = Temp
        EXIT
    ENDIF
NEXT ItemNo
I haven't tested it, but it looks right.
Check my work.
Option 2:
Could also shave it a lil more, but use a single and larger Lookup...

Code:
DATA @188, ....all duty result from 188........256 bytes available btw
.
.
.
.
if supply_in< 188   then 
    max_duty = 255
    else
         READ Supply_in, Max_duty
    endif
couldn't be more simple I guess

I know you love challenge Darrel :P