Forum > Embedded - AVR

Example code for IR component.

(1/2) > >>

pascalbythree:
Hey, does somebody have freepascal example code for me to read the TSOP31136 IR component ? Greets, PascalByThree

ccrause:
I only have some C code to capture a bit stream from an IR remote (not worth sharing, there are many similar examples on the internet). There are several strategies for reading the pulse stream:

* use the input capture functionality (ICR) of a timer
* use a pin interrupt and read the timer when the interrupt fires
* read the pin state in a loop and log the duration of the high/low levelsThis bit stream with timings can be replayed if you simply want to clone the behaviour of the captured signal.  Further protocol identification and decoding is also possible, but involve a bit more work.

If you elaborate on your requirements perhaps more specific help can be given.

pascalbythree:
The arduino IDE seems to have plenty of options.


Does anybody got them in FPC ?

Otherwise it is not going to work out i am affraid.

Greets, Wouter

MarkMLl:
Use an Arduino, or something comparable, to convert the device's bitstream into a bytestream that you can read via USB.

There's quite simply too many layers of detail to make it feasible to do this directly with a PC, particularly now that microcontrollers and their support components are so cheap.

MarkMLl

ccrause:
The RCapture demo illustrates how to capture the demodulated signal from an infrared receiver.  The example only captures timing information of the marks and spaces, decoding this requires information of different protocols.  This is possible (there are existing Arduino examples), but the primary intent of this example is to illustrate how to capture the raw signal.

Navigation

[0] Message Index

[#] Next page

Go to full version