Skip to content

This is a wrapper on the IRremote library that enables a more natural way of setting up an IR remote and developing applications with it.

License

Notifications You must be signed in to change notification settings

nlamprian/IRRemoteControl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IRRemoteControl

This is a wrapper on the IRremote library that enables a more natural way of setting up an IR remote and developing applications with it.

If you wanna know more about IR, you can read Ken Shirriff's blog post about his IRremote library and/or the tutorial on IR Communication from Sparkfun.

project

The library has been set up for the IR Remote Control from Sparkfun, but it can easily support other remotes by updating the button, numButtons and address variables in the IRRemoteControl.h file. To find the commands sent by your remote, you will have to run either the IRrecvDump or IRrecord example from the IRremote library.

Interface

enable() // Starts the receiver
pair(button b, void (*func)()) // Pairs button b with function func
check() // Checks if data has been received, decodes them, and calls the appropriate function

So, all you have to do is define the functions (e.g. void upButton() {...}) you would like to be called with each button press, pair those functions (e.g. *.pair(UP, upButton)) with specific buttons, and you are good to go... every time you call check, your button press will be parsed and its paired function will be called.

Your functions must take no arguments and return void. If you need to manipulate variables in your code, you can use global variables, or static variables inside your functions.

Examples

The library has two accompanying examples.

  • One is the IRControlTest example and it's a dummy sketch to test that your system (Arduino-IR Receiver-IR Remote) is working properly.
  • The other is the IRLEDStrip example that implements a remote for controlling an LED Strip. For details on how the buttons function, read the comments in the code.

===

Thank you Ken Shirriff for an awesome library. You made the whole process of experimenting with IR really fun!

About

This is a wrapper on the IRremote library that enables a more natural way of setting up an IR remote and developing applications with it.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages