0% found this document useful (0 votes)
59 views17 pages

Robotics Year 5

The document provides information about different types of blocks in Coding Blocks Spike Prime including motor blocks, light blocks, movement blocks, sound blocks and important blocks. It describes what each block does and includes examples of challenges that can be solved using these blocks.

Uploaded by

Amel Fayez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views17 pages

Robotics Year 5

The document provides information about different types of blocks in Coding Blocks Spike Prime including motor blocks, light blocks, movement blocks, sound blocks and important blocks. It describes what each block does and includes examples of challenges that can be solved using these blocks.

Uploaded by

Amel Fayez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

CODING BLOCKS

SPIKE PRIME
Robotics
Year 5
Learning OBJECTIVES
01 02 03 04
Understand the Give an Practice
definition, overview on the
purpose and mistakes done.
types of blocks.
contents
MotorBlocks
1.

2. Movement Blocks

3. Light Blocks

4. Sound Blocks

5. Important Blocks
Event Blocks
Control Blocks
Motor blocks
Motor Blocks make the motors run
Motor blocks

Run Motor for Duration: This block will run one or more
motors clockwise or counterclockwise for a specified
number of rotations, seconds,or degrees.
Start Motor: This block will run one or more motors
clockwise or counterclockwise forever.
Stop Motor: This block will stop one or more motors
from running.
Set Motor Speed: This block sets the speed of one or
more motors.
Light Blocks
Light Blocks enable you to turn on the
lights of different elements(5x5 light
matrix of the Hub and distance
sensor)
on and off.
Challenge 1
Motor Blocks Light blocks
Run the motor and let it stop Show smiley face
without using stop block Show 1, 2, 3
Let the motors rotate for 3 Show Hooray!
rotations Show different colours on the
Let the motor rotate forever hub matrix
Show different colour intensity
on the hub matrix
Challenge 1 solution
Motor Blocks
Challenge 1 solution
light Blocks
Movement blocks
Movement Blocks enable you to run two motors in a
synchronized motion.They are primarily used to
move Driving Bases around. Only motors of the same
type can be synchronized.
Movement blocks
Move for Duration:This block moves a Driving Base either forward or backwards
for a specified number of centimeters, inches, seconds, degrees, or rotation.
Start Moving:This block moves a Driving Base either forward
or backwards
Move with Steering for Duration: This block moves a Driving Base forward for a
certain duration with the possibility of steering(Try +99, -99, 100, -100, and 0
“Notice the difference”)
Start Moving with Steering: This block moves a Driving Base forward with the possibility of
steering forever.
Stop Moving: Stops all movement of motors

Parameters
sound Blocks
Sound Blocks allows you to play sounds
from your device or hub.
Challenge 2
Movement Blocks
Which code will move your Which code will move the
robot further distance and robot for longer distance and
why why?
Program your robot to Program your robot to
move for 2 rotations move for 2 seconds, speed
Program your robot to 75%
move for 2 seconds Program your robot to
Avoid obstacles by using move for 2 seconds, speed
the steering block 100%
Challenge 3
Drive your robot to the right
parking spot

Students are supposed to:


Use the motor blocks to turn around in place
and the movement blocks for steering and
moving forward
After arriving at the destination they are
supposed to show a message on the hub.
Same challenge can be repeated by using the
color sensor to detect the right place for their
robot to park in.[To be added when the
conditional blocks are explained]
important Blocks
when program When Color Is when pressure
starts is

This blocks plays all


This blocks plays all the blocks the blocks attached
attached to it sequentially This blocks plays all the
to it when the
from top to bottom when the blocks attached to it
Force Sensor is
program starts.The program when the Color Sensor
pressed, hard
can be started by pressing the detects a specified color. presses, or
play button or when not in released.
streaming mode, press the
center button on the Hub.
important Blocks
when closer Wait for repeat loop
than seconds

This blocks plays all the blocks


attached to it when the This blocks pauses the
All the blocks held
Distance Sensor detects that programming stack for a
inside this block will
an object is closer than or specified number of
loop for a specified
furthur than the specified seconds(It supports whole
number of
distance. numbers and decimals).
timebefore allowing
the programming
stack to continue.
important Blocks
forever loop

All the blocks held inside this


block will repeat forever.

You might also like