How to blink 8 LEDs at different rates- concurrently?


Results 1 to 15 of 15

Threaded View

  1. #1
    Join Date
    May 2007
    Posts
    604

    Default How to blink 8 LEDs at different rates- concurrently?

    To do the equivalent of the code below with each LED blinking at a different rate - except that all 8 LEDs must blink concurrently.
    Code:
    PORTB = 0
    TRISB = 0
    
    MAIN:
    
    LOOP1:
      TOGGLE PORTB.0
      PAUSE 500
    GOTO LOOP1
    
    LOOP2:
      TOGGLE PORTB.1
      PAUSE 220
    GOTO LOOP2
    
    LOOP3:
      TOGGLE PORTB.2
      PAUSE 380
    GOTO LOOP1
    
    LOOP4:
      TOGGLE PORTB.3
      PAUSE 750
    GOTO LOOP4
    
    LOOP5:
      TOGGLE PORTB.4
      PAUSE 170
    GOTO LOOP5
    
    LOOP6:
      TOGGLE PORTB.5
      PAUSE 400
    GOTO LOOP6
    
    LOOP7:
      TOGGLE PORTB.6
      PAUSE 620
    GOTO LOOP7
    
    LOOP8:
      TOGGLE PORTB.7
      PAUSE 130
    GOTO LOOP8
    
    GOTO MAIN
    Last edited by rmteo; - 25th April 2010 at 16:10.

Members who have read this thread : 3

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