Variable delay with variable resistor

Discussion in 'The Projects Forum' started by john121, Jun 4, 2012.

  1. john121

    Thread Starter New Member

    Jun 4, 2012
    1
    0
    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!!
     
  2. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,769
    969
    Hook the variable resistor to 5V..read the output with an ADC port. Use that value to create your delay.
     
  3. MrChips

    Moderator

    Oct 2, 2009
    12,429
    3,360
    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.
     
  4. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    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.
     
Loading...