[MUSIC] In this demo we're going to use the camera module and the raspberry pi, so let's first disconnect to the raspberry pi using Secure Shell. So I'm starting my putty Secure Shell Client and again I'm typing in, if you've seen any of these other recent demos, I'm typing in the IP address of my Raspberry Pi. [INAUDIBLE] there it is. Open, okay, I get a prompt for my login. Type in Yes. Okay. And let me change the screen size here. Let's go to change settings, just to change the appearance, get a nice font and apply that. Okay. Shrink this up a little bit. All right, so now we've got our Raspberry Pi connection right here. So, I've got my terminal window, and you can see, it's connected to Raspberry Pi. So, now, before I can use the camera, first thing I need to do is actually, plug the camera into the Raspberry Pi. So, to plug the camera into the Raspberry Pi, I'm not showing you that, but it's not that hard. What you do is you look on top of the Raspberry Pi. There's a special camera connector. It says camera. It's admittedly a small font but if you look on top of it, there's a port, a special port that says camera. So if you have the camera module, you'll see that at the end of the strip there's a bunch of little connectors and it only fits into one slot on the board. So it says camera on top of it. So you slide it in there. Now actually to slide it in, you're going to have to. Pull up a little tab, slide it in and then push down the tab. So, but it's not that hard once you locate the camera connector, which says camera on it, but it's small. It's not that hard. You slip the tab in there and you can also Google this, but you slip it in there and it's connected and then once you've connected it, you have to enable the camera port on the Raspberry Pi, so the way you do that is you use raspi-config. So I'll start typing this sudo raspi-config. So this configures several things about the Raspberry Pi. Now see I get this menu here, and one of them says enable camera. Now I've already done this but let's try it again. I select enable camera. Do you want enable support for Raspberry Pi camera. Enable. Right? And great and now I can select finish. So let's go to finish right there, done. Would you like to reboot now? Normally you would reboot now. I don't want to reboot now, because that will mess up my connection, and I don't need to because I've already actually enabled the camera, so that shouldn't be a problem. So the camera should be enabled for me, but you would normally reboot. Now okay so now that we've done that, the camera's enabled, now we can start Python and start using the camera. So what we'll do in this little demo is just actually take a picture with the camera. So let's start Python. So now we've got a Python terminal prompt. Now in order to start it we've got to import pi camera. Camera there we go, so we import it. So now we've got the library the package that we need for the camera. So now first thing we're going to need to do is create an object of the pi camera class, so we're going to call this constructor. So let's just call it camera = picamera.PiCamera. Note the capitalization you actually need that. So now we've got camera. Now that we have camera we can start calling methods on camera and there are a lot of methods. We can change settings and all sorts of things but what we're going to do is just capture an image. We'll start with that. So we'll say camera.capture and then we can just give it a file name. Now I've already taken an image just testing this, but let's make it a new one call it Test image, okay, that's a fine name, .jpg. Okay now as soon as I hit enter it's going to take a picture. So I will place my face in front of the camera so it can take a picture of me. Okay so its done. So there should be an image called testing. So lets do an LS oh sorry. Let's quit python and now do LS and look at the directory and see there's an image, there's a file called test image.jpg over on the right. So that should be the image. So now we want to see the image. Now I'm going to see this image on my Windows machine. So what I'm going to do, basically I have a problem screen capturing the res re pi. That's why I'm doing this all on my Windows machine. So, what I'm going to do to see the image is I'm going to transfer that image file over from the raspberry pi to my Windows machine and then on the Windows machine I'll view it like a normal image. So, how will I do this? I will start up. I will use a protocol called Secure FTP or SFTP. FTP stands for File Transfer Protocol. So SFTP, any SFTP client, I can download a free SFTP client on my Windows machine and use it to connect to the SFTP server that's running on the Raspberry Pi. So how do you do this? So I've already installed one, it's called WinSCP. So I'm going to actually have it right here, I'm going to start that. Now you would have to. Okay new version release, I will not update the new version. [LAUGH] It opens like this. It's call WinSCP. Now winSCP, this is just one of many FTP clients that you can install. This is a good one. Just Google winSCP and install it. That shouldn't be that difficult but notice up here under the session it says file protocol and it has selected SFTP, that's just the default protocol. That's what I'm going to use. It has other protocols it can use, but I'm using SFTP, secure file transfer protocol. Whenever you transfer files you should use a secure protocol just for securities sake. So I'm going to type in host name, host name is going to be the IP address of my Raspberry pi. There we go and fusing port number 22, note that because that's where secure shell and secure FTP are used. Oh, and note that there's an entry here for username and another one for password. So I'll type in the username. I'll allow it to prompt me for the password. I don't want to give it the password in general at this stage. So I'll click log in, and it should prompt me for the password. Searching for host connecting. Okay it prompts me for the password I type it in. Click okay, bam. Okay now, just to describe what you see here. Basically, if you look at this, this is WinSCP. It really has two directories in it. On the right hand side is the Raspberry PI's directory, the remote directory and if you look in here, these are all the files on my Raspberry PI. On the base of the top, the home slash pie directory in Raspberry pie. Then the left, over here, is my windows directory actually, this is showing Harris documents, this is my documents directory and there's some stuff in there. So, my goal is to take something form the Raspberry pi on the right and download it to the Windows on the left. So let's find the file on the right. The file on the right I call the test image, that jpg, there it is, right? Testimage.jpg. So I select that file and then I go up to the Download button and I click Download and that will transfer it over to my Windows machine. So I click it. It did it and then if I look on the left, there is now a file testimage.jpg on the left. So now I have it. So now I want to actually view this image I can just go to the Windows Explorer to that directory. So if we look here, this is the directory, Harris Documents, and I can see test image right there. If I double click on it, it should pull up some kind of a viewer to view the image. So I will now double click on it to verify and there we go, it's a picture of me. So that's what was taken with the Pi cam, or Raspberry pi's camera module when I used the capture function and that's it, pretty straightforward, thank you. [MUSIC]