[MUSIC] In this lecture, we'll talk about how you compile using the IDE, how you compile, and you upload using IDE, and what it looks like, so, and what errors look like, which you will most certainly see. So compiling code. If you want to compile a code, cross-compile technically, you can either verify or upload. So those are both buttons, verify and upload. Also, you can get those from the pull-down menus. So verify and upload both compile the code. Upload additionally copies a code, the executable, final executable to the Arduino, but both of those will compile a code. Now, what happens is when you do it, there's a message window at the bottom. And the message window is there to show you the status of the compile. So it will either, after it's done compiling, it'll either show you some completion message, to say, you know, compile complete, something like done uploading if you're uploading, something like that, or it'll show you an error, one or more errors. Error messages will show the line numbers, too. So whenever there's an error inside your code, you want to know where in your code it happened. So it helps you to find the errors somewhat. So first thing, you can see that, so in this program, if you look at the program, I'm just showing a few lines, three lines of code. In this program I messed up the code intentionally. I typed in an XX. So if you look in there, there's a line, and it's highlighted pink. Okay? That line, I typed in the letters XX, just to put an error in there, right? So that's an error, bad syntax. So when I compiled it, it gave an error. First thing it did was, in the error, well, you can look in the message window and it reports the error. It says what the error, XX is not good text. And it tells you the line number that it's on. So you can go back to the code and figure out which line number it's on. Also, you can see in the main text editor that it's highlighted pink the line with the error on it, with the first error. So that's also helpful. You can look straight at that line. I mean, you don't have to look at the line number. You can just look at the line that's highlighted and say, okay, there's my first error. So it's helping you to zero-in on where the errors are. And then you examine the line and try to find it. Just a warning about these errors, you'll notice that it gives you an error on that line. It also gives you an error on the next line, right? This happens in C a lot. Because with C you get these semicolons at the end of your statements. Notice the statements up there, each line, correct ending would be a semicolon at the end. So since there's a line with the error, you can see there's a semicolon and then there's an XX after the semicolon. And what happens is that the compiler thinks, look, anything between two semicolons is one line. So it thinks the XX is actually the beginning of the next line. And that's why it gives us an error on the next line as well, because an XX shouldn't be at the beginning of the next line. So just be wary of that. When you see these errors, you'll see sort of a cascade of errors. So what you do is, generally when you're debugging, you go with the first error first. You look for the first error, fix that, then recompile. And some of, multiple errors may disappear as a result. So the serial monitor, I mentioned that before. The serial monitor is basically a pop-up window. You pop it up and it looks like this. It's got a main window, and then it's got, up near the top it's got a row where you can type in text. So this is an interface to the Arduino. The main window is where messages will pop up. So if you, you can write, there are library functions that allow you to write in your code to print some messages to this serial monitor. So if you have a serial monitor open and you write serial print, serial.print, and we'll look at this later. You write serial.print in your code, it will print text to the serial monitor. So you can see the results of your computation, let's say. You can send it through, to the serial monitor and a human can see it. Now, also, serial monitor can work in the other direction. So somebody can type into the serial monitor. So if you look at that top row up there on the serial monitor, you can type in there and click that send button. It will send that data to the Arduino, and the Arduino will receive it. And you can write code that does something with that data that interprets it in some way. So the serial monitor is like a, sort of a keyboard and screen interface for the Arduino. You can open the serial monitor and then you can write code in your Arduino that accesses the serial monitor, either writes to it or reads data from it. Thank you. [MUSIC]