I'm using this routine to switch ON the backlight of my LCD display, gradually but quite quickly (around 1 second). If I "PAUSE 500", it will takes ages to have the backlight fully on.
As stated in the MicroCode help file, the max "duty" value can be 255. If I want to have the backlight fully ON, I should have 255.
If the condition is "FOR Duty = 0 to 255", Duty will turn back to value 0 (zero) after the "NEXT" since it has been declared as a BYTE variable.
Maybe, the best thing to do is to declare Duty as WORD sized...
Nevertheless, the strange thing is that the Duty variable gets incremented by 1 when it exists the FOR...NEXT cycle.
Bookmarks