From the course: IoT Projects: Physical Email Alert
Creating your first program - Raspberry Pi Tutorial
From the course: IoT Projects: Physical Email Alert
Creating your first program
- Okay, now that everything is updated, let's go ahead and take a look at the Raspberry Pi. So you notice one thing, I did change my background. If you right-click on the desktop, you can change all the settings of your desktop, and if you want to learn more about programming the Raspberry Pi and everything that it can possibly do, you should check out all the great courses on LinkedIn Learning. This course is about building an internet of things and it's geared towards people that want to create something maybe a little more advanced but don't even have that skillset, so I'm not diving deep into how to use your Raspberry Pi or even how to program, I'm just showing you how to build something and how it works. So that being said, I like to work on a dark gray background and I like to program in the Thonny Python IDE. It comes built in with the Raspberry Pi software so you don't have to install anything, and I'll go ahead and open this up, and let's write our first program. Again, this is just a basic overview of writing Python code, this is not learning how to write Python code. So if you look up here I can do something simple like, and you know, what's coming, the typical first program everyone writes. Hello world? No, Hey LinkedIn, you should know better than that, and that's all you need to do. Now, if I click on run, it's going to prompt me to save it, you do have to save it. I'll go ahead and click Run and let's see the save come up, and there it is, and you'll notice there's a little bit of a graphical bug there. That's not my recording, that's actually happening, and you know what, with a 10 to $15 single board computer, those things happen. With the Raspberry Pi 4, they don't seem to happen as often, but it is something to be aware of. So I'll save this as hey.py, and I'll make sure it's on my desktop. Just like any computer structure for saving files, and I can go ahead and close out the IDE, and I have my first Python program. Yeah, it's not that complicated, but it will work, so let's go ahead and open it. I double-click on it and the IDE's going to open up again, and once it opens, make sure you see the three little purple arrows here, and then you can go ahead and click Run, and you'll see it says run hey.py, and it ran it. Hey, LinkedIn. And that is how easy it is to write your first program in Python. Yes, it's more complicated than that, no, this is not about writing Python code, This is about building an internet of things device, even for someone who's never done any kind of programming before. So coming up next, I'll talk about how to blink LEDs and buttons and then how to go ahead and build our first internet connected device.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.