Instructions

4
0
f
o
r i in
LED:
G
P
IO
.setup(i,
G
P
IO
.
OUT
, initia
l
=0
)
z
=
l
en
(LED)
w
=
5
t
=
0.2
print ("
L
ichteffekte zur
A
uswah
l
"
)
p
rint ("1 —
L
auf
l
ic
h
t zy
kl
isc
h
"
)
print ("2 —
L
auf
l
ic
h
t
h
in un
d
zurüc
k
"
)
p
rint ("3 — auf- un
d
a
b
steigen
d
"
)
print ("4 — a
ll
e
bl
in
k
en g
l
eic
h
zeitig"
)
p
rint ("5 — a
ll
e
bl
in
k
en zufä
ll
ig"
)
print ("
S
trg+
C
b
een
d
et
d
as Programm"
)
t
ry
:
w
h
i
le
T
r
ue:
e = raw_in
p
ut ("Bitte Muster auswä
hl
en: "
)
if
e
== "1"
:
for i in range(w)
:
for j in range(z)
:
G
P
IO
.output(
LED
[j],
T
rue
)
time.s
l
eep(t
)
G
P
IO
.output(
LED
[j], Fa
l
se
)
el
if
e
== "2"
:
for i in range(w)
:
for j in range(z)
:
G
P
IO
.output(
LED
[j],
T
rue
)
time.s
l
eep(t
)
G
P
IO
.output(
LED
[j], Fa
l
se
)
for j in range(z-1, -1, -1)
:
G
P
IO
.output(
LED
[j],
T
rue
)
time.s
l
eep(t
)
G
P
IO
.output(
LED
[j], Fa
l
se
)
el
if
e
== "
3
"
:
for i in range(w)
:
for j in range(z)
:
G
P
IO
.output(
LED
[j],
T
rue
)
time.s
l
eep(t
)
time.s
l
eep(2*t
)
for j in range(z-1, -1, -1)
:
G
P
IO
.output(
LED
[j], Fa
l
se
)
time.s
l
eep(t
)
time.s
l
eep(2*t
)
el
if
e
== "4"
:
for i in range(w)
:
for j in range(z)
:
G
P
IO
.output(
LED
[j],
T
rue
)
time.s
l
eep(2*t
)
for j in range(z)
:
10145-5 Raspberry Pi verstehen und anwenden_01.indd 4010145-5 Raspberry Pi verstehen und anwenden_01.indd 40 30.06.2017 10:09:3230.06.2017 10:09:32