Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <IRLib.h>
- IRsend My_Sender;
- int khz=38; //NB Change this default value as neccessary to the correct modulation frequency
- int buttonPin = 4;
- int buttonState = 0;
- unsigned int Signal_0_0[] = {350, 350, 100, 350, 100, 650, 100, 300, 150, 300, 150, 800, 100, 350, 100, 300, 150, 300, 100, 350, 100, 650, 100, 500, 100, 650, 150, 450, 150, 450, 150, 800, 100, 350, 100, 23264, 350, 350, 100, 300, 150, 650, 100, 300, 150, 350, 50, 850, 100, 300, 150, 300, 100, 350, 100, 350, 100, 650, 100, 500, 100, 650, 100, 500, 150, 450, 150, 800, 100, 350, 100};
- void setup()
- {
- Serial.begin(115200);
- pinMode(buttonPin, INPUT);
- }
- //send a code every time a character is received from the serial port
- void loop() {
- buttonState = digitalRead(buttonPin);
- if (buttonState == HIGH) {
- Serial.println("Sending RAW code");
- My_Sender.IRsendRaw::send(Signal_0_0, sizeof(Signal_0_0)/sizeof(int), khz);
- delay(3000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement