12F683 ADCIN - both channels the same


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    Ahh, I just knew it was going to be something simple.

    Thanks!

    Rich H

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Hi, Rich

    The way to give a decent name to ADC inputs ... :

    .
    .
    .
    GPIO = %00000000 ' All outputs = 0 on boot
    TRISIO = %00011111 ' GPIO.0,1,2,3,4 input, GPIO.5 output

    joyY CON 0 ' ADC pin number must be set as a CONstant ...
    joyX CON 1

    joyBtn var GPIO.2
    Sout var GPIO.5

    AD var byte
    X var byte

    .
    .
    .

    Main:

    adcin joyX, AD

    X = AD
    AD = 0

    pause 1

    adcin joyY, AD

    Y = AD

    .
    .
    .

    Alain
    Last edited by Acetronics2; - 7th January 2011 at 08:07.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts