Here's a helpful library that allows one to add simple IR control to projects
The library implements the NEC IR protocol, so set up the universal remote for any NEC device (TV, DVD, VCR, ...) and the 32-bit codes should be received.
The example sketch provided just prints out IR codes as they're received, so it's good to run that sketch to see what codes the remote is sending, so they can later be used to trigger specific actions
Note that to get this library to work with Arduino 0012, at the top of your sketch (before including the library) you must clear the definition of the int() macro:
// This comment is line 1 of the program
int thisIsntUsedAtAll;
#undef int
...
#include
#define IRPIN 4
....
The problem seems to be the "function-like" casting macros recently added to wiring.h. The un-used integer (or any non-comment program statement) is required in order for the final C files to be concatenated together in the right order -- there's probably a more elegant way, but this is the first thing that worked for me.
Void your warranty, violate a user agreement, fry a circuit, blow a fuse, poke an eye out. Make: The risk-takers, the doers, the makers of things... Welcome to Make: Online!
More contributors: Mark Frauenfelder (Editor-in-Chief, MAKE magazine), Kipp Bradford (Technical Consultant/Writer), Chris Connors (Education), Diana Eng (Guest Author), Peter Horvath (Intern), Brian Jepson (O'Reilly Media), Robert Bruce Thompson (Science Room)
Behind the Scenes at MAKE and CRAFT
In January, many of the remote MAKE/CRAFT team members (myself included) convened at the Maker Media headquarters at O'Reilly Media in Sebastopol, California. Take a look behind the scenes of your favorite DIY publications as Goli Mohammadi gives us...
More...
Sign up for the Make: Newsletter
Our Make: Newsletter covers news from maker Media, has original columns, Shed deals, and more! You can also read the archives of past issues.
Note that to get this library to work with Arduino 0012, at the top of your sketch (before including the library) you must clear the definition of the int() macro:
// This comment is line 1 of the program
int thisIsntUsedAtAll;
#undef int
...
#include
#define IRPIN 4
....
The problem seems to be the "function-like" casting macros recently added to wiring.h. The un-used integer (or any non-comment program statement) is required in order for the final C files to be concatenated together in the right order -- there's probably a more elegant way, but this is the first thing that worked for me.
Thank you very much for the library.
Reply to this comment