Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <IRremote.h>
- //Built on a teensy 4.1
- const int RECV_PIN = 3;
- const int led = 2;
- IRrecv irrecv(RECV_PIN);
- decode_results results;
- void setup(){
- Serial.begin(9600);
- irrecv.enableIRIn(); // Start the receiver
- irrecv.blink13(true);
- pinMode(led, OUTPUT);
- }
- void loop() {
- if (irrecv.decode(&results)) {
- Serial.println(results.value);
- if(results.value==4294967295){ //4294967295 is a return value, so any button press will trigger it.
- digitalWrite(led, HIGH); //Just flick the igniter.
- delay(3000);
- digitalWrite(led, LOW);
- }
- }
- irrecv.resume(); // Receive the next value
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement