Arduino MASTERCLASS | Which Arduino IDE? PART 4

Transcript of the lesson:

Are you ready to get started writing code for Arduino? If so, you are gonna need to use the Arduino IDE. What you’re gonna learn right now is the different options you have available for the IDE or Integrated Development Environment that you can use with Arduino. By the end of this you’ll know which one to load onto your computer and how to actually upload code onto your Arduino board.

All right, so what I’ve done is navigate to the Arduino website. That’s just arduino.cc. And then I clicked on this software navigation tab. And that takes me to this page where it shows kind of a bunch of different options for different IDEs. So as a reminder, IDE stands for Integrated Development Environment and it’s simply a software tool that you are gonna use to write your code in. And it’s also gonna help you load the code into an actual Arduino board. So it’s a really handy tool and all the options on the Arduino website are free. And when I say options, you actually have three different options on this website for what IDE you want to use. They have the web editor, they have the original Arduino IDE which is Arduino IDE 1. And then they have the future version of the Arduino IDE which is Arduino IDE 2. Now, Arduino IDE 2 is still in development as we’re speaking, but it’s definitely working and you can download it and check it out. I think it’s a great IDE. I’m not positive yet but I actually think they’re gonna keep both of these IDEs around for a long time. So I don’t think IDE 1 is going away. I think it’s got a lot of great features. It’s really simple to use. Nothing really gets in your way, not to say that Arduino IDE 2 Isn’t great also, but it has a a bit more going on than Arduino IDE 1. Now Arduino IDE 1 and 2 are both downloads that you would download onto your computer, you know load onto your hard drive and use, but they also have a web editor that you can set up. And so it doesn’t matter what computer you’re on. You can write code for your Arduino and you can upload the code that you write in the web editor onto your Arduino boards with your computer. What’s great about the web editor is if you have a Chromebook or maybe you are in an educational environment, a lot of people have Chromebooks, then you can use this web editor on those Chromebooks. So let’s go through the process of downloading this Arduino IDE 1. It’s gonna be the same for Arduino IDE 2, but let’s just do this. So I’m on a Windows machine. Click this, you have the option to donate. I’m just gonna download it for now. I’m gonna download it to downloads. I’ll double click EXE file. I want it to make changes, something about selling your first kid. I’m just gonna leave all these checked. I’m just gonna leave it as this default destination folder under program files. All right, now it’s completed. I’ll go ahead and hit close. All right. Now I’ve got a shortcut right on my desktop here. If I click this, it’s gonna open up the Arduino IDE. I’ll allow access. All right, here we go. This is not super duper fancy, but this is it right here. So when you open up the Arduino IDE, it opens up a new sketch. It creates a new sketch for you with the date in there. And it fills it with two functions, void setup and void loop, which you’ll learn about here shortly. But what’s really important is about where these things get saved. So what I’m gonna do is I’m just gonna go ahead and save this. File Save. All right. So I’m saving this. The file name is gonna be sub sandwich. I’m gonna hit Save. So now what I wanna do is show you where that actually gets saved. So I’m gonna go to my documents. And if we come to documents, when you install the Arduino IDE, it creates a folder called Arduino. And if you open that folder up there’s gonna be some files inside here. So libraries is where all the libraries that you save will go and all the other sketches you save, it’s gonna create a folder with the name of the sketch. So we save sub sandwich. And if you open that, it’s gonna have a file in here and you can see the file name is also sub sandwich. Now the file extension is .eno. Old file extensions are .PDE, but .eno is what you’ll see. And this folder named Arduino, this is called your sketchbook folder. So if you go to file sketchbook you’ll see here’s two programs in here. Now I had already downloaded the Arduino IDE and I had a little simple write program. So that’s why this shows up. But if you want to get to the programs you’ve written, which are called sketches in Arduino, you would just go to sketchbook and there they would show up. But let’s go to file and let’s go down to preferences. And I wanna show you this right here. This is where you set your sketchbook location. Tight now mine is under users\micah\documents, and then Arduino. And you can change that here if you want. You can also change the font size. Like we could make the font size bigger, which I usually do. So we’ll make that 18. You can display line numbers if you want. So you’ll see this when I save this here, but there’s some important stuff that takes place in here. We won’t talk about all of it right now but I’m just gonna hit Okay. And now you can see, we see the line numbers. Okay. Cool. All right, so let’s go ahead and check out one of the cool features of the Arduino IDE. And that is all the example sketches in here. So I’m gonna go to file, and I highly recommend you do this as well. And I’m gonna go to two examples. And in the examples, they have a bunch of example programs, a bunch of example code that you can play around with. So I’m gonna go to Basics and I’m gonna go to Blink. It’s gonna open up a new program, new sketch here and they’ve got some comments up here. Comments are things that tell you about the program, but they, they, it’s not actually code. It’s just more like helper text for you to understand what’s going on. And Blink turns an LED on and off. So we won’t talk about this code right now, but I just wanna show you how to check to see if there’s any errors in the code and then how to actually upload it onto an Arduino board. So the first thing I’m gonna do is I’m gonna take my Arduino Uno, and I’m actually gonna plug it in with that USB cable to my computer. So I’m gonna plug it in. Now, my computer made a little noise like, oh hey I recognize something. Yours may or may not, but mine does. And then I’m gonna go up to Tools, Board and I am gonna select which board I have now. I have an Arduino Uno. So it already recognized that for me. So I’m just gonna click that. We also need to set the port. So here’s the port. It’s gonna show me I have com four hooked up. I have on Arduino Uno. Maybe I have different things shown here, right? But there might be multiple ports listed here. I’m just gonna go with this one right here. So I’m gonna click that. So now that I have my board and my port selected, I’ll be able to upload this code onto my Arduino. Now, if you look in the bottom right of the Arduino IDE it’ll tell you what board you have and what port it’s on. And then this space right here in this black space, this council space, it’s gonna show you if you have any errors or anything like that. So the first thing I’m gonna do is hit this little check mark. This is the verify. And what it’s doing is it’s checking your sketch for any errors. Now, since this is an example sketch, we’re not gonna see any errors. So we get a little message down here about how much space it’s using and we’re doing just fine. So now I want to actually get it onto my Arduino board. So I’m gonna go ahead and hit upload. Now, when I hit upload, now it’s actually uploading it to my Arduino board. And if you look at your board while it’s uploading you’ll see the TX and RX lights start blinking. Now, what this program does is it blinks an onboard LED on the Arduino Uno. So most Arduinos, they have an LED on the board somewhere. Usually it’s a pitten 13, but not always. And as you can see right now, we’re blinking the LED. So we are able to successfully upload this to the, to the board. And so it’s on for a second and off for a second, but if let’s say we wanted to speed that up, we could mess around with this delay function. And we’ll talk more about this later, so don’t get too worried, but I just want to just show you how, how this can work. So I’m just gonna make that 100 and this let’s make it 75. And then I’m gonna go ahead and upload it again. So now I can see the LED is blinking much faster and it’s not off as long as it is on. So it’s kind of a neat little effect. Okay. So that’s uploading code to the board. That’s not too crazy, right? So that’s about everything you need to know on a very basic level about how to get code loaded onto your Arduino board. I highly recommend going into File, Examples and just walk through each of these examples, see the circuit they talk about setting up and then playing around with those circuits. Just doing that is really gonna help you find your way around. All right. So this is Arduino IDE 1.0. For kicks, let’s check out Arduino IDE 2.0. All right. The license agreement. I’m gonna install it for everybody uses a computer and I wanna say, yep, that’s okay. Again, selling my children. Now what’s nice is you can have Arduino IDE 1 and Arduino IDE 2 installed on your computer at the same time, no issues there. So I’ll g ahead and hit install. And then I’ll just click finish. All right, and it automatically opens the Arduino IDE 2.0 for you now. I had already had it installed. You might have to click to install some drivers while you go through that process, but it’s just acknowledging that some drivers are getting installed and it looks pretty darn similar, doesn’t it? So you’re gonna have File and Preferences, and you’ll notice that the sketchbook location is the same for IDE 1 and for IDE 2. So when you save a sketch in IDE 2, it’s gonna also, you’ll also be able to access it from IDE 1, no problem at all. Okay, and you can also, you can change the theme to a different, you know, colored theme in there too if you wanted to do that. Kind of fun to do. I’ll just keep it with this theme. Now, if I want to connect a board, I can just go to Tools, Board and select my board. Notice this is Arduino AVR boards. There’s different types of boards that you can have show up here. We won’t cover how to show the different boards but got a really big list here. And I’m just going down and saying, yep, Arduino Uno. And then I go back to Tools, Port and the only port is showing me is currently this COM4 Arduino Uno port. I’ll select that. And then you’ll notice just right here it’s gonna show me my options. If I had other boards here, it would show me those. And then again, down in the bottom right, it’s telling me what board I’m connected to. And the port that I’m on. The Verify button is the exact same. And the Upload button is also the same. So I can go to File, Sketchbook. I can see there was that sub sandwich sketch that we had saved. I can go to examples and see all those examples. I’ll just go to Blink again. Now on Arduino IDE 2.0, this is gonna open up a new window. So go ahead and open this up. It’s the same sketch, nothing different there. And just verify that yep, this is the port I’ve got selected and I can go ahead and upload. And the output shows down here. All right, and that’s pretty much Arduino IDE 2.0, so pretty darn similar, huh? Not too much different there. Now let’s talk about the web editor. So I’ll go ahead and click Code Online. And what you have to do is set up an account. I’ve already done that. All right, so here I am. Now I’m logged into the Arduino web editor, but in order to actually upload a sketch with the USB port, you have to install some software. It’s the Arduino agent. So this little thing pops up. I’m just gonna go ahead and click that. And it’s gonna walk me through setting it up, making sure it’s installed. So I’m gonna install the agent and then select for a Windows 32 or a Windows 64. I’ve got a Win 64, so I’ll download for that. I’ll double click the installer. Just hit some Next. Yep. I’m gonna accept selling my kiddos. That looks like a good installation directory. All right. I am planning on using this with Google Chrome or Firefox. So I’m, I’m not gonna click yes. This is, these are the two I plan on working it on. So here we go. And now I’ll hit Next. It’s gonna go ahead and install that. And then it launches the agent. It just kind of runs in the background, finish it. Now, when you look down at toolbar, you’ll see this little Arduino looking thing, and this is the agent right here. So you can actually click this. It’s gonna take you right to the web IDE. If you go to the create, it’ll open up a tab for you. And what we’re gonna be working with is the web editor. All right, so now I’m, I’m all connected. All right. So now what I do if I wanna select the board, is I just click here and it’s gonna show me the boards I have. So here’s an Arduino Uno. I select that. Cool. And then over here, it’s got the different things. So I can go to Examples, Basics, Blank. Here’s that sketch that we just saw on our desktop, same thing here. And then I’ll click upload. Same thing happens. The TX and RX lights turn on and off. And I have successfully uploaded the board. So same thing here. And when you save sketches, they get saved over in your sketchbook folder but this is an online sketchbook folder. So, you know, I’ve used this before so we’ve got some code in here but it just gets saved over in here and you can organize it and you can access these from anywhere. So that’s pretty cool. So which one of these are you supposed to use? Well, here’s the good news. It doesn’t really matter. Just pick one and go with it. Now, if you are on a Chromebook computer then you’re gonna have to go with that Arduino web editor, but otherwise you know, IDE 1, IDE 2, doesn’t really matter. There’s also other editors out there that, you know we’re not gonna talk about right now that you could write this code on. For example, VS Code, you could use platform IO. The code’s gonna remain the same. It’s just a matter which IDE you feel most comfortable programming in. Well, hey, if you haven’t already, just make a choice and get started, download something, check out those examples. That’s a really important step to take at this point. Now, if you have any questions at all about how to download the Arduino IDE, or if you’re having an issue, leave a comment below and I will answer it as best as I can. Also, while you’re down there, if you could subscribe to the channel, it helps us bring you great content like this Arduino workshop, and it only costs you a click. And if you could like the video, I’d really appreciate it as well. So now that we’ve talked about Arduino hardware, we’ve got the Arno IDE installed. We are ready to start writing some code and that’s what’s gonna be up next. We’re gonna be talking about variables, control structures, writing your own functions, and just how to actually get a program to come together for Arduino, not to mention those Arduino specific functions that are super important to understand. So that’s what’s coming up next.

AppLab Bricks open in background with actual brick

Arduino AppLab Bricks → Marketing Garbage or New Powerful Interface?

Arduino Ventuno single board computer - top side

New Ventuno Q Dual Brain Single Board Computer

AppLab Pip Install

How to Add Python Packages in Arduino AppLab (No pip install needed)

Arduino Power Section Schematic

Kit-on-a-Shield Schematic Review

Just how random is the ESP32 random number generator?

Just how random is the ESP32 random number generator?

Leave a Comment