THANK YOU ALL !
Code:
@ DEVICE pic16F628A, INTRC_OSC, WDT_OFF, PWRT_OFF, BOD_OFF, MCLR_ON, LVP_OFF, CPD_OFF, PROTECT_OFF
Include "modedefs.bas" ' Serial Protocol
Define OSC 4 ' 4MHz
CMCON = 7 ' Disable on-chip comparator, PORTA in digital mode
'// Define port pins as inputs and outputs ...
TRISA = %00000111
PORTB=0
TRISB = 255 ' Disconnect all resistors from the circuit
include "c:\pbp\keypad2.pbp" ' see http://www.picbasic.co.uk/forum/showthread.php?t=3250
main:
gosub keypadscan
gosub check
goto main
check:
select case key
case 1 ; volume down
trisb.2=0
case 2 ; track -
trisb.3=0
case 3 ; volume up
trisb.4=0
case 4 ; mute
trisb.5=0
case 5 ; source
trisb.6=0
case 6 ; track +
trisb.7=0
end select
Pause 500 ' do it for 0.5 sec
TRISB = 255
Return
end 'of story !
Bookmarks