Sony resting signal from remote
r2d2_bot
Posts: 23
·· I'm going through the text 'IR remote for the Bee-Bot' and copied the program on page 16 which will measure the resting states of the IR signal.· Problem is the program is not seeing any resting states!· I have the remote set up as a Sony, and the signals coming from it look good in the parallax usb oscilloscope.· The resting states are around 25ms in length.· But all I'm seeing with the program are the short high pulses; the program is totally missing the long resting pulse.
·· Has anyone else ran into this, or know what is going on?· Below is the program:
'{$STAMP BS2}
'{$PBASIC 2.5}
' IR Remote for the Boe-Bot - CountRestingStates.bs2
' Capture and count the number of 20 ms+ (high) resting states.
time····· VAR Word
counter·· VAR Word
DEBUG "RESTING STATE", CR,
"Repetitions Current Duration", CR,
" (microseconds) ", CR,
"
", CR
DO
· PULSIN 9, 1, time
· IF (time <> 0) THEN
··· DEBUG DEC time, CR
··· 'IF (time > 1000) THEN
··· '· counter = counter + 1
··· '· DEBUG CRSRXY, 0, 4, DEC counter, CRSRXY, 13, 4, DEC5 time * 2
··· 'ENDIF
· ENDIF
LOOP
Thanks!
[noparse][[/noparse]Tim]
·
·· Has anyone else ran into this, or know what is going on?· Below is the program:
'{$STAMP BS2}
'{$PBASIC 2.5}
' IR Remote for the Boe-Bot - CountRestingStates.bs2
' Capture and count the number of 20 ms+ (high) resting states.
time····· VAR Word
counter·· VAR Word
DEBUG "RESTING STATE", CR,
"Repetitions Current Duration", CR,
" (microseconds) ", CR,
"
", CR
DO
· PULSIN 9, 1, time
· IF (time <> 0) THEN
··· DEBUG DEC time, CR
··· 'IF (time > 1000) THEN
··· '· counter = counter + 1
··· '· DEBUG CRSRXY, 0, 4, DEC counter, CRSRXY, 13, 4, DEC5 time * 2
··· 'ENDIF
· ENDIF
LOOP
Thanks!
[noparse][[/noparse]Tim]
·
Comments
Unless you're using a different copy of the text you mentioned above, than the one presently on the Parallax web site, I really see little functional resemblance between your program, and that found in the text. Is this your own program modeled from the one in the text?
I suppose you may have been directed to change some parts of the program as a part of the exercises, but I don't see that either. Perhaps you could show us exactly where this program came from, or explain why it was modified from that found in the text on page 16.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Programming can't be all that difficult, it's nothing but 1's and 0's
Unless you're referring to the time between pulses as a 'resting state' -- which it isn't.
The BS2 is not good at measuring the width of BOTH the highpulse AND the low-pulse. If that's what you're trying to do.
·· You are right in that there are no resting states if you press a button once are release it quickly.· But if you hold a button down, the time from one message to the next is not zero.· There is a high pulse between messages which is around 25ms.· This is what I refer to as the resting pulse.· I've taken the programs from the text to see the start pulse, the low pulses for logic 1s and the low pulses for logic 0s.· This all works fine, but the program just won't see the resting pulse, even though I see it on the scope.
·· I'll try setting up a 555·as an·astable multivibrator and put some pulses in port 9 to try and figure out what is going on.
[noparse][[/noparse]Tim]
·· I'm using version 1.1 of the text.· page 16 has the program I posted.· I did make some modifications and commented out some code, but I did this to try and figure out what was going on.· When I ran the original program(un-modified) on page 16, it did not work either.
·· This is starting to drive me crazy!
[noparse][[/noparse]Tim]