

How to use Absolute Value in LEGO SPIKE Prime Word Blocks Software
It is part of the Functions block, but what does it do?
- #2509
- 16 Sep 2025
It is part of the Functions block, but what does it do?
Due to the long construction, you need to be careful with time in this lesson. Don’t let the students spend too much time building. If you think you can manage it, you may let them find their own sheet music and adapt it, but we recommend sticking to the short section from Ode to Joy as shown in the tutorial. This melody also serves as preparation for the next lesson, where a ready melody will again be needed. Here’s what the program looks like:
Because this is the musical level, it’s important to set some rules for the sounds the robots make. Students often don’t realize how loud it can get, so remind them to keep the volume lower so they can hear the hubs, and to stop their programs in time, since continuous sounds can become quite loud.
In this lesson, students will learn many of the key concepts needed for the rest of the course. That’s why there is little construction and mainly exploration with a single force sensor. Make sure they understand the difference between pitch and volume. Although there are many new blocks introduced, they are mostly simple and similar to previous ones. These blocks will also be used in many future lessons, giving students plenty of time to become familiar with them. By the end of the lesson, students should have tried the following two programs:
A big part of a sound is its volume. Here's how to change it!
The force sensor can detect how hard it’s being pressed! Here’s how:
Did you know that your hub can play a sound? Here's how!
We can hear sounds, but what are they?
From physics, sound is a vibration that creates a wave in a medium, usually air. A sound has three main properties: pitch, volume, and duration.
Pitch is a musical term for what physics calls frequency. Frequency is how many times the wave vibrates per second and is measured in Hz (Hertz). For example, 1 Hz means one vibration per second. Humans can typically hear sounds between 20 Hz and 20,000 Hz.
Volume is how loud the sound is. It is often confused with pitch because we do not hear every frequency equally well, and higher-pitched sounds can seem louder - up to a point.
Duration is how long the sound lasts.
Did you know that your hub can play a sound? Here's how!
Have you ever wanted to program your favorite music on SPIKE Prime? Here's how!
You already know how to do division in mathematics - here’s how to do it in SPIKE Prime!
Did you know you can use the motors as sensors? Here's how!
Did you know you can use the motors as sensors? Here's how!
Sites are outlined on the mat wireframe.
No Equipment Constraint: The mission model cannot earn points if it is touching equipment at the end of the match.
No Equipment Constraint: The mission model cannot earn points if it is touching equipment at the end of the match.
Sand is considered completely cleared when the pull activator is past the line on the mat.
No Equipment Constraint: The mission model cannot earn points if it is touching equipment at the end of the match.
No Equipment Constraint: The mission model cannot earn points if it is touching equipment at the end of the match.
No Equipment Constraint: The mission model cannot earn points if it is touching equipment at the end of the match.
Technicians may open ore blocks by hand to reveal the fossilized artifact when completely in home (see Mission 14).