You are of course right, but I start the program with duty=500 and use only +/-50 steps, so this IF statement is correct in my case.
After some time I found the bug. At first I set all LCDSEn registers and it was a mistake since the LCD uses only few pins, so my button input pins were in segment functionality instead of I/O. Now I only set the segment pins that are actually used by LCD.





Bookmarks