Leds on/off


Results 1 to 17 of 17

Thread: Leds on/off

Threaded View

  1. #16
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Place a 330 ohms in series to each leds (as suggested in previuos post), and use Toggle command (as suggested in previuos post).

    Code:
    start:
    Pause 50
    IF PORTB.0=0 then
        Toggle PORTB.4       
        ENDIF
        
    IF PORTB.1=0 then
        Toggle PORTB.5     
        ENDIF
        
    IF PORTB.2=0 then
        Toggle PORTB.6     
         ENDIF
        
    IF PORTB.3=0 then
        Toggle PORTB.7    
         ENDIF
    
    HoldLoop:
    If PortB & %00001111 != 15 then HoldLoop
    
    goto start


    Al.
    Last edited by aratti; - 31st August 2009 at 12:25.
    All progress began with an idea

Similar Threads

  1. Run a string of LEDs from the mains
    By The Master in forum Off Topic
    Replies: 30
    Last Post: - 1st October 2009, 18:55
  2. Replies: 14
    Last Post: - 26th April 2007, 15:12
  3. Using LEDs as light sensors
    By skimask in forum Code Examples
    Replies: 3
    Last Post: - 30th December 2006, 22:19
  4. controlling leds with the switches
    By ilteris in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 12th October 2005, 21:02
  5. Replies: 5
    Last Post: - 16th February 2005, 11: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