Как да използваме Абсолютна стойност в LEGO SPIKE Prime Word Blocks софтуер
Това е част от блокчето с функции, но какво прави?
- #2509
- 16 Sep 2025
Това е част от блокчето с функции, но какво прави?
Тъй като това е музикално ниво, е важно да се установят някои правила за звуците, които роботите издават. Учениците често не осъзнават колко шумно може да стане, затова им напомнете да намалят силата на звука, за да чуят хъбовете, и да спрат програмите си навреме, тъй като непрекъснатите звуци могат да станат доста силни.
В този урок учениците ще научат много от ключовите концепции, необходими за останалата част от курса. Ето защо има малко конструиране и основно изследване с един сензор за сила. Уверете се, че разбират разликата между височина на тона и сила на звука. Въпреки че са въведени много нови блокове, те са предимно прости и подобни на предишните. Тези блокове ще бъдат използвани и в много бъдещи уроци, което ще даде на учениците достатъчно време да се запознаят с тях. До края на урока учениците би трябвало да са изпробвали следните две програми:


Голяма част от звука е силата му. Ето как да я промените!
Сензора за сила може да засече колко силно го натискаме! Ето как:
Знаете ли, че хъба ви може да пуска звук? Ето как!
Знаете ли, че вашият хъб може да възпроизвежда звук? Ето как!
Искате ли да програмирате любимата си музика на SPIKE Prime? Ето как!
Вие знаете как работи делението в математиката - ето как да го направите в SPIKE Prime!
Знаете ли, че можете да използвате моторите като сензори? Ето как!
Знаете ли, че можете да използвате моторите като сензори? Ето как!
So far, we’ve explored a line-following algorithm commonly referred to as duck walking. Let’s take a closer look at how it works and consider how many distinct states it actually involves.
In more advanced robotics programming, your robot may need to respond in three or more different ways depending on sensor input. Up to this point, we've created programs with only two possible outcomes using a switch block: a condition is checked, and the robot performs one action or the other based on the result.
But what if the robot needs more than just two responses? To handle this, we can use multiple conditions—often implemented with nested switch blocks or structured decision chains. In this section, we’ll explore how to build programs that go beyond binary choices and enable your robot to react intelligently to more complex environments.
When you hear the task “program the robot to follow a black line,” you’ll most likely imagine a program that works like this:
The main takeaways from today's lesson are how to alternate between following a line and performing other actions needed to complete the basic level of the line-following challenge, and how to plan your program ahead of time. Today's program will serve as a foundation to build upon for solving more advanced line-following challenges.

PID is the most popular method for programming line-following robots. It’s a bit complex, so this tutorial is longer, as we’ll break it down into steps and explain each element of the equation.
This approach to programming line-following robots is not ideal for beginners. Attempting to learn this as a first step in competition preparation may give a misleading impression of the competition's complexity and could discourage students from learning the necessary skills to compete in this category.

Wheel condition plays a crucial role in the performance of any robot, so it’s common practice to maintain your robot before testing and especially before a competition. Here are some steps you can take to ensure that any variations in the robot’s performance aren’t due to the wheels:

This is the most basic line-following method, commonly known as the "ducky" line-following method.