VMM501
V. 01 – 17/01/2019
11
©Velleman nv
Have a look at the code below.
1.
First, we make two variables. Go to
Variables
in the Code Drawer and click
on
Make a Variable
.
Enter
CalVal
in the window and click
Ok
. Enter
PhoVal
in the window and
click
Ok
.
You will see two new variables under
Variables
in the Code Drawer.
We will need these variables later to save the data in a register.
You can find the
logic smaller than function
and the
if then else
blocks
in
Logic
in the Code Drawer. You can find the
mathematical function
minus
block in
Math
in the Code Drawer. You can find the
show icon
block in
Basic
in the Code Drawer. You can find the
clear screen
block in
Basic
More
in the Code Drawer. You can find the
set item to
0
block in
Variables
in the Code Drawer. Click on the arrow and select
CalVal
or
PhoVal
.
2.
Select the
CalVal
variable and set the
analog read pin
to P0.