mazoul72, I'm really new to picbasic, but I note in your schematic that you don't have pull-up resistor, so please try something like this:


Also, try to code something like the below example, if you rotate the bits of your ADC reading, you can leave only the 2 most significating bits, this way, you can know the exact button pressed (of course you must calculate correctly the resistors values):

DEFINE ADC_BITS 8
DEFINE ADC_CLOCK 3
DEFINE ADC_SAMPLEUS 50

ADVal var byte
Switch var byte

Principal:
adcin 3,adval
switch = (adval >> 6) 'Shift for 2 MSB for values 0 to 3 representing each button

SELECT CASE switch
CASE 0
'Put your code here
gpio=0
CASE 1
'Put your code here
high gpio.0
CASE 2
'Put your code here
high gpio.1
CASE 3
'Put your code here
high gpio.2
END SELECT

goto principal
end