Last active
November 19, 2019 09:18
-
-
Save kopp/d89d3a333440d111727387721f72c76b 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
#include <Arduino.h> | |
#include <IRremote.h> | |
// IR Receiver anschliessen: | |
// links (neben -): GND | |
// Mitte: 5V | |
// rechts (neben S): Signal (bspw an Pin 2) | |
const int irReceiverPin = 2; | |
IRrecv irrecv(irReceiverPin); | |
decode_results results; | |
void setup() | |
{ | |
Serial.begin(9600); | |
irrecv.enableIRIn(); | |
} | |
void loop() | |
{ | |
if (irrecv.decode(&results)) | |
{ | |
Serial.print("IR_Code: "); | |
Serial.print(results.value, HEX); | |
Serial.print(", Bits: "); | |
Serial.println(results.bits); | |
irrecv.resume(); | |
} | |
else { | |
Serial.println("did not receive anything..."); | |
} | |
delay(600); | |
} |
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
Wie kann man mit IRRemote und Arduino arbeiten? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment