Infrared, once again...
CumQuaT
Posts: 156
Hello again! I've been playing around alot lately with infrared, and I've been trying to capture and play back the pulses used in various toy laser tag guns. (basically I'm trying to breadboard out a laser tag gun that can shoot the same IR frequency)
I've been toying around with the IR kit on the obex page as I know that the toy I'm trying to record uses a 38khz receiver, but with no success at all. It picks up the signal from the gun as far as I can tell, but I can't seem to get any code working to play it back... Basically I'm trying to get the data that I get from the receiver and turn it into code that I can use anywhere (to build, for example, a Laser Tag gun turret)
I'm sure there are people on here that have used the IR kit before. Has anyone been able to record something and turn it into code that will play it back on command... I'm still kinda new to the Propellor, so high-tech responses may be a bit over my head, sorry. You'll have to speak in layman's terms for me!!!
I'm used to working with PICs and such, so I'm familiar with coding... Just not with the prop...
Thanks in advance, people!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Who are you, and why are you reading my signature?
I've been toying around with the IR kit on the obex page as I know that the toy I'm trying to record uses a 38khz receiver, but with no success at all. It picks up the signal from the gun as far as I can tell, but I can't seem to get any code working to play it back... Basically I'm trying to get the data that I get from the receiver and turn it into code that I can use anywhere (to build, for example, a Laser Tag gun turret)
I'm sure there are people on here that have used the IR kit before. Has anyone been able to record something and turn it into code that will play it back on command... I'm still kinda new to the Propellor, so high-tech responses may be a bit over my head, sorry. You'll have to speak in layman's terms for me!!!
I'm used to working with PICs and such, so I'm familiar with coding... Just not with the prop...
Thanks in advance, people!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Who are you, and why are you reading my signature?
Comments
maybe it is easier to build it new from scratch.
To do this I would code a small testprogram that sends an easy bitpattern like 10011 0s and 1s coded the same way as in remote controls
make another testprg running independently in a second cog that does receive this bitpattern
i.e. measuring the high and low timings
store these values in an array
then play back the bitpattern by using the timing from the array
as a first step do it THIS way as in this way you have EVERYTHING under control
especially the sended bitpattern so you can easily check if
- your receiving code works right
- the receiver-hardware works right
- the calculation of the timing works right
- playback timining is right
this might look as a longer way to go
but on other ways as soon as a problem occurs with some "do it all at once with unkown bitstream-code"
it will take much more time to narrow down where the problem is
you can try a quick shot using the IR-Kit-code but as soon as the problem occurs switch over to understand everything from scratch
best regards
Stefan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Who are you, and why are you reading my signature?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Who are you, and why are you reading my signature?
to get detailed debug-information
best regards
Stefan
Hook an IR LED to an output pin.
Create a fast loop that simply tests the state of the input pin and pulses the out pin in exactly the same way.
Pointing the laser toy at the phototransistor should echo the same pattern to the IR LED on the out pin.
The IR LED should be able to activate the laser tag receiver now just as though it were the original device.
Even without mimicking the 38khz carrier perfectly this should work if you put the IR LED right on top
of the receiver (the filtering can't be so good that this much IR light won't overpower it)
Now you can just write a program to record the pattern and then send it out to a pin as 38khz modulated pulses.
I remember reading somewhere that an AVR was used to control VCR functions by sending IR pulse trains
to LEDs taped directly over the sensors. They did not modulate the carrier but it still worked, but only as far as
an inch or so from the sensors...no further.
Post Edited (HollyMinkowski) : 8/17/2009 8:47:26 AM GMT