Created
July 5, 2019 16:41
-
-
Save luelista/8154670c253763a57d0b115b0c85e1a9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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