Port indexing & PWM for LED fade


Results 1 to 10 of 10

Threaded View

  1. #2
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Port indexing & PWM for LED fade

    Looks good to me if the addressing works with PWM.
    What happens if you only try to PWM a single LED when you address it that way.. same thing?


    I've read about the trick to address pins, what if you knock them into a declared array first,
    and then aliased each one, I wonder what that would do.

    Code:
    pins[8] var byte
    portb.0 var pins[0]
    portb.1 var pins[1]
    portb.2 var pins[2]…
    
    
    Then cycle "pins" in the PWN command
    for selected = 0 to 7
    pins[selected] = value
    next selected
    Last edited by Art; - 1st December 2013 at 12:25.

Similar Threads

  1. Help with LED driver fade on/off
    By dfort in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 25th July 2009, 00:39
  2. PWM and fade effect
    By ruijc in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 10th July 2009, 10:58
  3. Port Indexing
    By Ioannis in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 25th September 2006, 12:33
  4. LED fade without PWM command
    By Nick in forum mel PIC BASIC
    Replies: 7
    Last Post: - 29th June 2005, 20:56
  5. Fade out an LED using PWM?
    By RossW in forum mel PIC BASIC Pro
    Replies: 27
    Last Post: - 6th August 2004, 19:59

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