Skip to content

Instantly share code, notes, and snippets.

@kopp
Last active November 19, 2019 09:18
Show Gist options
  • Save kopp/d89d3a333440d111727387721f72c76b to your computer and use it in GitHub Desktop.
Save kopp/d89d3a333440d111727387721f72c76b to your computer and use it in GitHub Desktop.
#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);
}
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