On_Off


Closed Thread
Results 1 to 10 of 10

Thread: On_Off

Hybrid View

  1. #1
    Join Date
    Apr 2006
    Location
    Michigan
    Posts
    70


    Did you find this post helpful? Yes | No

    Default

    I didn't even realize that toggle command was in there. I that case I could change my code to:

    input portb.0

    start:
    If portb.0 = 1 then
    toggle portb.1
    pause 1000
    endif
    goto start

    I still think you need the pause of at least a second. Otherwise the light will pulse when you are holding the button. You need a delay to allow the user to remove there finger.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    both will work, mine just sit there until the button is release, then it allow a 50mSec of debouncing delay.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3


    Did you find this post helpful? Yes | No

    Talking on_off

    Hello friends,

    What I want is this:

    If RB0 is 0 RB1 is ON and IF RB0 is 1 RB0 is off , every time that presses the led it should change state.

    Thank you

    Quote Originally Posted by mister_e
    both will work, mine just sit there until the button is release, then it allow a 50mSec of debouncing delay.

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Code:
    PORTB.1=~PORTB.0
    in a loop it have to work.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5


    Did you find this post helpful? Yes | No

    Talking On_off

    Hello mister and,

    Can give me an example about this please. PORTB.1=~PORTB.0

    Thank you

    Leonard



    Quote Originally Posted by mister_e
    Code:
    PORTB.1=~PORTB.0
    in a loop it have to work.

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