Variable delay with variable resistor

Thread Starter

john121

Joined Jun 4, 2012
1
Hi every body,I want to adjust the delay with a variable resistor used with PIC16F877A ,I use CCS C compiler dor codes editiing.
Can you please help me to generate the codes,see for example:


with a variable resistor of 47Kohm

As the value of resistor increases the delay(in ms) also increases;

Thanks!!
 

MrChips

Joined Oct 2, 2009
19,383
You could put the R in an RC circuit connected to an I/O pin.
Then use this to create an RC discharge to time your delay.
 

Ron H

Joined Apr 14, 2005
7,014
Hook the variable resistor to 5V..read the output with an ADC port. Use that value to create your delay.
To clarify a little:

Hook one end of the potentiometer to +5V and the other end to ground. Read the wiper with an ADC port. Use that value to create your delay.
 
Top