mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-16 11:21:18 +03:00
RobotIRremote library to the new format
This commit is contained in:
23
libraries/RobotIRremote/src/IRremoteTools.cpp
Normal file
23
libraries/RobotIRremote/src/IRremoteTools.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
#include "IRremote.h"
|
||||
#include "IRremoteTools.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
int RECV_PIN = TKD2; // the pin the IR receiver is connected to
|
||||
IRrecv irrecv(RECV_PIN); // an instance of the IR receiver object
|
||||
decode_results results; // container for received IR codes
|
||||
|
||||
void beginIRremote(){
|
||||
irrecv.enableIRIn(); // Start the receiver
|
||||
}
|
||||
|
||||
bool IRrecived(){
|
||||
return irrecv.decode(&results);
|
||||
}
|
||||
|
||||
void resumeIRremote(){
|
||||
irrecv.resume(); // resume receiver
|
||||
}
|
||||
|
||||
unsigned long getIRresult(){
|
||||
return results.value;
|
||||
}
|
Reference in New Issue
Block a user