User manual

42
24th Da
y
In the Advent calendar toda
y
•1x butto
n
R
eaction
g
ame
We will end this Advent calendar with a little reaction game.
You can start the game with a button in the App. The LED on
the board comes on; once the LED
g
oes out,
y
ou need to push
the button. The duration is displa
y
ed on the App
.
C
omponents: 1x board, 1xbutton, 1xLED green with drop
-
ping resistor, 1xpotentiometer 15kOhm, 5x jumper (diffe-
rent lengths)
Th
e S
k
etc
h
The program
f
or this day is Tag24.in
o
and located in directory
T
ag2
4
. Th
e
fu
n
ct
i
o
n
m
i
ll
i
s
m
easu
r
es
t
h
e
du
r
at
i
o
n
u
n
t
il
t
h
e
b
utton is
p
ushed:
if
(
Text.startsWith
(
“START”
)){
di
g
italWrite(
g
reenPin, HIGH)
;
delay
(
1000
);
digitalWrite
(
greenPin, LOW
);
//Start
i
ng t
i
m
e
int dauer = millis
();
Serial.println(interval)
;
while
(
tasterAuslesen
()
!= 1
)
{
delay
(
100
);
}
dauer = millis() – dauer
;
HC05.print(dauer)
;
digitalWrite
(
greenPin, LOW
);
}
The A
pp
The A
pp
Reaktionss
p
iel.ai
a
h
as
a
butto
n
ca
ll
ed
S
tart
g
am
e
. Pushin
g
this button sends the
text via the wireless interface. The text arrivin
g
from the IoT-board is displa
y
ed in the label
abo
v
e
t
h
e
butto
n
.
T
oday’s circuit is similar to that o
f
the previous day. Only the red LED has been replaced by a
green
LED.
A
b
ove t
h
e
b
utton Start
g
am
e
,
t
h
ere is a
l
a
b
e
l
wit
h
out text.
Only when a text from the IoT-board comes in will the text
in t
h
e
l
a
b
e
l
b
e set
.
24. Da
y
15007-3 Conrad Adventskalender Internet of Things 2017_en.indd 4215007-3 Conrad Adventskalender Internet of Things 2017_en.indd 42 13.08.2017 17:03:2213.08.2017 17:03:22