Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
thk_ir_receiver
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
thk_libs
microcontrollers
thk_ir_receiver
Commits
c32234fd
Commit
c32234fd
authored
3 years ago
by
Severin Landwein
Browse files
Options
Downloads
Patches
Plain Diff
start refactor
parent
1fc2d1f9
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+4
-4
4 additions, 4 deletions
README.md
bits_ir_receiver.cpp
+19
-0
19 additions, 0 deletions
bits_ir_receiver.cpp
bits_ir_receiver.h
+5
-25
5 additions, 25 deletions
bits_ir_receiver.h
examples/IRReceiver/IRReceiver.ino
+2
-2
2 additions, 2 deletions
examples/IRReceiver/IRReceiver.ino
with
30 additions
and
31 deletions
README.md
+
4
−
4
View file @
c32234fd
...
@@ -27,19 +27,19 @@ Sie dient als erleichterte Bedienung der IRRemote.h Bibliothek.
...
@@ -27,19 +27,19 @@ Sie dient als erleichterte Bedienung der IRRemote.h Bibliothek.
## **Anwendung**
## **Anwendung**
Zur Verwendung siehe zunächst das Beispiel
`IRReciver.ino`
Zur Verwendung siehe zunächst das Beispiel
`IRRec
e
iver.ino`
**Einbinden der Bibliothek:**
**Einbinden der Bibliothek:**
`#include <
BITsIRR
eciver.h>`
`#include <
bits_ir_r
ec
e
iver.h>`
**Instanziieren:**
**Instanziieren:**
`BitsIrReciver ir_sensor(IR_PIN);`
`BitsIrRec
e
iver ir_sensor(IR_PIN);`
**Aufrufen der Methoden:**
**Aufrufen der Methoden:**
-
Um den IR-Empfänger zu initialisieren wird folgende Methode im
`void setup()`
ausgeführt:
`ir_sensor.begin()`
-
Um den IR-Empfänger zu initialisieren wird folgende Methode im
`void setup()`
ausgeführt:
`ir_sensor.begin()`
-
Für das Empfangen der Signale wird folgende Methode verwendet:
`ir_sensor.rec
i
eve_command()`
-
Für das Empfangen der Signale wird folgende Methode verwendet:
`ir_sensor.rece
i
ve_command()`
...
...
This diff is collapsed.
Click to expand it.
bits_ir_receiver.cpp
0 → 100644
+
19
−
0
View file @
c32234fd
#include
"bits_ir_receiver.h"
BitsIrReceiver
::
BitsIrReceiver
(
int
aPin
)
{
IRrecv
ir_reciver
(
aPin
);
}
void
BitsIrReceiver
::
begin
()
{
ir_receiver
.
enableIRIn
();
}
int
BitsIrReceiver
::
receive_command
()
{
uint8_t
ir_command
=
0
;
if
(
ir_receiver
.
decode
())
{
ir_command
=
ir_receiver
.
decodedIRData
.
command
;
ir_receiver
.
resume
();
}
return
ir_command
;
}
This diff is collapsed.
Click to expand it.
bits_ir_receiver.h
+
5
−
25
View file @
c32234fd
...
@@ -31,35 +31,15 @@
...
@@ -31,35 +31,15 @@
#define IR_USE_AVR_TIMER3
#define IR_USE_AVR_TIMER3
#include
<IRremote.h>
#include
<IRremote.h>
class
BitsIrReciver
class
BitsIrRec
e
iver
{
{
public:
public:
BitsIrReciver
(
int
aPin
){
BitsIrReceiver
(
uint8_t
aPin
);
IRrecv
ir_reciver
(
aPin
);
void
begin
();
};
uint8_t
receive_command
();
void
begin
()
{
ir_reciver
.
enableIRIn
();
};
int
recieve_command
()
{
if
(
ir_reciver
.
decode
())
{
ir_command
=
ir_reciver
.
decodedIRData
.
command
;
ir_reciver
.
resume
();
}
else
{
ir_command
=
0
;
}
return
ir_command
;
};
private:
private:
IRrecv
ir_reciver
;
IRrecv
ir_receiver
;
int
ir_command
;
};
};
#endif
#endif
\ No newline at end of file
This diff is collapsed.
Click to expand it.
examples/IRReciver/IRReciver.ino
→
examples/IRRec
e
iver/IRRec
e
iver.ino
+
2
−
2
View file @
c32234fd
#include
"bits_ir_receiver.h"
#include
"bits_ir_receiver.h"
#define IR_PIN 46
#define IR_PIN 46
BitsIrReciver
ir_sensor
(
IR_PIN
);
BitsIrRec
e
iver
ir_sensor
(
IR_PIN
);
int
command
;
int
command
;
void
setup
(){
void
setup
(){
...
@@ -10,7 +10,7 @@ void setup(){
...
@@ -10,7 +10,7 @@ void setup(){
}
}
void
loop
(){
void
loop
(){
command
=
ir_sensor
.
rec
i
eve_command
();
command
=
ir_sensor
.
rece
i
ve_command
();
if
(
command
!=
0
){
if
(
command
!=
0
){
Serial
.
println
(
command
);
Serial
.
println
(
command
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment