Добри практики при създаването на дълги програми на принципа проба-грешка Pro Preview

След като вече изпробвахте и се справихте с предизвикателство, включващо поредица от инструкции, искаме да ви представим някои добри практики.

  • #413
  • 15 Mar 2017
  • 2:51

Тествайте блокчетата едно по едно

Лоша практика е да се поставят няколко блокчета и след това да се тества. Проблемът е, че когато се появи грешка, няма да можете да разпознаете в кое блокче е причината.

Разберете задачата

За да решите една задача правилно, трябва да сте сигурни, че правилно разбирате какво се иска от вас. Затова, кажете на глас как разбирате задачата и се посъветвайте с учителя дали правилно сте разбрали.

Тествайте всяка стъпка на програмата с робота

Това е най-важното, което искаме да ви кажем! Следвайте този алгоритъм:

  • Поставете един или два блока в програмата си и ги настройте;
  • Свалете програмата от компютъра на робота;
  • Поставете робота на пода, на стартовата позиция;
  • Изберете програмата от менюто на бриковете и я стартирайте;
  • Наблюдавайте резултатите и преценете дали роботът се държи, както очаквате:
    • Ако поведението на робота е "правилно", както вие искате, продължете нататък
      • Добавете нови блокчета в програмата, разширете я;
    • Ако се появи грешка, то тя е в новите блокчета, които току що сте добавили.
      • Поправете грешката и наблюдавайте отново.

Използвайте опцията за сваляне на софтуера

По този начин вие контролирате къде и кога да стартирате робота, като при нужда можете да стартирате програмата от брика няколко пъти.

English

When building a program with a series of instructions at the end we have the following program.

That was the Yo-yo challenge. And there are a couple of best practices of how you should develop such programs and in this video I'd like to discuss these best practices.

Now, this is a complex program because it involves several blocks. And it is not a good idea to place all the blocks at once and to try to run the program because it will not work correctly. So, you should try do develop the program in small steps. First, the most important thing, understand the challenge. You can ask for some clarification from the instructor, from the teacher. You can also comment below the video or look for answers in the comment sections. So, you should understand the whole challenge. Then create a program using only one or two blocks. Download the program from the computer to the robot. And you can use Bluetooth, you can use USB. But after you've implemented a program with one or two blocks you just download this program to the brick. And now I'll download my program right here.

Just download without running. Then you take the robot, place it on the floor where you have the starting position and from the menu you select the program that you want to run. And press the button.

So, we have the first two blocks of the challenge. We observe them and we decide, okay, this is something correct. Then we can extend this program. If the behavior is not correct, we can change it. But if it is correct, we just extend it. In this way we have in small steps developing the program. And we know exactly where the error is if there is an error. Because we don't move forward until we have the small fragment of the program working, these small one or two blocks. That's why it's important that you use the download option. Because you can actually take the robot, place it, run and then observe the behavior of the robot.

Курсове и занятия включващи този Урок

Този Урок е използван в следните курсове и занятия.

Image for EV3 Phi. Introduction to robotics with LEGO Mindstorms
  • 92
  • 220:20
  • 36
Image for Series of instructions make a program
  • 11
  • 0
  • 4
  • 3d_rotation 0
Image for Instructors Remote Training
  • 136
  • 280:11
  • 156
Image for How to make the robot move
  • 24
  • 0
  • 11
  • 3d_rotation 0
Image for Ниво A - Въведение - Роботика с LEGO
  • 142
  • 133:42
  • 187
Image for Занятие 2 - Йо-йо
  • 18
  • 3
  • 8
  • 3d_rotation 1
Image for Роботика с LEGO - Ниво 1.0 - Приключение в Космоса
  • 126
  • 123:52
  • 150
Image for Занятие 1 - Движение като Йо-Йо
  • 19
  • 4
  • 9
  • 3d_rotation 1
Image for Роботика с LEGO SPIKE Prime - Ниво A1
  • 64
  • 30:30
  • 76
Image for Занятие 2 - Приливи и отливи
  • 10
  • 5
  • 12
  • 3d_rotation 1