IR/Universal Remote
Rsadeika
Posts: 3,837
I think that I am getting some bad data from the following program. I am trying to figure out·if it is the programs fault or their is a bad Parallax IR detector. The following is a slightly modified program:
' {$STAMP BS2}
' {$PBASIC 2.5}
·IrDet PIN 9
·remoteCode VAR Byte
·IrPulse VAR Word
·Main1:
·· GOSUB GetCode
·· IF (remoteCode > 0) THEN GOSUB ProcessCode
·GOTO Main1
END
·ProcessCode:
·· DEBUG CLS, DEC remoteCode
·RETURN
·GetCode:
· remoteCode = 0
·· DO
··· RCTIME 9, 1, irPulse
·· LOOP UNTIL irPulse > 1000
·· PULSIN 9, 0, irPulse
·· IF irPulse > 500 THEN remoteCode.BIT0 = 1
·· RCTIME 9, 0, irPulse
·· IF irPulse > 300 THEN remoteCode.BIT1 = 1
·· RCTIME 9, 0, irPulse
·· IF irPulse > 300 THEN remoteCode.BIT2 = 1
·· RCTIME 9, 0, irPulse
·· IF irPulse > 300 THEN remoteCode.BIT3 = 1
·· RCTIME 9, 0, irPulse
·· IF irPulse > 300 THEN remoteCode.BIT4 = 1
·· RCTIME 9, 0, irPulse
·· IF irPulse > 300 THEN remoteCode.BIT5 = 1
·· RCTIME 9, 0, irPulse
·· IF irPulse > 300 THEN remoteCode.BIT6 = 1
·· IF (remoteCode < 10) THEN remoteCode = remoteCode + 1
·· IF (remoteCode = 10) THEN remoteCode = 0
·RETURN
The wiring is setup from the example in the Inrared Remote AppKit (#29122) docs.
The problem is when I press the ChUp button I am expecting 16, I am getting something like 63 or 127 depending on how long I hold the button down. The other buttons, when pressed, show non-expectant numbers. Do I have a bad or fried detector, or what.
Thanks
' {$STAMP BS2}
' {$PBASIC 2.5}
·IrDet PIN 9
·remoteCode VAR Byte
·IrPulse VAR Word
·Main1:
·· GOSUB GetCode
·· IF (remoteCode > 0) THEN GOSUB ProcessCode
·GOTO Main1
END
·ProcessCode:
·· DEBUG CLS, DEC remoteCode
·RETURN
·GetCode:
· remoteCode = 0
·· DO
··· RCTIME 9, 1, irPulse
·· LOOP UNTIL irPulse > 1000
·· PULSIN 9, 0, irPulse
·· IF irPulse > 500 THEN remoteCode.BIT0 = 1
·· RCTIME 9, 0, irPulse
·· IF irPulse > 300 THEN remoteCode.BIT1 = 1
·· RCTIME 9, 0, irPulse
·· IF irPulse > 300 THEN remoteCode.BIT2 = 1
·· RCTIME 9, 0, irPulse
·· IF irPulse > 300 THEN remoteCode.BIT3 = 1
·· RCTIME 9, 0, irPulse
·· IF irPulse > 300 THEN remoteCode.BIT4 = 1
·· RCTIME 9, 0, irPulse
·· IF irPulse > 300 THEN remoteCode.BIT5 = 1
·· RCTIME 9, 0, irPulse
·· IF irPulse > 300 THEN remoteCode.BIT6 = 1
·· IF (remoteCode < 10) THEN remoteCode = remoteCode + 1
·· IF (remoteCode = 10) THEN remoteCode = 0
·RETURN
The wiring is setup from the example in the Inrared Remote AppKit (#29122) docs.
The problem is when I press the ChUp button I am expecting 16, I am getting something like 63 or 127 depending on how long I hold the button down. The other buttons, when pressed, show non-expectant numbers. Do I have a bad or fried detector, or what.
Thanks
Comments
··· http://www.parallax.com/dl/docs/cols/nv/vol3/col/nv76.pdf
And one of our staff engineers, Andy Lindsay, has written an excellent book on IR projects with the Boe-Bot:
··· http://www.parallax.com/detail.asp?product_id=28139
The book may be helpful because the standard processor for the Boe-Bot is the stock BS2.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
The program is a slightly modified IrRemoteCodeCapture.bs2 program that is listed in the Infrared Remote AppKit (#29122) documentation. I guess maybe my question is, how do·I know if I fried an IR detector. The IR detector is a three legged Parallax brand.
Thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
The program works as expected, the IR detector is fine, the problem is with the remote. I remember when Sony used to make some good products. I can't believe that only after a year my 3 function Universal Remote has gone bad, it's not like the thing was used everyday.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Do you have a Stamp Tester yet?
http://hometown.aol.com/newzed/index.html
·
RM-V301.· This is an excellent remote, and I do not remember any of the buttons having the same number.· This is the remote I used with my train, and I am presently using it on my BoeBot.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Do you have a Stamp Tester yet?
http://hometown.aol.com/newzed/index.html
·
I am using the 3 Function Universal Remote that I purchased through Parallax. For some reason I thought that it was a Sony. Thanks for the tip, but for what I am going to be using it for, I need a cheap unit.
Maybe I should start a new thread in the sandbox as to what to expect if I open the unit for inspection.
Sid
This is very embarrasing, when you read the instructions correctly then things seem to work as advertised. It was that pesky little wait till the LED stays solid red, then enter the code, that was my problem.
Thanks everybody