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. ...@@ -19,7 +19,7 @@ Sie dient als erleichterte Bedienung der IRRemote.h Bibliothek.
## **Voraussetzung** ## **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** ## **Installation**
......
...@@ -6,7 +6,7 @@ uint8_t command; ...@@ -6,7 +6,7 @@ uint8_t command;
void setup(){ void setup(){
Serial.begin(115200); Serial.begin(115200);
ir_sensor.begin(); ir_sensor.begin(IR_PIN);
} }
void loop(){ void loop(){
...@@ -14,6 +14,7 @@ void loop(){ ...@@ -14,6 +14,7 @@ void loop(){
if (command != 0){ if (command != 0){
Serial.println(command); Serial.println(command);
} }
//ir_sensor.resume();
} }
...@@ -28,8 +28,10 @@ ...@@ -28,8 +28,10 @@
* 8 Button | 82 * * 8 Button | 82 *
* 9 Button | 74 * * 9 Button | 74 *
* ****************************************** */ * ****************************************** */
#define IR_USE_AVR_TIMER3
#include <IRremote.h> #include <IRremote.hpp> // include the library
//#define DECODE_NEC
class thk_IrController class thk_IrController
{ {
...@@ -38,9 +40,9 @@ public: ...@@ -38,9 +40,9 @@ public:
IRrecv ir_receiver(DATA_PIN); 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() int receive_command()
...@@ -49,11 +51,16 @@ public: ...@@ -49,11 +51,16 @@ public:
if (ir_receiver.decode()) if (ir_receiver.decode())
{ {
ir_command = ir_receiver.decodedIRData.command; ir_command = ir_receiver.decodedIRData.command;
//ir_command = ir_receiver.decodedIRData.decodedRawData;
ir_receiver.resume(); ir_receiver.resume();
} }
return ir_command; return ir_command;
}; };
void resume()
{
ir_receiver.resume();
};
private: private:
IRrecv ir_receiver; IRrecv ir_receiver;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment