Code
Let's start with everyones favorite, Hello World but just to be clever let's make the greeting move across the display.
That is a lot of code. Real EV3 code is like looking down a train track. It just goes on until it goes over the horizon. I moved these blocks around so we can see the entire program on one screen.
Let's take the blocks apart and talk about what each does.
This is the start button. We will use it to begin the execution of every program
Our first block after start is a variable block. The variable block allows us to tell the program about a named place to store a value. I called this one number2. This is not a great name as it does not give me a clue as to how I am going to use it. In an earlier version of this program I must have had another variable called number1. When we get to writing bigger programs I will be more careful with my variable names. Another interesting thing about variable blocks is that they also tell our program the kind of information that will be held in the variable. In number2 we hold a number value.
Our only loop in this program begins here. We can think about it as a book mark that we will come back to when we reach the end of the loop
This is a wait code block. There is only one thing we can do with a wait block. It causes our program to take a rest from execution. Programs never get tired but sometimes it can be nice to wait. In this case we are just making the display stop moving for one second. Wait buttons can also be made to wait for other events but we will wait for a more complicated program to talk about those.