Leds on/off


Results 1 to 17 of 17

Thread: Leds on/off

Threaded View

  1. #12
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Hi, Sayzer

    I do not want to use sims ... lol

    BTW :


    ...

    IF PORTB.0=0 then
    HIGH PORTB.4
    WHILE PORTB.0=0 : Wend : pause 50
    ENDIF

    IF PORTB.0=0 then
    LOW PORTB.4
    WHILE PORTB.0=0 : Wend : pause 50
    ENDIF

    ...
    This kind of structure can't work properly ... as the second part never can be reached !!! ( or toggling button in less than 1µs ... )

    Button state AND its corresponding output state must be tested at the same time ... to take the appropriate action.

    Alain
    Last edited by Acetronics2; - 29th August 2009 at 11:09.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

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, 19:55
  2. Replies: 14
    Last Post: - 26th April 2007, 16:12
  3. Using LEDs as light sensors
    By skimask in forum Code Examples
    Replies: 3
    Last Post: - 30th December 2006, 23:19
  4. controlling leds with the switches
    By ilteris in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 12th October 2005, 22:02
  5. Replies: 5
    Last Post: - 16th February 2005, 12: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