VMM502
V. 01 – 17/01/2019
19
©Velleman nv
Step 3 – Coding
Drag and drop the blocks as shown below in picture.
You should always initialize the OLED at the beginning. 64 and 128 represent the height and width of
the OLED respectively.
The block
if then else
can be found in the
Logic
in Code Drawer.
The block
smaller than
can be found in the
Logic
in Code Drawer. Drag and drop this block next to
the
if
block. Replace the
true
block. They will snap together.
Drag and drop the block
value of moisture sensor at pin P0
over the first 0 of the logic comparison.
You can find this block in the
Tinkercademy
in Code Drawer.
Set the value of the logic function
smaller than
to 50. Modify
value of moisture sensor at pin P0
to
P1
. The code should look like the illustration below.