Skip to content
Snippets Groups Projects
Commit cf9dd41a authored by selina_maria.wassermann1's avatar selina_maria.wassermann1
Browse files

Upgrade Wrapper to IRremote 4.2.0

parent c9619791
No related branches found
No related tags found
No related merge requests found
{
"configuration": "cpu=atmega2560",
"board": "arduino:avr:mega",
"port": "COM5",
"sketch": "examples\\IRReceiver\\IRReceiver.ino"
}
\ No newline at end of file
This diff is collapsed.
......@@ -19,7 +19,7 @@ Sie dient als erleichterte Bedienung der IRRemote.h Bibliothek.
## **Voraussetzung**
- [IRremote](https://github.com/Arduino-IRremote/Arduino-IRremote) by Armin Joachimsmeyer
- [IRremote](https://github.com/Arduino-IRremote/Arduino-IRremote) by Armin Joachimsmeyer (Version: 4.2.0)
## **Installation**
......
......@@ -6,7 +6,7 @@ uint8_t command;
void setup(){
Serial.begin(115200);
ir_sensor.begin();
ir_sensor.begin(IR_PIN);
}
void loop(){
......@@ -14,6 +14,7 @@ void loop(){
if (command != 0){
Serial.println(command);
}
//ir_sensor.resume();
}
......@@ -28,8 +28,10 @@
* 8 Button | 82 *
* 9 Button | 74 *
* ****************************************** */
#define IR_USE_AVR_TIMER3
#include <IRremote.h>
#include <IRremote.hpp> // include the library
//#define DECODE_NEC
class thk_IrController
{
......@@ -38,9 +40,9 @@ public:
IRrecv ir_receiver(DATA_PIN);
};
void begin()
void begin(const uint8_t DATA_PIN)
{
ir_receiver.enableIRIn();
ir_receiver.begin(DATA_PIN, DISABLE_LED_FEEDBACK);
};
int receive_command()
......@@ -49,11 +51,16 @@ public:
if (ir_receiver.decode())
{
ir_command = ir_receiver.decodedIRData.command;
//ir_command = ir_receiver.decodedIRData.decodedRawData;
ir_receiver.resume();
}
return ir_command;
};
void resume()
{
ir_receiver.resume();
};
private:
IRrecv ir_receiver;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment