You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
shirriff edited this page May 6, 2011
·
1 revision
The following example shows how to use the IRremote library to send an IR code. This example (from Examples > IRremote > IRsendDemo) will send a Sony TV power code three times when anything is received via the serial port. An infrared LED must be connected to pin 3. If you point the LED at an appropriate Sony TV, the TV should turn on or off.
#include<IRremote.h>
IRsend irsend;
voidsetup()
{
Serial.begin(9600);
}
voidloop() {
if (Serial.read() != -1) {
for (int i = 0; i < 3; i++) {
irsend.sendSony(0xa90, 12); // Sony TV power codedelay(100);
}
}
}