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
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
479dc482
Commit
479dc482
authored
3 years ago
by
Orhan-Timo Altan
Browse files
Options
Downloads
Patches
Plain Diff
an die Konventionen angepasst
parent
9890296f
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
BITsIRReciver.h
+50
-58
50 additions, 58 deletions
BITsIRReciver.h
README.md
+42
-0
42 additions, 0 deletions
README.md
customized_library.zip
+0
-0
0 additions, 0 deletions
customized_library.zip
examples/IRReciver/IRReciver.ino
+5
-5
5 additions, 5 deletions
examples/IRReciver/IRReciver.ino
with
97 additions
and
63 deletions
BITsIRReciver.h
+
50
−
58
View file @
479dc482
#ifndef BITSI
I
RRECIVER_H
#ifndef BITSIRRECIVER_H
#define BITSI
I
RRECIVER_H
#define BITSIRRECIVER_H
/* ******************************************
***********
*
/* ****************************************** *
* IR Remote *
* IR Remote *
* *
* *
* Button | Signal Kodierung | Index *
* Button | Signal Kodierung *
* ----------------------------------------------------- *
* ------------------------------------------ *
* Power Button | 69 | 0 *
* Power Button | 69 *
* VOL+ Button | 70 | 1 *
* VOL+ Button | 70 *
* Func Button | 71 | 2 *
* Func Button | 71 *
* Rewind Button | 68 | 3 *
* Rewind Button | 68 *
* Play/Pause Button | 64 | 4 *
* Play/Pause Button | 64 *
* Forward Button | 67 | 5 *
* Forward Button | 67 *
* Down Button | 7 | 6 *
* Down Button | 7 *
* VOL- Button | 21 | 7 *
* VOL- Button | 21 *
* UP Button | 9 | 8 *
* UP Button | 9 *
* 0 Button | 22 | 9 *
* 0 Button | 22 *
* EQ Button | 25 | 10 *
* EQ Button | 25 *
* ST/REPT Button | 13 | 11 *
* ST/REPT Button | 13 *
* 1 Button | 12 | 12 *
* 1 Button | 12 *
* 2 Button | 24 | 13 *
* 2 Button | 24 *
* 3 Button | 94 | 14 *
* 3 Button | 94 *
* 4 Button | 8 | 15 *
* 4 Button | 8 *
* 5 Button | 28 | 16 *
* 5 Button | 28 *
* 6 Button | 90 | 17 *
* 6 Button | 90 *
* 7 Button | 66 | 18 *
* 7 Button | 66 *
* 8 Button | 82 | 19 *
* 8 Button | 82 *
* 9 Button | 74 | 20 *
* 9 Button | 74 *
* ***************************************************** */
* ****************************************** */
#include
<IRremote.h>
#include
<IRremote.h>
// #define IR_USE_AVR_TIMER3
const
int
IR_PIN
=
46
;
const
int
irReceiverPin
=
46
;
IRrecv
ir_reciver
(
IR_PIN
);
IRrecv
irrecv
(
irReceiverPin
);
decode_results
results
;
decode_results
results
;
// Liste von oben nach unten sortiert
class
BitsIrReciver
int
commandlist
[
22
]
=
{
0
,
69
,
70
,
71
,
68
,
64
,
67
,
7
,
21
,
9
,
22
,
25
,
13
,
12
,
24
,
94
,
8
,
28
,
90
,
66
,
82
,
74
};
{
class
BITsIRReciver
{
public:
public:
void
init
(){
void
begin
()
irrecv
.
enableIRIn
();
{
ir_reciver
.
enableIRIn
();
};
};
int
ir_recv
(){
int
recieve_command
()
//if the ir receiver module receiver data
if
(
irrecv
.
decode
())
{
{
ir_command
=
irrecv
.
decodedIRData
.
command
;
if
(
ir_reciver
.
decode
())
// Receive the next value
{
irrecv
.
resume
();
ir_command
=
ir_reciver
.
decodedIRData
.
command
;
for
(
int
i
=
0
;
i
<
22
;
i
++
)
{
ir_reciver
.
resume
();
if
(
ir_command
==
commandlist
[
i
])
{
return
ir_command
;
ir_command_pos
=
i
;
break
;
}
}
return
ir_command_pos
;
}
}
};
};
private
:
private
:
int
ir_command
;
int
ir_command
;
int
ir_command_pos
;
};
};
#endif
#endif
\ No newline at end of file
This diff is collapsed.
Click to expand it.
README.md
+
42
−
0
View file @
479dc482
# **BITs IR Empfänger**
# **BITs IR Empfänger**
Mit dieser Klasse werden die Empfangenen Befehle von einer Infrarot Fernbedienung zurück gegeben.
Sie dient als erleichterte Bedienung der IRRemote.h Bibliothek.
|
**Button**
|
**Signal Kodierung**
| |
**Button**
|
**Signal Kodierung**
|
|:---|:---:|:---|:---:|:---:|
|Power Button | 69 | | 0 Button | 22 |
|VOL+ Button | 70 | |1 Button | 12 |
|Func Button | 71 | |2 Button | 24 |
|Rewind Button | 68 | |3 Button | 94 |
|Play/Pause Button | 64 | |4 Button | 8 |
|Forward Button | 67 | |5 Button | 28 |
|Down Button | 7 | |6 Button | 90 |
|VOL- Button | 21 | |7 Button | 66 |
|UP Button | 9 | |8 Button | 82 |
|EQ Button | 25 | |9 Button | 74 |
|ST/REPT Button | 13 | | | |
## **Voraussetzung**
-
Die angepasste IRRemote Bibliothek in der
**customized_library.zip**
muss in das Libraries-Verzeichnis der Arduino-IDE kopiert werden.
## ** Installation**
-
Um diese Klasse verwenden zu können, muss dieses Repository geklont und in das Libraries-Verzeichnis der Arduino-IDE kopiert werden.
## **Anwendung**
Zur Verwendung siehe zunächst das Beispiel
`IRReciver.ino`
**Einbinden der Bibliothek:**
`#include <BITsIRReciver.h>`
**Instanziieren:**
`BitsIrReciver ir_sensor;`
**Aufruden der Methoden:**
-
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.recieve_command()`
This diff is collapsed.
Click to expand it.
customized_library.zip
0 → 100644
+
0
−
0
View file @
479dc482
File added
This diff is collapsed.
Click to expand it.
examples/IRReciver/IRReciver.ino
+
5
−
5
View file @
479dc482
#include
"BITsIRReciver.h"
#include
"BITsIRReciver.h"
B
IT
sI
R
Reciver
bIRrec
;
B
it
sI
r
Reciver
ir_sensor
;
int
command
_index
;
int
command
;
void
setup
(){
void
setup
(){
Serial
.
begin
(
115200
);
Serial
.
begin
(
115200
);
bIRrec
.
init
();
ir_sensor
.
begin
();
}
}
void
loop
(){
void
loop
(){
command
_index
=
bIRrec
.
ir_recv
();
command
=
ir_sensor
.
recieve_command
();
Serial
.
println
(
command
_index
);
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