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

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content
Current time:0:00Total duration:3:07

Introduction to programming using lego NXT

Video transcript

this is the Lego Mindstorms NXT graphical programming environment to get started you need to create a new program by clicking on the new icon or a file new and when you create a new program it'll show up as a tab here I have multiple programs open I was working on these earlier and and that's no problem the next step is to realize where all your tools are which is the left-hand side here and this is the common palette think of as it as a toolbox however you want to switch to a better toolbox which is the complete palette and this is for advanced users and that means it just doesn't hide any detail from you and don't worry if you don't understand these blocks and just be comfortable with experimenting with each of them and learning them one at a time now this is organized in an intuitive manner the green block are all of your outputs such as your motors the yellow block are all of your inputs such as your light sensor or ultrasonic sensor the orange block are all of your flow related blocks such as looping or weighting and the data block contains your math block your comparison block or if you want to generate a random number or store variable that all lives in this data block and the final one is the advanced block which are lesser-used blocks such as calibrating your sensor or storing values to files now that is your complete toolbox and let's do a very simple example so we know how to download and run programs to make sure everything's working I'm going to grab my sound block which is an output and drop it on to my sequence beam and you should understand that programs execute from left to right so right now all my program does is hit this sound block and do whatever the sound block is configured to do and then my program ends let's say I want to drag a second sound block beside it and when you click on a block you have to pay attention to the settings down here so getting to know that your blocks is getting to know your settings in the case of the sound block it allows me to play either a sound file or generate a tone I can adjust the volume of the tone and there's a even a little keyboard here so I can quickly select what note I want to so I'm going to generate a higher C for this sound block for half a second and then click on this sound block and click on tone and I'll generate a lower tone and for half a second and that's my whole program so all my program will do is is play two tones to download a program it's very easy as long as your NXT is plugged in and turned on you just click this this play button here and that will download and run it or you have the option of just downloading it if you don't want it to run because it's upside-down or something so I'm going to download and run this program and that's all there is to it so now this program actually lives on the brick I can unplug it and I can just run it by selecting it on the brick menu okay let's get started