switch ?


Closed Thread
Results 1 to 6 of 6

Thread: switch ?

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default Re: switch ?

    Problem #1: RA0 (and more pins) are anlog inputs by default at power-up, and all pins configured as analog inputs will read 0 when used for digital I/O.

    Solution = ANSEL0 = 0

    Problem #2: This can cause read-modify-write issues since you have all pin aliases pointing to port pins VS port LATches;

    Low led1
    Low led2
    Low led3
    Low led4
    Low led5
    Low led6
    Low led7
    Low led8
    Low led9
    Low led10
    Low led11
    Low led12

    Change your pin aliases to LAT like this and include the = sign;

    Symbol led1 = LATB.5 'OUT, etc.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  2. #2
    Join Date
    Jul 2011
    Posts
    29


    Did you find this post helpful? Yes | No

    Default Re: switch ?

    Thank you very much for your answer ! it works now !
    If I need help again about another thing should I start another thread ? (gonna need to change duty cycle of pwm with potentiometer)
    however, I do not want to be invasive.

  3. #3
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default Re: switch ?

    You're welcome. For your other question, just continue on in the previous thread you started here http://www.picbasic.co.uk/forum/showthread.php?t=15149

    This isn't exactly what you asked for, but here's a link to another thread for using the A/D on this PIC http://www.picbasic.co.uk/forum/showthread.php?t=6768
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

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