mirror of
https://github.com/Theaninova/Arduino-IRremote.git
synced 2026-01-08 14:12:50 +00:00
Added ESP32 IR receive support (IRsend not implemented yet).
- disable a lot of defines not relevant to ESP32, set them to 1 (no-op) - change default IR pin to 35 from 11 - changed serial speed to 115200 (9600 is too slow to keep up with IR input) - irSend disables code that will not compile on ESP32. It won't work, but it won't break compilation either.
This commit is contained in:
@@ -8,7 +8,11 @@
|
||||
|
||||
#include <IRremote.h>
|
||||
|
||||
#ifdef ESP32
|
||||
int RECV_PIN = 35;
|
||||
#else
|
||||
int RECV_PIN = 11;
|
||||
#endif
|
||||
|
||||
IRrecv irrecv(RECV_PIN);
|
||||
|
||||
@@ -16,8 +20,10 @@ decode_results results;
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(9600);
|
||||
Serial.begin(115200);
|
||||
Serial.println("Enabling IRin");
|
||||
irrecv.enableIRIn(); // Start the receiver
|
||||
Serial.println("Enabled IRin");
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
@@ -15,7 +15,11 @@
|
||||
* You can change this to another available Arduino Pin.
|
||||
* Your IR receiver should be connected to the pin defined here
|
||||
*/
|
||||
int RECV_PIN = 11;
|
||||
#ifdef ESP32
|
||||
int RECV_PIN = 35;
|
||||
#else
|
||||
int RECV_PIN = 11;
|
||||
#endif
|
||||
|
||||
IRrecv irrecv(RECV_PIN);
|
||||
|
||||
@@ -23,7 +27,7 @@ decode_results results;
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(9600);
|
||||
Serial.begin(115200);
|
||||
irrecv.enableIRIn(); // Start the receiver
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Tell IRremote which Arduino pin is connected to the IR Receiver (TSOP4838)
|
||||
//
|
||||
int recvPin = 11;
|
||||
int recvPin = 35;
|
||||
IRrecv irrecv(recvPin);
|
||||
|
||||
//+=============================================================================
|
||||
@@ -14,7 +14,7 @@ IRrecv irrecv(recvPin);
|
||||
//
|
||||
void setup ( )
|
||||
{
|
||||
Serial.begin(9600); // Status message will be sent to PC at 9600 baud
|
||||
Serial.begin(115200); // Status message will be sent to PC at 9600 baud
|
||||
irrecv.enableIRIn(); // Start the receiver
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user