inputs are 0 all the time!


Closed Thread
Results 1 to 2 of 2
  1. #1
    scorpion's Avatar
    scorpion Guest

    Post inputs are 0 all the time!

    Hi all. I really hope that someone can help me with this one!
    my pic (16f72) is always seeing 0 on the inputs. I had a big elaborate program written(well for me anyways) but I am only using one input right now to test...... anyways here is my test code:

    enone var porta.0
    lightone var portb.2
    led var portc.0

    adcon0 = 0

    i var word
    i = 0
    trisa = 255

    main:
    i = i + 1
    if i = 2000 then
    toggle led
    i = 0
    endif

    if enone = 0 then high lightone
    if enone = 1 then low lightone
    goto main


    the light is always on now. and if i switch the 0 and 1 its always off.
    I also had a loop in there before if there was a 0 on that pin and it kept getting stuck in that loop. so i know it thinks there is a 0 on the input pins.
    oh yea and i measured the pin so i know the 5v is there
    thanks for any help you can give
    -Scorp

  2. #2
    scorpion's Avatar
    scorpion Guest


    Did you find this post helpful? Yes | No

    Default Duh?!?!?!

    never mind
    adcon1 = 7
    i think ill stop posting here haha
    -Scorp

Similar Threads

  1. I don't understand this code!
    By Russ Kincaid in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 13th February 2008, 02:55
  2. Serout2/serin2 Pbp Problem
    By SOMRU in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th December 2006, 19:55
  3. 2 Serial inputs at the same time?
    By a_critchlow in forum Serial
    Replies: 3
    Last Post: - 29th January 2006, 14:07
  4. Timer in real time
    By martarse in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 29th July 2005, 14:24
  5. RX two serial inputs at the same time?
    By tcbcats in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 31st October 2004, 10:57

Members who have read this thread : 0

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

Posting Permissions

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