John Sanderson wrote: > > Bonjour Gael & PIC.ers, > > I did this a while back. You might get some ideas from the code > below, this part of the project worked well. > .. > Pity about the rest of the job.... > .. Here is another easy way to do it : 1) Connect the pot from 5V to an input pin. 2) Connect a smallish cap (100nF) to the input pin. 3) Connect another pin (output) to the input pin via a resistor. In your program, count the number of 0V pulses you have to hit the output pin before the input pin becomes negative. -- Friendly Regards /"\ \ / Tjaart van der Walt X ASCII RIBBON CAMPAIGN mailto:tjaart@wasp.co.za / \ AGAINST HTML MAIL |--------------------------------------------------| | WASP International | |R&D Engineer : GSM peripheral services development| |--------------------------------------------------| |SMS mailto: tjaart@sms.wasp.co.za (160 chars max)| | http://www.wasp.co.za/~tjaart/index.html | |Voice: +27-(0)11-622-8686 Fax: +27-(0)11-622-8973| | WGS-84 : 26¡10.52'S 28¡06.19'E | |--------------------------------------------------|