User manual

1
3
6t
h
Da
y
In the Advent calendar today
•1x LED blue with dropping resisto
r
Connection to the IoT-board
Toda
y
,
y
ou will connect
y
our Smartphone to the IoT-board and
switch the blue LED on and o
ff
again with your Smartphone
.
C
omponents: 1x board, 1xLED blue with dropping resisto
r
Installing the App
f
or control
To
d
ay, you wi
ll
not use a
d
e
d
icate
d
App yet,
b
ut contro
l
t
h
e
board via the
f
ree App
S
eria
l
B
l
uetoot
h
Termina
l
f
rom the
A
pp-Store Goog
l
e P
l
ay
.
T
h
e progra
m
The program for this day is based on the fi rmware for the IoT-board. The program parts needed from the
rmware are enclosed in the fi le
V
orlage.
i
n
o
in
d
irectory
T
em
p
lat
e
.
Ra
d
io connection rea
dy
The fi rmware
(
and thus also the template
)
is programmed in such a way that the orange LED
at pin 13 remains lit when the wireless connection is read
y
. There
f
ore, wait until this LED li
g
hts
up be
f
ore you connect to the IoT-board
.
Cop
y
the fi le Vorla
g
e.ino into a new director
y
T
a
g
06
a
n
d
r
e
n
a
m
e
t
h
e
l
e
Ta
g
06.
i
no
.
Y
ou
ca
n
also
use
t
h
e
ni
s
h
ed
l
e
Ta
g
06.
i
n
o
from the director
y
T
a
g
06 ri
g
ht awa
y
. Now open the fi le
w
i
th
the
A
rduino IDE. The template contains some functions alread
y
. The constant for the internal LED is
present a
l
rea
dy
. T
h
e constant L
ed
P
i
nB
lue
for the additional LED can be defi ned ri
g
ht below the
in
te
rn
al
LED
:
#
de
n
e
L
ed
Pin 1
3
#de
ne LedPinBlue
2
At
t
h
e
e
n
d
of
t
h
e
m
et
h
od
se
t
u
p
, t
h
e LED is switc
h
e
d
on
:
v
oid setu
p()
{
...
di
g
italWrite
(
LedPinBlue, HIGH
);
}
The code
f
or switching the integrated LED at pin 13 on and o
ff
is already there. Add the
f
ollowin
g
to
i
t
:
if (Text.startsWith(“Led on”)
||
Text.startsWith(“LED on”)
||
Text.startsWith(“LED
ON”
)){
di
g
italWrite
(
LedPin, HIGH
);
di
g
italWrite(LedPinBlue, HIGH)
;
}
if (Text.startsWith(“Led off”)
||
Text.startsWith(“LED off”)
||
Text.startsWith(“LED
OFF”
)){
di
g
italWrite(LedPin, LOW)
;
di
g
italWrite(LedPinBlue, LOW)
;
}
Wh
e
n
t
h
e
boa
r
d
r
ece
iv
es
LED
on
o
r L
ed
o
n
o
r LED
O
N
,
digitalWrite(LedPin, HIGH
)
a
n
d
digital
-
W
rite(LedPinBlue
,
HIGH) will
s
wi
tc
h
t
h
e
in
te
rn
a
l LED
a
n
d
t
h
e
b
l
ue
LED
o
n.
T
he circuit is similar to the circuit from da
y
3
.
A
f
ter the
rst start, you will see an empty black
win
d
ow
.
6. Da
y
y
15007-3 Conrad Adventskalender Internet of Things 2017_en.indd 1315007-3 Conrad Adventskalender Internet of Things 2017_en.indd 13 13.08.2017 17:03:0313.08.2017 17:03:03