Nothing abnormal ...
Hi,
I think you should wait for the button ( up or down ) to be released BEFORE jumping to "setfreq".
That implies The BUTTON command to be slightly modified for an auto-repeat feature ... AND also to increase the debugging time to, say, 100-250 ms ...
Also note you can simplify the output to PortA.0-3 ... as the 4 lower bits of "myfreq" are the same of your Output. ( just have to "catch" the invalid codes ...)
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks