If you're seeing this message, it means we're having trouble loading external resources on our website.

Jeżeli jesteś za filtrem sieci web, prosimy, upewnij się, że domeny *.kastatic.org i *.kasandbox.org są odblokowane.

Główna zawartość

Rozgrzewka: syrena policyjna

Getting comfortable

This article assumes you successfully downloaded a test program to your NXT as shown in the previous video. This means you can make your robot 'beep' once or twice. Next let's build some confidence while covering a fundamental concept in programming: Loops. We will also use the touch sensor.

Loop blocks

So far we have created a program which output a single tone, or single sequence of tones. What if we want to repeat sounds, such as a police siren?
If you want to repeat a behaviors you will need to put them inside a loop block which looks like this:
The following video demonstrates the loop block in action. It explains how to nest loops as well as how to control a loop using your touch sensor:
Filmy wideo na Khan Academy
Next let's build on loops to create a night vision device.

Chcesz dołączyć do dyskusji?

Rozumiesz angielski? Kliknij tutaj, aby zobaczyć więcej dyskusji na angielskiej wersji strony Khan Academy.