<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=390&d=1122866228">from what i understand...
Code:IF PORTB.0=0 then TOGGLE PORTB.1 WHILE PORTB.0=0 : Wend : pause 50 ENDIF
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=390&d=1122866228">from what i understand...
Code:IF PORTB.0=0 then TOGGLE PORTB.1 WHILE PORTB.0=0 : Wend : pause 50 ENDIF
Last edited by mister_e; - 1st July 2006 at 10:41.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
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.
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.
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
Originally Posted by mister_e
in a loop it have to work.Code:PORTB.1=~PORTB.0
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hello mister and,
Can give me an example about this please. PORTB.1=~PORTB.0
Thank you
Leonard
Originally Posted by mister_e
Bookmarks