Hi,
Several ways to do it, as usual. Here's one:Another way would be to not step the Setting variable between 0 and 5 but to actually step it directly between dutycycle valuesCode:' Setting is your variable that step or down between 0-5 Lookup Setting, [12, 30, 55, 76, 98, 120], BaseDutyCycle/Henrik.Code:Select Case Step Case 12 IF DOWN THEN Setting = 12 ' We're at the bottom setting ELSE Setting = 30 Case 30 IF DOWN THEN Setting = 12 ELSE Setting = 55 ENDIF 'And so on END SELECT PWMDuty = Setting
Bookmarks