Skip to content

Instantly share code, notes, and snippets.

@luelista
Created July 5, 2019 16:41
Show Gist options
  • Save luelista/8154670c253763a57d0b115b0c85e1a9 to your computer and use it in GitHub Desktop.
Save luelista/8154670c253763a57d0b115b0c85e1a9 to your computer and use it in GitHub Desktop.
// library: Infrared
// Sends Rc5 0/1 twice with different toggle values.
// Turns e.g. a Philips TV to channel 11.
#include <Rc5Renderer.h>
#include <IrSenderNonMod.h>
static IrSenderNonMod sender(3);
IrSignal *signal ;
void setup() {
//sender = IrSenderPwm::getInstance(true);
Serial.begin(9600);
}
void loop() {
//String a = Serial.readStringUntil('\n');
while (Serial.available() > 0) {
int number=Serial.parseInt();
if (Serial.read() == '\n') {
//int number = parseInt(a);
signal= Rc5Renderer::newIrSignal(16,number);
Serial.print("sending");
Serial.println(number);
sender.sendIrSignal(*signal);
sender.sendIrSignal(*signal);
sender.sendIrSignal(*signal);
sender.sendIrSignal(*signal);
delete signal;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment