In the meantime there is some progress:
This works, as long as I comment out these lines:Code:CMCON = 7 ' Digital mode DEFINE OSC 20 ' 20 MHZ OSC. TRISB= %00111111 ' PORTB 6/7=Output 0..5=Input Progstart: if (PORTB & 1) = 1 then Serout2 PORTB.7, 16384+12, [144, 44, 127] ' Rewind endif if (PORTB & 2) = 2 then Serout2 PORTB.7, 16384+12, [144, 46, 127] ' Fast Fwd. endif if (PORTB & 4) = 4 then Serout2 PORTB.7, 16384+12, [144, 48, 127] ' Stop endif if (PORTB & 8) = 8 then Serout2 PORTB.7, 16384+12, [144, 50, 127] ' Play endif if (PORTB & 16) = 16 then Serout2 PORTB.7, 16384+12, [144, 52, 127] ' Record endif Debounce: Pause 100 ' ? shorter ? If (PORTB.0=1) or (PORTB.1=1) or (PORTB.2=1) or (PORTB.3=1) or (PORTB.4=1) then goto Debounce ' Button still pressed? endif Goto Progstart
The idea is of course to prevent that the same data is sent multiple times, so I want to wait until a button is released.Code:' If (PORTB.0=1) or (PORTB.1=1) or (PORTB.2=1) or (PORTB.3=1) or (PORTB.4=1) then ' goto Debounce ' Button still pressed? ' endif
But the these lines seem to avoid that PORTB is read again.




Bookmarks