[SOUND] So we'll continue to talk about the Arduino board. Talk about the different components on the board. Note that a lot of this. Some of this information you need, some, you don't. So I'm gonna go into a little bit more detail than you necessarily are ever going to need, but you might. So what I mean is if I'm too superficial about this then when you run into problems you won't know what to do. So it's helpful if I give you a little bit more depth then you actually will regularly need and then every once in a while something goes wrong and know what the error is about. So this you're gonna need to know though. This is the input output pin to the board. So you can see at the top and the bottom in red, we circled these pins. And each one of those pins on the board is a hole, a hole in the board that fits a wire. I believe 24 gauge wire is the wire. So, you stick the wire in the hole and those holes on the top and the bottom are wired or connected through traces on the board. They're connected to the pins of the actual chip of the main processor down there. So you can't see the traces because they're probably embedded inside the board, maybe they're right on the bottom, but they're connected. So if you wanna connect to that chip, the microcontroller chip, you connect to those I/O pins on the top or on the bottom that we've highlighted in red. Now on the top you can see the digital I/O pins. Those pins are meant to be, they take digital inputs and outputs. They drive digital outputs and they take digital inputs. So, by digital, this board, this Arduino board, the uno board is zero volts or five volts. Right so zero volts means zero, and five volts means a one. Now there are other Arduino boards, not this one, that run at 3.3 volts. So zero to 3.3 but right now we're doing zero to five. So the digital I/O are the ones on the top. Now the ones on the bottom, some of those are analog inputs. So you can see the ones we've highlighted analog inputs. Those can take analog data on the input. The voltages don't have to be zero volts or five volts, they can be in between and that information can be read by the microcontroller. We'll talk about how to do that later. So those inputs are the only ones that you can drive with analog inputs. Note that it doesn't provide analog outputs in a direct way, cuz it's a digital the processor itself is a digital processor. So it can't drive analog outputs, but it can accept analog inputs. Because it has an analog because it has an analog converter built into the micro controller. So all CC the other pins down there, the power reset pins. Power reset pins are generally outputs. They have the ground and the power on. They have five volt power, 3.3 volt power, several grounds, and things like this. So, those are on those pins, and often, when you're connecting, when you're wiring a circuit, connecting it to the board. You'll maybe take power from the five volts from the board, from the Arduino board wired to your circuit, and also you'll wanna have a common ground between your Arduino board, and your circuits. So, you'll take the ground from one of these ground pins on the Arduino board, and wire it to the circuit. Those pins, you're gonna be using those all the time, because that's how the processor interacts with the world, with the senses and the actuators. Now, two other important Important features on this board are the microprocessors now this board actually has two microprocessors micro controllers on it. The main one is that big one down there the ATmega328. That is a program that is a processor that you are programming that the user is programming. So your code, when you write it and compile it it gets written into that ATmega328 and the ATmega328 executes the code. Now in addition to that processor, there's this other micro-controller, the ATmega16U2, and that is there just to handle the communication with the USB. So, USB is a protocol, and that processor, all it does is it understands the USB protocol. So data that comes in on the USB, it translates it to something that the main processor can understand and it passes it on to the main processor. And when the main processor wants to write something to USB, it translates that into USB protocol and sends it out So that process, that ATmega16U2, you won't ever directly access. It has code on it, code in it's flash, and you will not touch that code. It just stays there forever to talk to USB. So you really are going to be accessing that ATmega328 directly. Now, the ATmega328 that you're gonna be working with, and any microcontroller really, has let's say, broadly defined, two types of code running on the microcontroller. Okay. One type of code, we'll call application code. That is a code that you as a programmer are generally going to write. Okay. That is a program that doesn't come with the microcontroller, you write that for your particular application. So if you want to make an Arduino, you wanna build a system with an Arduino I don't know, something to sense if plants need to get watered. So it senses the humidity, it senses how wet it is, it waters the plants, something like that. You're gonna write code to do that and you would call that application code. So we write the code, or you, the programmer, write the code, and it executes the main functionality of the system, directly. Now, besides this application code, systems typically have firmware. Now, firmware Is low level code that supports the main function, but doesn't directly perform the main function. So it does all the background stuff, like the USB interface, right. The Arduino has to talk to the USB interface. And you, as a programmer, you don't have to directly figure out how to talk on the USB interface, but the Arduino has to know how. So it has code in there dedicated to talking on the USB interface. Boot loader code does some of that, and we'll talk about that later. Power modes, right. Changing the power modes from low power to high power mode, that happens in the background. You as a programmer don't have to see that. Reset, when the reset button is pressed, what happens to the device, that's all code that you as a programmer don't have to write. That stuff is already programmed in there. Generally, you call that firmware. So the programmer doesn’t write it, but it’s code that’s sitting on the Arduino anyway, and comes with the Arduino. So when you buy the Arduino on that microcontroller, it already has firmware built in to it. Now the distinction between firmware and application code is somewhat a matter of perspective. So in the sense that, so definitely it's clear the application code is something that the programmer writes. But all the code, so say you take an Arduino, and you use your Arduino to make a camera, like the one pointing at me right now, okay, you use it to drive the motors and pull the lens in and out and all that, right? So you write some code, and you wrote it so you would think of it as application code. But once you sell that product to somebody, sell the camera to somebody, they will never touch that code, right? They don't access that code. So they think of that code as firmware. That code to them is firmware because they're never gonna modify it, right? So somehow this definition of firmware depends on your perspective. What part of the chain you're in, right. If you buy something, and it has code already in it that you did not modify you call that firmware often, and it accesses a low level hardware, you call that firmware. But in general with us, we're gonna be writing code on this Arduino, but we will not be writing this firmware code. But it exists on there, so you should be aware of that. All right, it's preprogrammed, so it comes with the Arduino, the firmware's already been programmed onto that ATmega328. Thank you. [MUSIC]