IR Remote Controller
This documentation includes installation guidelines and sample code for your hardware.
Windows 10 IoT Core Library
IRRemoteController library is responsible for sending and receiving IR remote commands.
To use the library, add the following using statement to the top of your C# code.
Then, create an instance of the IRRemoteController class.
Now you're ready to access the library by calling the irRemoteController instance.
Initialization
IRRemoteController
Initiates the IR remote transreceiver function to send and receive commands in NEC protocol.
Parameters
Bool enableReception: Turns IR receiver on or off.
Basic Members
Send 4 Byte
Transmits 4 Bytes of command using the NEC protocol.
Parameters
Byte[] cmd: 4 Bytes of HEX code array.
Returns
None
Read Last Command Received
Reads the last IR command decoded.
Parameters
None
Returns
Byte[]: 4 Bytes long remote code.
Advanced Members
Set IR Reception
Enables or disables onboard IR decoder.
Parameters
Bool enabled: True for enabling IR decoding. False for disabling IR decoding.
Returns
None
Interrupts
IR Remote Data Received
Notifies on digital pin input change.
Event Args
byte[] remoteData: 4 Bytes long remote code.
Disposal
To clean up the resources used by the class, call the Dispose() method it when the application is closing.
This method stops the onboard IR decoder and cleans the resources used by the class.
Samples
You can copy the example codes from https://github.com/Turta-io/IoTHAT/tree/master/Samples/Windows10IoTCore address. There are two examples of this library.
IR Remote Receiver Sample App
This application demonstrates receiving IR remote data from the onboard controller.
To run the example:
Open the sample project you downloaded.
Make sure "ARM" is selected from the solution platforms selection.
Deploy the sample to the Raspberry Pi using the "F5" key.
Sample Code
Result
When you run the sample, it starts waiting for an IR remote data. If the onboard controller decodes an NEC protocol IR message, it generates an interrupt. The application reads the decoded data, and then prints to the Visual Studio Output / Immediate Window.
To stop the application, use the "Stop" button on the Visual Studio.
IR Remote Transmitter Sample App
This application demonstrates sending IR remote data with the onboard controller.
To run the example:
Open the sample project you downloaded.
Make sure "ARM" is selected from the solution platforms selection.
Deploy the sample to the Raspberry Pi using the "F5" key.
Sample Code
Result
When you run the sample, it starts sending 4 bytes IR data to the onboard controller. The controller then encodes the signal to NEC protocol format and sends out.
To stop the application, use the "Stop" button on the Visual Studio.
Last updated