Hello,
I can't figure out how the FOR...NEXT count works.
First my code, then my question.
At the end of the FOR...NEXT execution, first read of Duty = 254. Right after the "NEXT" command, the second read of the variable Duty = 255.Code:... Duty VAR BYTE Duty = 0 if duty = 0 then FOR Duty = 0 TO 254 HPWM 1, Duty, 1000 lcdout Dec Duty 'First read of "Duty" PAUSE 5 NEXT lcdout Dec Duty 'Second read of "Duty" endif ...
Why is this!?
Bookmarks