VMM502
V. 01 – 17/01/2019
13
©Velleman nv
Step 2 – Pre-Coding
Refer to
Project 1
,
Step 3 – Pre-Coding
.
Step 3 – Coding
Click on
Tinkercademy
inside the
Code Drawer
to find our custom blocks for the various components
in your kit.
Next, let’s create a code as shown in the picture. For this project, no initialisation is required and there
isn’t much code anyway.
First, drag and drop the logic function
if then else
in the code editor under the
forever
block. The
block
if then else
can be found in the
Logic
in Code Drawer.
Next, add the
motion detector at pin
P0
detects motion
block next to the
if
logic. Replace the
true
block. The blocks snap together. The block
motion detector at pin
P0
detects motion
can be found
in the
Tinkercademy
in Code Drawer.