VMM501
V. 01 – 17/01/2019
12
©Velleman nv
3.
In the
forever
block, select the
PhoVal
variable and set the
analog read
pin
to P0.
4.
Drag the
logic smaller than function
next to the
if
block and drop it over
the
true
block.
Next, we drag and drop the
PhoVal
variable (from
Variables
in the Code
Drawer) and drop it over the first 0 of the
logic smaller than function
.
Drag the
mathematical function minus
block and drop it over the second
0 of the
logic smaller than function
.
Next, we drag and drop the
CalVal
variable (from
Variables
in the Code
Drawer) and drop it over the first 0 of the
mathematical function minus
block. Set the second 0 of the
mathematical function minus
block to 2.
5.
Drag and drop the
show icon
block next to the
then
block. Drag and drop
the
clear screen
block next to the
else
block.
6.
When the
PhoVal
is smaller than
CalVal
- 2, the display will show a heart.
Else, it will switch off.