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.
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:
Next let's build on loops to create a night vision device.
Want to join the conversation?
- Can you make a actual city (life sized) out of Legos(14 votes)
- how much does a new Mindstorm cost?(12 votes)
- If you make a robot how are you going to make it move?(3 votes)
- Program it. If you started the "JS: Drawing and Animation" course it said that programming controls even Google's self-driving cars.(2 votes)
- Do you wire your Lego device into the computer?(1 vote)
- I am hoping to get the newer version of Lego robots mindstorms EV3 so can you teach EV3 not NXT because EV3 is becoming very very popular(1 vote)
- Where can I buy a cheap NXT?(1 vote)
- www.amazon.co.uk or www.eBay.co.uk or people selling second hand 1s from www.facebook.com(1 vote)