Since the for-next loop counting from 0 to 255 and the HPWM is inside the loop, where is the problem? At the end HPWM will be at 100% (255), the for-next will wrap to 0 since you have byte variable ant the loop will exit.
Thats how a for-next works in the first place. Always exits when variable will pass the upper limit.
Did I miss anything?
Ioannis
Bookmarks