Hello,

it works all !
great and many thanks.

I made another "formule" in addition to yours (to work with 12 buttons and 4 channels__3 buttons on a wire)
It is perhaps not proper .
I add to this : PIC Simulator IDE 6.91 works great , all test with it and great.


. btn = ((DCD i) << (ADCChannel*3))^255
. if ADcchannel = 3 and btn = %11111111 then btn = (btn - (3*adcchannel)) << i
. gosub choose
..
..
ADCChannel = ADCChannel + 1 'Switch to the other ADC channel
if ADCchannel = 4 then adcchannel = 0
..
..
choose:
select case btn
' first bloc of 6 buttons
case %11111011 ' AN0-270 --- 47k and 5k = 4.6k
TRISB.0 = 0 ' 5k and 5k = 2.5k
TRISB.1 = 0
case %11111101 ' AN0-164 --- 47k and 10k = 8.2k
TRISB.1 = 0 ' 5k and 5k = 2.5k
TRISB.2 = 0 ' 47k and 47k = 22k
case %11111110 ' AN0-90 --- 47k and 22k = 15k
........


Regards
Hervé