[MUSIC] So we've talked about different aspects of the Arduino environment, talked about the Arduino development board, looked at a schematic. We've talked about the Arduino IDE, and basics of how to use it. Now, on top of that, the third aspect of the arduino are the shields, these are hardware shields. So, these are add on hardware together with libraries that control and access that add on hardware, and we'll talk about that and how useful it is. So Arduino Shields are basically add-on boards. Daughterboards is another term for this. That interface with some other device, usually an integrated circuit, but it can be anything. So the idea is that there are often devices that you want to connect your Arduino up to that are complicated, okay, and require an integrated circuit, an IC, to access them. So, take an ethernet controller, okay? An ethernet jack. That's a complicated interface. If you want to talk to an ethernet jack, you can't just wire straight to it. You need to talk to an ethernet controller chip. A chip that is made to speak the ethernet protocol. And you need to wire that ethernet controller chip up to your chip. And it's a complicated thing, and you need to control it. The datasheet for the control chip could be 150 pages long, and you gotta understand that. It's a complicated process. So what happens instead is an ethernet shield is a board that already has the ethernet control chip, say, wired on there, so you don't have to do any wiring. All you have to do is just take this board, and you stack it directly on top of the Adruino. So the Adruino has the pins along the side. Has the holes along the sides that connect to the pins. So the shield is the same size and it's got pins underneath it so you can just stack them on top and push this shield right into those holes. And then the wiring is all done for you. You don't have to figure out how to wire it to the arduino. You just stack it and it's wired. So the hardware part of it, the wiring part, is all done. And in addition to the wiring being done there are library functions. So, every shield comes with a set of library functions. Pre-written functions that you as a programmer can call to do things with the component. So, like with an ethernet jack, ethernet card, ethernet shield. You would have functions that allow you to access the Internet and things like this that are simple, right? You don't have to understand anything about the ethernet controller and the complexities of it. You could just call this function and it will do the task that it's supposed to do. So the hardware shields come together with these libraries that make it easy for the programmer to access. So, open source hardware, these designs are generally open source shield, but you can purchase them pre-made for the most part. A large variety available. A whole lot of shields to do, Arduina has been around for a while, people love it. There are shields to interface with all sorts of different circuitry. It's a big advantage of the argument of platforms. It's a big reason why people use it, because they can use different types of hardware, exotic types of hardware, that are built into a shield, but they don't have to understand the details of the hardware. They can just call the library functions, and be happy, and things are easy for them. So here are some shields. There's a complete list at shieldlist.org, but there are lots of lists, so just Google around out there. But we can see here, we've got the ethernet shield. I got that one first, and we've already seen that one. It allows you, it's a wired ethernet shield. So if you want to connect to the Internet through a wired connection, you'd take one of these shields, pop it on top of your Arduino and then you can connect an ethernet wire up to that and connect to a network. Next is the color LCD shield. So Arduinos don't have screens. So, say you want it to have a screen. So, you want a color LCD and the shield has a color LCD screen built into it and it ethernet, it has underneath, you can't see it there but there's a processor that's connected to the shield that speaks to the shield. And it speaks to the screen, and allows you to control the screen. And then there's a synthesizer shield, a music synthesizer, so if you wanna generate music, nice music, you can take this shield. It actually has jacks to connect to a speaker and you can talk to speakers and play nice music, MIDI music and things like this. These are just a few but there's a long list of shields and they are a real benefit of the Arduino platform. Now the great thing about these shields is that they come with these libraries that make their use easy. So I'm just giving you a taste of what these libraries do for you. So let's take the ethernet shield. There are several functions in this library, and if you go to arduino.cc, you can see all of its library functions. But here's one called connect. Now Connect, iy takes an IP address and a port number. So the IP address, whatever the internet address is that you want to connect to plus the port number that you want to connect on, you pass those as arguments and this function connect will open up a connection with some remote device, okay? So at the high level, it's a straightforward thing that you wanna do to start a connection with a remote device. Now it's very easy to do with this library function, you just call connect with the address and the port number and bam the connection is open. But in reality it's actually a much more complicated operation that has to be preformed, so you can see that code that I have there, that's the implementation of the connect function. So all these libraries are open source so you can go to rwcc and look and find this implementation. That's where I grabbed this code. I went and grabbed this code. It's an implementation of the connect function, the connect method, and you see it there and it's complicated. Okay I'm not gonna go through it and describe it. That's not the whole function actually. That's less than half of the function. I just took the beginning part. Right? But it's a complicated piece of code. And to understand it you have to understand details of ethernet, what it's doing, you have to understand the ethernet controller and how it works. So these are things that regular people don't generally wanna understand. They just wanna open up a connection. So this library takes care of all those details. You never have to look at this code. You're looking at it now, but you're never gonna have to look at it again. You could just call connect and bam there's a connection so, you can call the function and ignore all the details, and there's a nice abstraction for you. Thank you. [MUSIC]