User manual
26
11th Da
y
In the Advent calendar toda
y
•1x switching wir
e
L
ED echo b
y
Ap
p
T
oday’s project is an LED echo. Set a sequence with two
inter
f
aces in the App. The LEDs on the board will
fl
ash in this
s
e
q
uence.
C
omponents: 1x board, 1xLED red with dropping resistor,
1
xLED green with dropping resistor, 1xjumper
Th
e S
k
etc
h
T
he program
f
or this day is
T
ag11.
i
n
o
an
d
l
ocate
d
in
d
irectory
T
ag11
.
T
h
e App
d
etermines t
h
e ec
h
o sequence. T
h
e text is out
-
put in the following form: RNNGNN. R means red and G means
green, e.g. R5G3 – this would mean having the red LED fl ash
fi
ve times and then the green LED three times:
if
(
Text.indexOf
(
“R”
)
!= -1 && Text.indexOf
(
“G”
)
!=
-
1) {
setzeFarbe
(
Text
)
;
}
else if (Text.startsWith(“Off”) || Text.
s
tartsWith(“OFF”)
||
Text.startsWith(“off”)){
aus
()
;
}
Th
e Ap
p
The App has
f
our buttons in addition to the
C
onnec
t
button that is already familiar:
t
Re
d
,
G
reen
,
S
u
b
mit va
l
ue
s
an
d
Reset va
l
ue
s
.
W
h
en touc
h
ing Re
d
or
G
ree
n
,
t
h
e respective
l
a
b
e
l
is increase
d
b
y one. Reset va
l
ue
s
resets
t
h
e two va
l
ues to 0. Su
b
mit va
l
ue
s
su
b
mits t
h
e va
l
ues to t
h
e IoT-
b
oar
d
. T
h
e va
l
ue to
b
e su
b-
mitted is put in interim storage in a global variable. The content o
f
the variables is transmit-
ted
vi
a
Bl
uetoot
h wh
e
n
t
h
e
butto
n
Sub
mi
t
v
a
l
ues
i
s
touc
h
ed
.
E
ac
h
b
utton
h
as a separate w
h
en.C
l
ic
k
-query
.
T
he integrated dropping resistors make the circuit very compact. LEDs
f
rom the le
f
t to the
rig
h
t: re
d
an
d
green.
T
he App uses the App already familiar from day 8
.
11. Da
y
15007-3 Conrad Adventskalender Internet of Things 2017_en.indd 2615007-3 Conrad Adventskalender Internet of Things 2017_en.indd 26 13.08.2017 17:03:1213.08.2017 17:03:12










