mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-30 16:24:09 +03:00
Fixed robot libraries and examples for unified Arduino core
This commit is contained in:
28
libraries/RobotIRremote/examples/IRrecvDemo/IRrecvDemo.ino
Normal file
28
libraries/RobotIRremote/examples/IRrecvDemo/IRrecvDemo.ino
Normal file
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv
|
||||
* An IR detector/demodulator must be connected to the input RECV_PIN.
|
||||
* Version 0.1 July, 2009
|
||||
* Copyright 2009 Ken Shirriff
|
||||
* http://arcfn.com
|
||||
*/
|
||||
|
||||
#include <IRremote.h>
|
||||
|
||||
int RECV_PIN = 11;
|
||||
|
||||
IRrecv irrecv(RECV_PIN);
|
||||
|
||||
decode_results results;
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(9600);
|
||||
irrecv.enableIRIn(); // Start the receiver
|
||||
}
|
||||
|
||||
void loop() {
|
||||
if (irrecv.decode(&results)) {
|
||||
Serial.println(results.value, HEX);
|
||||
irrecv.resume(); // Receive the next value
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user