Блокче за дисплей като последно блокче в програмата на EV3-G софтуера Pro Preview

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

  • #397
  • 29 Apr 2017
  • 2:40

"Изображението е в програмата, но не го виждам"

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

Изчакайте малко, за да го видите

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

English

One of the very common mistakes using the display block is to put the display block as a last block in your program. For example, you do some move forward and then you add the display block as a last block in the program. What will happen then?

Yes, the robot will move forward

but do you see a smiley face? Again.

It appears for kind of a millisecond and then disappears. You see it. The reason is that when you have the display block as a last block in the program first you'll have the motors move forward then the smiley face will be displayed on the brick screen and then the program will end. And when the program ends the whole display is cleared. And because we're not waiting for us to see the smiley face it just disappears. So, this is a very very common mistake with the display block. And the display block doesn't take some seconds to be executed like the sound, the sound will take, for example, a second for playing the sound. But displaying something on the screen happens very fast. So, you should be careful and if you're displaying something just put a wait block to be able to see it. In the program I'll add a new wait block as a last block in our program. In this way we move forward, display a big smile on the brick's screen. And then wait for 1 second and only after that because this is the last block in the program the program will end. So, we postpone the end of the program by using a wait block at the end of the program. Download.

You saw the smiley face. Move forward, show a smiley face, wait for a second and only then the program will stop.

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

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

Image for EV3 Phi. Introduction to robotics with LEGO Mindstorms
  • 92
  • 220:20
  • 36
Image for Роботика с LEGO - Ниво 1.0 - Приключение в Космоса
  • 126
  • 123:52
  • 150
Image for Ниво A - Въведение - Роботика с LEGO
  • 142
  • 133:42
  • 187
Image for Занятие 3 - Поздрав към Извънземно
  • 12
  • 3
  • 5
  • 3d_rotation 2