Professional Documents
Culture Documents
TASK 1:
Write a program that makes a robot drive forward by repeating three different sounds
until the color sensor detects the color tape you are using.
STEPS:
First of all, add a start block (if it’s not already chosen) from the family of flow
blocks. This block basically initiates the program.
Attach a steering block (action block) and this time, set the mode to ON.
Then attach a loop block and choose the colour sensor mode from the menu.
Select a colour of your choice. (In this case, red has been selected)
Attach switch block. In the upper part, attach a stop block from the family of flow
blocks. In the lower part, attach a sound block (action block) and select a sound of
your choice. This means that if the robot indicates the colour RED, the robot will
stop. Otherwise it will make the selected sound.
Repeat the above step two times.
PROGRAM:
TASK 2:
Write a Code for following a line using one light sensor.
(Hint: Using switch and loop block).
STEPS:
First of all, add a start block (if it’s not already chosen) from the family of flow
blocks. This block basically initiates the program.
Then attach a loop block (flow block).
Attach switch block. In the upper part, attach a steering block (action block) and
set the mode to ON. In the lower part, attach a stop block from the family of flow
blocks.
STEPS:
First of all, add a start block (if it’s not already chosen) from the family of flow
blocks. This block basically initiates the program.
Then attach a loop block (flow block).
Attach switch block. In the upper part, attach a steering block (action block). In
the lower part, attach another switch block. In the upper part, attach a steering
block (action block). And in the lower one, attach a stop block.
Attach a steering block between switch and loop blocks.
PROGRAM: