Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
thk_led
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_led
Commits
c8b3fb13
Commit
c8b3fb13
authored
3 years ago
by
Tom Tiltmann
Browse files
Options
Downloads
Patches
Plain Diff
Klassennamen angepasst
parent
7a850460
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
README.md
+5
-5
5 additions, 5 deletions
README.md
examples/led_blink/led_blink.ino
+4
-4
4 additions, 4 deletions
examples/led_blink/led_blink.ino
examples/ledchain_use/ledchain_use.ino
+1
-1
1 addition, 1 deletion
examples/ledchain_use/ledchain_use.ino
led_controller.h
+4
-4
4 additions, 4 deletions
led_controller.h
with
14 additions
and
14 deletions
README.md
+
5
−
5
View file @
c8b3fb13
## **Projekttitel:**
**LED
_c
ontroller und LED
_c
hain**
**LED
C
ontroller und LED
C
hain**
*
LEDs Signale erzeugen ohne Nutzung von delay()
*
Verwendung mehrerer LEDs parallel
...
...
@@ -15,13 +15,13 @@ Um diese Klassen verwenden zu können, muss diese Repository geklont und in das
## **Anwendung:**
Einbinden der Library:
```
Arduino
#include "led_controller.h
.h
"
#include "led_controller.h"
```
<br
/>
## **Erläuterungen:**
**Klasse LED
_c
ontroller:**
**Klasse LED
C
ontroller:**
*
`void blink(uint16_t interval)`
: Lasse die LED blinken mit der übergebenen Intervallzeit.
*
`void on()`
: Einschalten
*
`void off()`
: Ausschalten
...
...
@@ -29,8 +29,8 @@ Einbinden der Library:
*
`void switch_to(bool)`
: Schalten
*
`byte read_pin_state()`
: Lesen den aktuellen Zustand der LED
**Klasse LED
_c
hain:**
*
`LED
_c
hain(byte aPin_count, byte aPin_chain[], Chainmode chainmode = RIGHT)`
: Erzeuge ein ledchain-Objekt (Konstruktor)
**Klasse LED
C
hain:**
*
`LED
C
hain(byte aPin_count, byte aPin_chain[], Chainmode chainmode = RIGHT)`
: Erzeuge ein ledchain-Objekt (Konstruktor)
`aPin_count`
: Größe des Pin-Arrays
`aPin_chain[]`
: Pin-Array
`chainmode`
:
...
...
This diff is collapsed.
Click to expand it.
examples/led_blink/led_blink.ino
+
4
−
4
View file @
c8b3fb13
...
...
@@ -2,10 +2,10 @@
#include
"led_controller.h"
LED
_c
ontroller
led1
(
4
);
LED
_c
ontroller
led2
(
5
);
LED
_c
ontroller
led3
(
6
);
LED
_c
ontroller
led4
(
7
);
LED
C
ontroller
led1
(
4
);
LED
C
ontroller
led2
(
5
);
LED
C
ontroller
led3
(
6
);
LED
C
ontroller
led4
(
7
);
void
setup
()
{}
...
...
This diff is collapsed.
Click to expand it.
examples/ledchain_use/ledchain_use.ino
+
1
−
1
View file @
c8b3fb13
...
...
@@ -12,7 +12,7 @@ byte pins[] = {4, 5, 6, 7};
// 3. Parameter: RIGHT=von rechts nach links (default)
// LEFT= von links nach rechts
// TOGGLE=von links nach rechts nach links nach ...
LED
_c
hain
ledchain
(
4
,
pins
,
TOGGLE
);
LED
C
hain
ledchain
(
4
,
pins
,
TOGGLE
);
void
setup
()
{}
...
...
This diff is collapsed.
Click to expand it.
led_controller.h
+
4
−
4
View file @
c8b3fb13
class
LED
_c
ontroller
class
LED
C
ontroller
{
public:
LED
_c
ontroller
(
byte
aPin
)
:
PIN
(
aPin
)
{
pinMode
(
aPin
,
OUTPUT
);
};
LED
C
ontroller
(
byte
aPin
)
:
PIN
(
aPin
)
{
pinMode
(
aPin
,
OUTPUT
);
};
void
switch_to
(
bool
b
)
{
digitalWrite
(
PIN
,
b
);
};
byte
read_pin_state
()
{
return
digitalRead
(
PIN
);
};
void
on
()
{
switch_to
(
HIGH
);
};
...
...
@@ -50,10 +50,10 @@ enum Chainmode
TOGGLE
};
class
LED
_c
hain
class
LED
C
hain
{
public:
LED
_c
hain
(
byte
aPin_count
,
byte
aPin_chain
[],
Chainmode
chainmode
=
RIGHT
)
:
PIN_CHAIN
(
aPin_chain
),
PIN_COUNT
(
aPin_count
),
chainmode
(
chainmode
)
LED
C
hain
(
byte
aPin_count
,
byte
aPin_chain
[],
Chainmode
chainmode
=
RIGHT
)
:
PIN_CHAIN
(
aPin_chain
),
PIN_COUNT
(
aPin_count
),
chainmode
(
chainmode
)
{
for
(
byte
i
=
0
;
i
<
aPin_count
;
i
++
)
pinMode
(
aPin_chain
[
i
],
OUTPUT
);
...
...
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