Raspberry Pi 5 Tutorial for Beginners 2H30 [Crash Course]
Robotics Back-End
0:00 hey everyone and welcome to this
0:01 hey everyone and welcome to this
0:01 hey everyone and welcome to this tutorial series on Raspberry Pi for
0:03 tutorial series on Raspberry Pi for
0:03 tutorial series on Raspberry Pi for complete beginners the video you're
0:05 complete beginners the video you're
0:05 complete beginners the video you're watching now is actually the complete
0:07 watching now is actually the complete
0:07 watching now is actually the complete series that I have put together in just
0:10 series that I have put together in just
0:10 series that I have put together in just one big video in this series you will
0:12 one big video in this series you will
0:12 one big video in this series you will get started with Raspberry Pi step by
0:15 get started with Raspberry Pi step by
0:15 get started with Raspberry Pi step by step in a practical way if you don't
0:17 step in a practical way if you don't
0:17 step in a practical way if you don't know anything about Raspberry Pi this
0:19 know anything about Raspberry Pi this
0:19 know anything about Raspberry Pi this tutorial series is for you and if you
0:22 tutorial series is for you and if you
0:22 tutorial series is for you and if you already familiar with the board but you
0:24 already familiar with the board but you
0:24 already familiar with the board but you feel like you could need a quick
0:25 feel like you could need a quick
0:25 feel like you could need a quick refresher of the basics while the
0:27 refresher of the basics while the
0:27 refresher of the basics while the tutorials are also going to be super
0:29 tutorials are also going to be super
0:30 tutorials are also going to be super helpful in this series you will set up
0:32 helpful in this series you will set up
0:32 helpful in this series you will set up your Raspberry Pi without even needing
0:34 your Raspberry Pi without even needing
0:34 your Raspberry Pi without even needing an external monitor you will learn how
0:36 an external monitor you will learn how
0:36 an external monitor you will learn how to use the gpio header to control
0:39 to use the gpio header to control
0:39 to use the gpio header to control Hardware components how to create a web
0:41 Hardware components how to create a web
0:41 Hardware components how to create a web server hosted on the Raspberry Pi and
0:44 server hosted on the Raspberry Pi and
0:44 server hosted on the Raspberry Pi and much more and just before we get started
0:47 much more and just before we get started
0:47 much more and just before we get started this tutorial series is actually a free
0:49 this tutorial series is actually a free
0:49 this tutorial series is actually a free extract of a much longer Raspberry Pi
0:51 extract of a much longer Raspberry Pi
0:51 extract of a much longer Raspberry Pi course which contains more than 10 hours
0:54 course which contains more than 10 hours
0:54 course which contains more than 10 hours of content and many more projects if
0:57 of content and many more projects if
0:57 of content and many more projects if you're interested check out the link in
0:59 you're interested check out the link in
0:59 you're interested check out the link in the description and now let's get
1:01 the description and now let's get
1:01 the description and now let's get started with the series in this first
1:03 started with the series in this first
1:03 started with the series in this first step you are going to understand what
1:05 step you are going to understand what
1:05 step you are going to understand what Raspberry Pi is exactly let's
1:10 start what is a Raspberry Pi and what
1:13 start what is a Raspberry Pi and what
1:13 start what is a Raspberry Pi and what can you do with it the Raspberry Pi is a
1:15 can you do with it the Raspberry Pi is a
1:15 can you do with it the Raspberry Pi is a very small computer almost the size of a
1:17 very small computer almost the size of a
1:17 very small computer almost the size of a credit card but it is quite powerful and
1:20 credit card but it is quite powerful and
1:20 credit card but it is quite powerful and it can run a lot of applications so what
1:23 it can run a lot of applications so what
1:23 it can run a lot of applications so what can you do with this board here are some
1:25 can you do with this board here are some
1:25 can you do with this board here are some examples of projects that you can easily
1:27 examples of projects that you can easily
1:27 examples of projects that you can easily do with a Raspberry Pi you could
1:29 do with a Raspberry Pi you could
1:29 do with a Raspberry Pi you could automate your your home make your
1:31 automate your your home make your
1:31 automate your your home make your personal devices Smarter with iot or
1:33 personal devices Smarter with iot or
1:33 personal devices Smarter with iot or Internet of things you can also build a
1:36 Internet of things you can also build a
1:36 Internet of things you can also build a retro gaming console create a security
1:39 retro gaming console create a security
1:39 retro gaming console create a security or an alarm system host a server for a
1:42 or an alarm system host a server for a
1:42 or an alarm system host a server for a web or mobile application you can even
1:44 web or mobile application you can even
1:45 web or mobile application you can even run a Minecraft server on your P you can
1:48 run a Minecraft server on your P you can
1:48 run a Minecraft server on your P you can also program robots such as robotic arms
1:50 also program robots such as robotic arms
1:50 also program robots such as robotic arms drones hexapods mobile robots Etc you
1:53 drones hexapods mobile robots Etc you
1:54 drones hexapods mobile robots Etc you can create a smart mirror install
1:56 can create a smart mirror install
1:56 can create a smart mirror install different operating systems for example
1:58 different operating systems for example
1:58 different operating systems for example raspberry pios you to Windows iot and
2:01 raspberry pios you to Windows iot and
2:01 raspberry pios you to Windows iot and much more or simply use the Raspberry Pi
2:04 much more or simply use the Raspberry Pi
2:04 much more or simply use the Raspberry Pi as your own portable computer and of
2:06 as your own portable computer and of
2:06 as your own portable computer and of course this list is far from being
2:08 course this list is far from being
2:08 course this list is far from being exhaustive you can find many more
2:11 exhaustive you can find many more
2:11 exhaustive you can find many more projects online and you can also get
2:13 projects online and you can also get
2:13 projects online and you can also get inspired to create your own custom
2:15 inspired to create your own custom
2:15 inspired to create your own custom projects one great thing about Raspberry
2:18 projects one great thing about Raspberry
2:18 projects one great thing about Raspberry Pi is the community so what does the
2:21 Pi is the community so what does the
2:21 Pi is the community so what does the community aspect bring to you well you
2:23 community aspect bring to you well you
2:23 community aspect bring to you well you can easily see what other people do with
2:25 can easily see what other people do with
2:25 can easily see what other people do with their Raspberry Pi you can ask your
2:27 their Raspberry Pi you can ask your
2:27 their Raspberry Pi you can ask your questions get some help from Advan users
2:30 questions get some help from Advan users
2:30 questions get some help from Advan users and you can also collaborate with other
2:32 and you can also collaborate with other
2:32 and you can also collaborate with other people on similar projects and progress
2:35 people on similar projects and progress
2:35 people on similar projects and progress together Raspberry Pi was created by the
2:38 together Raspberry Pi was created by the
2:38 together Raspberry Pi was created by the Raspberry Pi Foundation the goal of the
2:40 Raspberry Pi Foundation the goal of the
2:40 Raspberry Pi Foundation the goal of the foundation is to make computers and
2:42 foundation is to make computers and
2:42 foundation is to make computers and digital making available for as many
2:44 digital making available for as many
2:44 digital making available for as many people as possible for about $50 you can
2:48 people as possible for about $50 you can
2:48 people as possible for about $50 you can get a Raspberry Pi board and the
2:49 get a Raspberry Pi board and the
2:49 get a Raspberry Pi board and the complete setup to run it would not be
2:52 complete setup to run it would not be
2:52 complete setup to run it would not be that much more expensive now let's talk
2:54 that much more expensive now let's talk
2:54 that much more expensive now let's talk about the different versions that you
2:55 about the different versions that you
2:55 about the different versions that you can find the first Raspberry Pi board
2:58 can find the first Raspberry Pi board
2:58 can find the first Raspberry Pi board was released in 200 12 then the
3:01 was released in 200 12 then the
3:01 was released in 200 12 then the foundation continued to develop new
3:03 foundation continued to develop new
3:03 foundation continued to develop new iterations to make the board more
3:04 iterations to make the board more
3:05 iterations to make the board more powerful add more functionalities make
3:07 powerful add more functionalities make
3:07 powerful add more functionalities make it easier to use and develop the
3:09 it easier to use and develop the
3:09 it easier to use and develop the community in 2015 the Raspberry Pi 2 was
3:13 community in 2015 the Raspberry Pi 2 was
3:13 community in 2015 the Raspberry Pi 2 was released with much more computation
3:15 released with much more computation
3:15 released with much more computation power than the first one then the
3:17 power than the first one then the
3:17 power than the first one then the Raspberry Pi 3 came in 2016 with again
3:20 Raspberry Pi 3 came in 2016 with again
3:20 Raspberry Pi 3 came in 2016 with again more computation power and this time the
3:22 more computation power and this time the
3:23 more computation power and this time the Wi-Fi feature was directly integrated
3:25 Wi-Fi feature was directly integrated
3:25 Wi-Fi feature was directly integrated inside the board so you don't have to
3:27 inside the board so you don't have to
3:27 inside the board so you don't have to use a Wi-Fi USB dongle anymore in 2019
3:31 use a Wi-Fi USB dongle anymore in 2019
3:31 use a Wi-Fi USB dongle anymore in 2019 the Raspberry Pi 4 was released better
3:33 the Raspberry Pi 4 was released better
3:34 the Raspberry Pi 4 was released better performance than the version three a few
3:36 performance than the version three a few
3:36 performance than the version three a few changes in the external connectors to
3:38 changes in the external connectors to
3:38 changes in the external connectors to make it compatible with modern
3:39 make it compatible with modern
3:39 make it compatible with modern applications and an increased amount of
3:42 applications and an increased amount of
3:42 applications and an increased amount of RAM and finally we have the Raspberry Pi
3:45 RAM and finally we have the Raspberry Pi
3:45 RAM and finally we have the Raspberry Pi 5 released in 2023 twice as powerful as
3:49 5 released in 2023 twice as powerful as
3:49 5 released in 2023 twice as powerful as the version 4 an additional fan and
3:51 the version 4 an additional fan and
3:51 the version 4 an additional fan and Camera connectors and a few differences
3:54 Camera connectors and a few differences
3:54 Camera connectors and a few differences in the architecture that makes it even
3:56 in the architecture that makes it even
3:56 in the architecture that makes it even better the Raspberry p board up to
3:58 better the Raspberry p board up to
3:58 better the Raspberry p board up to version three only had 1 gab of ram
4:02 version three only had 1 gab of ram
4:02 version three only had 1 gab of ram which was already quite good at the time
4:04 which was already quite good at the time
4:04 which was already quite good at the time now for the Raspberry Pi 4 and 5 you can
4:06 now for the Raspberry Pi 4 and 5 you can
4:06 now for the Raspberry Pi 4 and 5 you can choose between 2 GB 4 GB and even 8 GB
4:10 choose between 2 GB 4 GB and even 8 GB
4:10 choose between 2 GB 4 GB and even 8 GB of RAM which is becoming quite huge now
4:14 of RAM which is becoming quite huge now
4:14 of RAM which is becoming quite huge now what can you find on the board so in the
4:16 what can you find on the board so in the
4:17 what can you find on the board so in the middle you can see lots of components
4:19 middle you can see lots of components
4:19 middle you can see lots of components those are the CPU the ram the Wi-Fi and
4:21 those are the CPU the ram the Wi-Fi and
4:21 those are the CPU the ram the Wi-Fi and Bluetooth chips and all other components
4:24 Bluetooth chips and all other components
4:24 Bluetooth chips and all other components required to make the Raspberry Pi work
4:26 required to make the Raspberry Pi work
4:27 required to make the Raspberry Pi work now let's focus on the connectors you
4:29 now let's focus on the connectors you
4:29 now let's focus on the connectors you have four USB ports including two USB 3
4:32 have four USB ports including two USB 3
4:32 have four USB ports including two USB 3 in blue one ethernet port with gigabit
4:35 in blue one ethernet port with gigabit
4:35 in blue one ethernet port with gigabit Ethernet one USBC ports to power on the
4:38 Ethernet one USBC ports to power on the
4:38 Ethernet one USBC ports to power on the board two micro HDMI ports with 4K video
4:42 board two micro HDMI ports with 4K video
4:42 board two micro HDMI ports with 4K video support for two external displays you
4:44 support for two external displays you
4:45 support for two external displays you also have two ports that can be used for
4:47 also have two ports that can be used for
4:47 also have two ports that can be used for either a camera or a display module a
4:50 either a camera or a display module a
4:50 either a camera or a display module a PCI port a 40 pins or GP header that we
4:54 PCI port a 40 pins or GP header that we
4:54 PCI port a 40 pins or GP header that we will use a lot during this course to
4:56 will use a lot during this course to
4:56 will use a lot during this course to control different Hardware components
4:58 control different Hardware components
4:58 control different Hardware components with Python program gpio means general
5:01 with Python program gpio means general
5:01 with Python program gpio means general purpose input output this header is the
5:04 purpose input output this header is the
5:04 purpose input output this header is the same for the Raspberry Pi 2B 3B
5:06 same for the Raspberry Pi 2B 3B
5:06 same for the Raspberry Pi 2B 3B Raspberry Pi 4 and Raspberry Pi 5 you
5:09 Raspberry Pi 4 and Raspberry Pi 5 you
5:09 Raspberry Pi 4 and Raspberry Pi 5 you also have one fan connector here which
5:11 also have one fan connector here which
5:11 also have one fan connector here which is new on Raspberry Pi 5 and I'm going
5:14 is new on Raspberry Pi 5 and I'm going
5:14 is new on Raspberry Pi 5 and I'm going to finish with the back here with the
5:15 to finish with the back here with the
5:15 to finish with the back here with the slot for the micro SD card in which you
5:18 slot for the micro SD card in which you
5:18 slot for the micro SD card in which you will install the operating system all
5:21 will install the operating system all
5:21 will install the operating system all right now you should have a slightly
5:22 right now you should have a slightly
5:22 right now you should have a slightly better idea of what the Raspberry Pi is
5:25 better idea of what the Raspberry Pi is
5:25 better idea of what the Raspberry Pi is what's its purpose and the applications
5:27 what's its purpose and the applications
5:27 what's its purpose and the applications you can do with it when learning about a
5:29 you can do with it when learning about a
5:29 you can do with it when learning about a new technology it's always a good idea
5:32 new technology it's always a good idea
5:32 new technology it's always a good idea to try to understand the big picture
5:37 first welcome back this is episode
5:39 first welcome back this is episode
5:39 first welcome back this is episode number two of this tutorial series on
5:42 number two of this tutorial series on
5:42 number two of this tutorial series on Raspberry Pi for complete beginners the
5:44 Raspberry Pi for complete beginners the
5:44 Raspberry Pi for complete beginners the very first step before using the
5:46 very first step before using the
5:46 very first step before using the raspberry pi is to flash an operating
5:48 raspberry pi is to flash an operating
5:48 raspberry pi is to flash an operating system on the SD card you have and do
5:50 system on the SD card you have and do
5:50 system on the SD card you have and do some configuration in this lesson I will
5:52 some configuration in this lesson I will
5:53 some configuration in this lesson I will show you how you can easily install the
5:54 show you how you can easily install the
5:54 show you how you can easily install the Raspberry Pi OS on your micro SD card
5:58 Raspberry Pi OS on your micro SD card
5:58 Raspberry Pi OS on your micro SD card but also how to set up the Wi-Fi I and
6:00 but also how to set up the Wi-Fi I and
6:00 but also how to set up the Wi-Fi I and an SSH connection so we can get access
6:03 an SSH connection so we can get access
6:03 an SSH connection so we can get access to the p and first of all you can go to
6:05 to the p and first of all you can go to
6:05 to the p and first of all you can go to the raspberry pie.com website here okay
6:09 the raspberry pie.com website here okay
6:09 the raspberry pie.com website here okay and you will click on software so slash
6:12 and you will click on software so slash
6:12 and you will click on software so slash software in the URL you can easily find
6:14 software in the URL you can easily find
6:14 software in the URL you can easily find this page we are going to download so
6:17 this page we are going to download so
6:17 this page we are going to download so we're going to install Raspberry Pi OS
6:19 we're going to install Raspberry Pi OS
6:19 we're going to install Raspberry Pi OS but to install that on the SD card we
6:21 but to install that on the SD card we
6:21 but to install that on the SD card we are going to download the Raspberry Pi
6:23 are going to download the Raspberry Pi
6:23 are going to download the Raspberry Pi major software okay so here I am on
6:26 major software okay so here I am on
6:26 major software okay so here I am on Windows I'm going to click on download
6:28 Windows I'm going to click on download
6:28 Windows I'm going to click on download for Windows if you are on MOS or you to
6:31 for Windows if you are on MOS or you to
6:31 for Windows if you are on MOS or you to you're going to click on those buttons
6:33 you're going to click on those buttons
6:33 you're going to click on those buttons here so download for Windows let's wait
6:36 here so download for Windows let's wait
6:36 here so download for Windows let's wait a bit so that it's downloaded and now we
6:38 a bit so that it's downloaded and now we
6:38 a bit so that it's downloaded and now we can install
6:40 can install
6:40 can install it so let's install it so you might have
6:44 it so let's install it so you might have
6:44 it so let's install it so you might have a popup you click on yes and then let's
6:49 a popup you click on yes and then let's
6:49 a popup you click on yes and then let's install okay and when it's done you can
6:51 install okay and when it's done you can
6:51 install okay and when it's done you can just run it so on
6:54 just run it so on
6:54 just run it so on not and then if you just search on
6:58 not and then if you just search on
6:58 not and then if you just search on the um but here search Raspberry p major
7:01 the um but here search Raspberry p major
7:01 the um but here search Raspberry p major you can easily find it the first time I
7:04 you can easily find it the first time I
7:04 you can easily find it the first time I have to press yes I have a popup so that
7:07 have to press yes I have a popup so that
7:07 have to press yes I have a popup so that I can allow the software to run with the
7:09 I can allow the software to run with the
7:09 I can allow the software to run with the correct permissions okay and that's the
7:12 correct permissions okay and that's the
7:12 correct permissions okay and that's the Raspberry Pi Im maor so I have installed
7:15 Raspberry Pi Im maor so I have installed
7:15 Raspberry Pi Im maor so I have installed the
7:16 the
7:16 the 1.8.5 here you don't necessarily need to
7:19 1.8.5 here you don't necessarily need to
7:19 1.8.5 here you don't necessarily need to have the exact same version but make
7:21 have the exact same version but make
7:21 have the exact same version but make sure that you have at least
7:24 sure that you have at least
7:24 sure that you have at least 1.8 now and before you do anything with
7:26 1.8 now and before you do anything with
7:26 1.8 now and before you do anything with the SD card make sure first that your
7:30 the SD card make sure first that your
7:30 the SD card make sure first that your computer here is connected to the Wi-Fi
7:32 computer here is connected to the Wi-Fi
7:32 computer here is connected to the Wi-Fi network you want to use for your
7:34 network you want to use for your
7:34 network you want to use for your Raspberry Pi so here what I've done is I
7:36 Raspberry Pi so here what I've done is I
7:36 Raspberry Pi so here what I've done is I have set my smartphone as a hotspot okay
7:40 have set my smartphone as a hotspot okay
7:40 have set my smartphone as a hotspot okay and I have named the network your Wi-Fi
7:42 and I have named the network your Wi-Fi
7:42 and I have named the network your Wi-Fi network to make it easier for the course
7:45 network to make it easier for the course
7:45 network to make it easier for the course so this is the network that I'm using
7:47 so this is the network that I'm using
7:47 so this is the network that I'm using for this computer and that I'm going to
7:49 for this computer and that I'm going to
7:49 for this computer and that I'm going to set also for the Raspberry Pi okay very
7:52 set also for the Raspberry Pi okay very
7:52 set also for the Raspberry Pi okay very important to have the same because if
7:54 important to have the same because if
7:55 important to have the same because if your Raspberry Pi is not in the same
7:56 your Raspberry Pi is not in the same
7:56 your Raspberry Pi is not in the same network as your computer you simply
7:58 network as your computer you simply
7:58 network as your computer you simply won't be able to find find it okay so
8:00 won't be able to find find it okay so
8:00 won't be able to find find it okay so first make sure that this is the Wi-Fi
8:02 first make sure that this is the Wi-Fi
8:02 first make sure that this is the Wi-Fi network you want to use for the
8:04 network you want to use for the
8:04 network you want to use for the Raspberry Pi and connect your computer
8:06 Raspberry Pi and connect your computer
8:06 Raspberry Pi and connect your computer to it then go back to the Raspberry p
8:09 to it then go back to the Raspberry p
8:09 to it then go back to the Raspberry p major and what you can do now is to
8:11 major and what you can do now is to
8:11 major and what you can do now is to insert the SD card into your computer so
8:14 insert the SD card into your computer so
8:14 insert the SD card into your computer so micro SD card maybe you need an adapter
8:17 micro SD card maybe you need an adapter
8:17 micro SD card maybe you need an adapter maybe you need so SD card adapter or USB
8:19 maybe you need so SD card adapter or USB
8:19 maybe you need so SD card adapter or USB adapter but put your SD card into your
8:22 adapter but put your SD card into your
8:22 adapter but put your SD card into your computer what we will do now is click on
8:25 computer what we will do now is click on
8:25 computer what we will do now is click on Raspberry p device choose device here
8:27 Raspberry p device choose device here
8:27 Raspberry p device choose device here and you will choose so here I'm using
8:29 and you will choose so here I'm using
8:29 and you will choose so here I'm using the Raspberry Pi five but if you were to
8:32 the Raspberry Pi five but if you were to
8:32 the Raspberry Pi five but if you were to use the Raspberry Pi 4 then you would
8:34 use the Raspberry Pi 4 then you would
8:34 use the Raspberry Pi 4 then you would click on that one okay and you can see
8:36 click on that one okay and you can see
8:36 click on that one okay and you can see you have other versions as well so I'm
8:38 you have other versions as well so I'm
8:38 you have other versions as well so I'm going to click on Raspberry Pi 5 because
8:41 going to click on Raspberry Pi 5 because
8:41 going to click on Raspberry Pi 5 because I'm installing Raspberry Pi OS on the
8:43 I'm installing Raspberry Pi OS on the
8:43 I'm installing Raspberry Pi OS on the five okay then you choose an operating
8:46 five okay then you choose an operating
8:46 five okay then you choose an operating system and we're going to choose simply
8:49 system and we're going to choose simply
8:49 system and we're going to choose simply the first one so raspberry pios we're
8:51 the first one so raspberry pios we're
8:51 the first one so raspberry pios we're going to take the 64bit here that's dbn
8:55 going to take the 64bit here that's dbn
8:55 going to take the 64bit here that's dbn bookor okay that I'm installing here so
8:58 bookor okay that I'm installing here so
8:58 bookor okay that I'm installing here so let's click on that one and then the
9:01 let's click on that one and then the
9:01 let's click on that one and then the storage is going to be the so you can
9:04 storage is going to be the so you can
9:04 storage is going to be the so you can see here the SD card so here I have 16
9:07 see here the SD card so here I have 16
9:07 see here the SD card so here I have 16 gab the SD card that you have just
9:09 gab the SD card that you have just
9:09 gab the SD card that you have just mounted on your computer all right once
9:11 mounted on your computer all right once
9:11 mounted on your computer all right once you have those three settings you can
9:14 you have those three settings you can
9:14 you have those three settings you can click on next and here before you click
9:17 click on next and here before you click
9:17 click on next and here before you click on yes would you like to apply
9:20 on yes would you like to apply
9:20 on yes would you like to apply customization settings you're going to
9:22 customization settings you're going to
9:22 customization settings you're going to click on edit
9:24 click on edit
9:24 click on edit settings and well let's go through all
9:27 settings and well let's go through all
9:27 settings and well let's go through all the settings that we need so so first I
9:30 the settings that we need so so first I
9:30 the settings that we need so so first I don't know if those maybe are not uh
9:32 don't know if those maybe are not uh
9:32 don't know if those maybe are not uh checked so you can check set host name
9:35 checked so you can check set host name
9:35 checked so you can check set host name um maybe just put Raspberry Pi okay so
9:37 um maybe just put Raspberry Pi okay so
9:37 um maybe just put Raspberry Pi okay so we have this that we can easily find on
9:40 we have this that we can easily find on
9:40 we have this that we can easily find on the network and a quick note is that if
9:42 the network and a quick note is that if
9:42 the network and a quick note is that if you are installing Raspberry Pi OS on a
9:44 you are installing Raspberry Pi OS on a
9:44 you are installing Raspberry Pi OS on a few Raspberry Pi boards maybe choose a
9:48 few Raspberry Pi boards maybe choose a
9:48 few Raspberry Pi boards maybe choose a different host name for each Bard but as
9:50 different host name for each Bard but as
9:50 different host name for each Bard but as for now we just have one let just keep
9:52 for now we just have one let just keep
9:52 for now we just have one let just keep it simple we name it Rasberry pie okay
9:55 it simple we name it Rasberry pie okay
9:55 it simple we name it Rasberry pie okay then you're going to set a username and
9:57 then you're going to set a username and
9:57 then you're going to set a username and a password this is very important this
10:00 a password this is very important this
10:00 a password this is very important this is the well this is the user you are
10:02 is the well this is the user you are
10:02 is the well this is the user you are going to use to connect to the Raspberry
10:04 going to use to connect to the Raspberry
10:04 going to use to connect to the Raspberry Pi so the username is going to be Pi by
10:07 Pi so the username is going to be Pi by
10:07 Pi so the username is going to be Pi by default you can just write this one and
10:09 default you can just write this one and
10:09 default you can just write this one and then the password let's just
10:12 then the password let's just
10:12 then the password let's just write a custom password here and make
10:15 write a custom password here and make
10:15 write a custom password here and make sure that so make sure that you write
10:17 sure that so make sure that you write
10:17 sure that so make sure that you write the correct password because if you make
10:20 the correct password because if you make
10:20 the correct password because if you make a typo here and then you try to connect
10:22 a typo here and then you try to connect
10:22 a typo here and then you try to connect to the Raspberry Pi well if the password
10:24 to the Raspberry Pi well if the password
10:24 to the Raspberry Pi well if the password doesn't match you will need to reinstall
10:26 doesn't match you will need to reinstall
10:26 doesn't match you will need to reinstall the OS again then you can click on
10:29 the OS again then you can click on
10:29 the OS again then you can click on configure uh the Wi-Fi and you can see
10:32 configure uh the Wi-Fi and you can see
10:32 configure uh the Wi-Fi and you can see here it has automatically detected your
10:35 here it has automatically detected your
10:35 here it has automatically detected your Wi-Fi network so that's the one that I'm
10:38 Wi-Fi network so that's the one that I'm
10:38 Wi-Fi network so that's the one that I'm connected to here okay and this is the
10:41 connected to here okay and this is the
10:41 connected to here okay and this is the one we're going to use for the Raspberry
10:42 one we're going to use for the Raspberry
10:42 one we're going to use for the Raspberry Pi um for the
10:46 password I'm just going to write the
10:48 password I'm just going to write the
10:48 password I'm just going to write the password just in case okay for this
10:51 password just in case okay for this
10:51 password just in case okay for this wi-fi network so make sure that you have
10:53 wi-fi network so make sure that you have
10:53 wi-fi network so make sure that you have the correct password okay you can also
10:54 the correct password okay you can also
10:54 the correct password okay you can also show the password so I have also named
10:56 show the password so I have also named
10:56 show the password so I have also named my password your password to make it
10:58 my password your password to make it
10:58 my password your password to make it easier all right so very important here
11:01 easier all right so very important here
11:01 easier all right so very important here so that the Raspberry Pi can connect to
11:03 so that the Raspberry Pi can connect to
11:03 so that the Raspberry Pi can connect to the Wi-Fi network and then you can go
11:05 the Wi-Fi network and then you can go
11:05 the Wi-Fi network and then you can go down and Set uh local settings okay with
11:10 down and Set uh local settings okay with
11:10 down and Set uh local settings okay with the time zone and if you have a keyboard
11:12 the time zone and if you have a keyboard
11:12 the time zone and if you have a keyboard layout that's different from a quert so
11:14 layout that's different from a quert so
11:14 layout that's different from a quert so us uh keyboard you can also check it
11:18 us uh keyboard you can also check it
11:18 us uh keyboard you can also check it here okay and once you have set all of
11:20 here okay and once you have set all of
11:20 here okay and once you have set all of that you can go to services and if it's
11:22 that you can go to services and if it's
11:22 that you can go to services and if it's disabled you enable SSH with password
11:25 disabled you enable SSH with password
11:25 disabled you enable SSH with password authentication that's all you need to do
11:28 authentication that's all you need to do
11:28 authentication that's all you need to do and then on options we don't have
11:30 and then on options we don't have
11:30 and then on options we don't have anything else to do you can just keep
11:31 anything else to do you can just keep
11:31 anything else to do you can just keep those options okay so to recap we have
11:35 those options okay so to recap we have
11:35 those options okay so to recap we have those four settings here with the H name
11:38 those four settings here with the H name
11:38 those four settings here with the H name the username password the Wi-Fi and the
11:40 the username password the Wi-Fi and the
11:40 the username password the Wi-Fi and the local plus the SSH okay those are the
11:43 local plus the SSH okay those are the
11:43 local plus the SSH okay those are the important settings then we click on Save
11:46 important settings then we click on Save
11:46 important settings then we click on Save and we click on yes to apply those
11:49 and we click on yes to apply those
11:49 and we click on yes to apply those custom settings and you can see that
11:52 custom settings and you can see that
11:52 custom settings and you can see that well all existing data will be erased
11:55 well all existing data will be erased
11:55 well all existing data will be erased okay so everything that's on yourd card
11:56 okay so everything that's on yourd card
11:56 okay so everything that's on yourd card will be erased and replaced by the
11:59 will be erased and replaced by the
11:59 will be erased and replaced by the operating system so make sure you don't
12:01 operating system so make sure you don't
12:01 operating system so make sure you don't have any file that's important that you
12:03 have any file that's important that you
12:03 have any file that's important that you want to keep okay so back up your SD
12:05 want to keep okay so back up your SD
12:05 want to keep okay so back up your SD card if you ever had some stuff on it
12:08 card if you ever had some stuff on it
12:08 card if you ever had some stuff on it and then you can click on yes this is
12:11 and then you can click on yes this is
12:11 and then you can click on yes this is going to write the OS on the SD card and
12:14 going to write the OS on the SD card and
12:14 going to write the OS on the SD card and also to verify it so it's going to take
12:16 also to verify it so it's going to take
12:16 also to verify it so it's going to take a few minutes you can take a coffee
12:18 a few minutes you can take a coffee
12:18 a few minutes you can take a coffee break and come back for the following of
12:20 break and come back for the following of
12:20 break and come back for the following of the
12:21 the
12:21 the installation so the writing is completed
12:24 installation so the writing is completed
12:24 installation so the writing is completed but now it's going to also verify so you
12:27 but now it's going to also verify so you
12:27 but now it's going to also verify so you have to wait a bit more
12:29 have to wait a bit more
12:30 have to wait a bit more all right and now the raspberry posos
12:31 all right and now the raspberry posos
12:31 all right and now the raspberry posos has been successfully flashed onto your
12:34 has been successfully flashed onto your
12:34 has been successfully flashed onto your SD card so you can see you can click on
12:37 SD card so you can see you can click on
12:37 SD card so you can see you can click on well continue and you can remove the SD
12:40 well continue and you can remove the SD
12:40 well continue and you can remove the SD card from your computer with the
12:43 card from your computer with the
12:43 card from your computer with the configuration from the last step when
12:45 configuration from the last step when
12:45 configuration from the last step when you boot your Raspberry Pi it should
12:46 you boot your Raspberry Pi it should
12:46 you boot your Raspberry Pi it should automatically try to connect to the
12:48 automatically try to connect to the
12:48 automatically try to connect to the Wi-Fi network that you have provided so
12:51 Wi-Fi network that you have provided so
12:51 Wi-Fi network that you have provided so that's what we're going to do now we're
12:52 that's what we're going to do now we're
12:52 that's what we're going to do now we're going to boot the Rasberry Pi so we have
12:54 going to boot the Rasberry Pi so we have
12:54 going to boot the Rasberry Pi so we have Raspberry Pi here so this is the
12:56 Raspberry Pi here so this is the
12:56 Raspberry Pi here so this is the Raspberry Pi 5 but it's going to be the
12:58 Raspberry Pi 5 but it's going to be the
12:58 Raspberry Pi 5 but it's going to be the same with the previous versions of the
13:00 same with the previous versions of the
13:00 same with the previous versions of the pi and I have the SD card and the first
13:03 pi and I have the SD card and the first
13:03 pi and I have the SD card and the first thing very important is make sure you
13:05 thing very important is make sure you
13:05 thing very important is make sure you don't power the Raspberry Pi okay when
13:08 don't power the Raspberry Pi okay when
13:08 don't power the Raspberry Pi okay when you're going to manipulate it with the
13:10 you're going to manipulate it with the
13:10 you're going to manipulate it with the SD card on the back of the raspberry pie
13:13 SD card on the back of the raspberry pie
13:13 SD card on the back of the raspberry pie you can see the SD card slot here so
13:16 you can see the SD card slot here so
13:16 you can see the SD card slot here so you're going to insert SD card right
13:19 you're going to insert SD card right
13:19 you're going to insert SD card right like
13:20 like
13:20 like this okay should fit easily and then
13:24 this okay should fit easily and then
13:24 this okay should fit easily and then well that's it and you can see the the
13:26 well that's it and you can see the the
13:26 well that's it and you can see the the car is going a bit on the outside here
13:29 car is going a bit on the outside here
13:29 car is going a bit on the outside here so be careful when you manipulate it
13:31 so be careful when you manipulate it
13:31 so be careful when you manipulate it okay because if you do something like
13:33 okay because if you do something like
13:33 okay because if you do something like this and you put pressure here you might
13:35 this and you put pressure here you might
13:35 this and you put pressure here you might uh destroy the card simply and then you
13:37 uh destroy the card simply and then you
13:37 uh destroy the card simply and then you have to buy a new card that happened to
13:39 have to buy a new card that happened to
13:39 have to buy a new card that happened to me quite a few times already so now I
13:42 me quite a few times already so now I
13:42 me quite a few times already so now I know how to not repeat this mistake then
13:45 know how to not repeat this mistake then
13:45 know how to not repeat this mistake then if you have a box so you might just use
13:48 if you have a box so you might just use
13:48 if you have a box so you might just use it like this but here you can see I have
13:51 it like this but here you can see I have
13:51 it like this but here you can see I have actually bought a raspberry pie with a
13:52 actually bought a raspberry pie with a
13:52 actually bought a raspberry pie with a case so if you have a case then what you
13:55 case so if you have a case then what you
13:55 case so if you have a case then what you can do is put the Raspberry Pi on the
13:57 can do is put the Raspberry Pi on the
13:57 can do is put the Raspberry Pi on the case I'm just going to remove the SD
13:59 case I'm just going to remove the SD
13:59 case I'm just going to remove the SD card okay so when you manipulate the
14:01 card okay so when you manipulate the
14:01 card okay so when you manipulate the Raspberry Pi better to remove it I'm
14:03 Raspberry Pi better to remove it I'm
14:03 Raspberry Pi better to remove it I'm going to put the Raspberry Pi
14:05 going to put the Raspberry Pi
14:05 going to put the Raspberry Pi here and uh you can see if you have a
14:08 here and uh you can see if you have a
14:08 here and uh you can see if you have a fan so I have a fan here there is a
14:11 fan so I have a fan here there is a
14:11 fan so I have a fan here there is a connector here on the Rasberry Pi so you
14:13 connector here on the Rasberry Pi so you
14:13 connector here on the Rasberry Pi so you have the gpio panel on the right you
14:15 have the gpio panel on the right you
14:15 have the gpio panel on the right you have a fan connector so I'm going to
14:17 have a fan connector so I'm going to
14:17 have a fan connector so I'm going to plug it this is just one way to plug it
14:20 plug it this is just one way to plug it
14:20 plug it this is just one way to plug it so you can't really go wrong with
14:26 this and when the fan is plug what just
14:30 this and when the fan is plug what just
14:30 this and when the fan is plug what just put the raspberry
14:31 put the raspberry
14:31 put the raspberry piie let's put the case like
14:35 piie let's put the case like
14:35 piie let's put the case like that okay and then let's put the SD car
14:39 that okay and then let's put the SD car
14:39 that okay and then let's put the SD car here all right and then what you can do
14:42 here all right and then what you can do
14:42 here all right and then what you can do is you can plug the Raspberry p so you
14:46 is you can plug the Raspberry p so you
14:46 is you can plug the Raspberry p so you can p on the raspberry pie so the case
14:48 can p on the raspberry pie so the case
14:49 can p on the raspberry pie so the case is not mandatory okay it's just because
14:50 is not mandatory okay it's just because
14:50 is not mandatory okay it's just because I have one so it's more practical and we
14:53 I have one so it's more practical and we
14:53 I have one so it's more practical and we have a fan okay so you can see it's more
14:56 have a fan okay so you can see it's more
14:56 have a fan okay so you can see it's more secure and then you're going to power on
14:59 secure and then you're going to power on
14:59 secure and then you're going to power on the uh rber P to do that don't just use
15:03 the uh rber P to do that don't just use
15:03 the uh rber P to do that don't just use a USB cable uh connected to your
15:06 a USB cable uh connected to your
15:06 a USB cable uh connected to your computer because that's not going to be
15:07 computer because that's not going to be
15:08 computer because that's not going to be enough power okay you can see here I am
15:10 enough power okay you can see here I am
15:10 enough power okay you can see here I am using a official Raspberry Pi power
15:13 using a official Raspberry Pi power
15:13 using a official Raspberry Pi power supply okay that delivers so I have 5.1
15:16 supply okay that delivers so I have 5.1
15:16 supply okay that delivers so I have 5.1 volt and 5 amp make sure you have at
15:19 volt and 5 amp make sure you have at
15:19 volt and 5 amp make sure you have at least something that has 5 volt and 3
15:22 least something that has 5 volt and 3
15:22 least something that has 5 volt and 3 amp so it could be a phone charger okay
15:25 amp so it could be a phone charger okay
15:25 amp so it could be a phone charger okay works well but make sure that it's at
15:27 works well but make sure that it's at
15:27 works well but make sure that it's at least 5 volt and 3 amps so I'm going to
15:29 least 5 volt and 3 amps so I'm going to
15:29 least 5 volt and 3 amps so I'm going to plug that
15:30 plug that
15:30 plug that first here to my uh so to the wall and
15:35 first here to my uh so to the wall and
15:35 first here to my uh so to the wall and then I can plug the
15:37 then I can plug the
15:37 then I can plug the USBC cable here and you can see we have
15:40 USBC cable here and you can see we have
15:40 USBC cable here and you can see we have a red LED then that turns green and that
15:44 a red LED then that turns green and that
15:44 a red LED then that turns green and that should
15:45 should
15:45 should flash a
15:47 flash a
15:47 flash a bit okay so it should be red and then
15:49 bit okay so it should be red and then
15:49 bit okay so it should be red and then green you see we have some random
15:51 green you see we have some random
15:51 green you see we have some random flashes if you see this kind of stuff
15:54 flashes if you see this kind of stuff
15:54 flashes if you see this kind of stuff it's a good news it means that the
15:55 it's a good news it means that the
15:55 it's a good news it means that the Raspberry Pi is booting and then trying
15:57 Raspberry Pi is booting and then trying
15:57 Raspberry Pi is booting and then trying to connect to the Wi-Fi
15:59 to connect to the Wi-Fi
15:59 to connect to the Wi-Fi and so in this course we are going to uh
16:01 and so in this course we are going to uh
16:01 and so in this course we are going to uh do the configuration without any screen
16:04 do the configuration without any screen
16:04 do the configuration without any screen but if you have a screen you could also
16:06 but if you have a screen you could also
16:06 but if you have a screen you could also plug with this micr HDMI cable okay you
16:09 plug with this micr HDMI cable okay you
16:09 plug with this micr HDMI cable okay you can already plug it but if you don't
16:10 can already plug it but if you don't
16:10 can already plug it but if you don't have one or if you're too lazy to use
16:12 have one or if you're too lazy to use
16:12 have one or if you're too lazy to use one like I am right now then we're going
16:15 one like I am right now then we're going
16:15 one like I am right now then we're going to continue the configuration with SSH
16:17 to continue the configuration with SSH
16:18 to continue the configuration with SSH and VNC so that we can access the
16:20 and VNC so that we can access the
16:20 and VNC so that we can access the desktop remotely from our computer so
16:23 desktop remotely from our computer so
16:23 desktop remotely from our computer so what do we have for now well we have
16:24 what do we have for now well we have
16:24 what do we have for now well we have flashed the operating system into the SD
16:27 flashed the operating system into the SD
16:27 flashed the operating system into the SD card and now the Raspberry Pi has boot
16:29 card and now the Raspberry Pi has boot
16:29 card and now the Raspberry Pi has boot with this SD card and it should be
16:32 with this SD card and it should be
16:32 with this SD card and it should be trying to connect to the Wi-Fi so now it
16:34 trying to connect to the Wi-Fi so now it
16:34 trying to connect to the Wi-Fi so now it should already be connected to the Wi-Fi
16:37 should already be connected to the Wi-Fi
16:37 should already be connected to the Wi-Fi but the question is what's its IP
16:39 but the question is what's its IP
16:39 but the question is what's its IP address without the IP address we cannot
16:41 address without the IP address we cannot
16:41 address without the IP address we cannot do anything and how to find the IP
16:44 do anything and how to find the IP
16:44 do anything and how to find the IP address of the Raspberry Pi well there
16:46 address of the Raspberry Pi well there
16:46 address of the Raspberry Pi well there are lots of different tools and I'm
16:48 are lots of different tools and I'm
16:48 are lots of different tools and I'm going to show you one tool here that
16:50 going to show you one tool here that
16:50 going to show you one tool here that works well and I chose this one because
16:53 works well and I chose this one because
16:53 works well and I chose this one because it's available for Windows Linux and
16:56 it's available for Windows Linux and
16:56 it's available for Windows Linux and also mic OS okay so the tool is called
16:59 also mic OS okay so the tool is called
16:59 also mic OS okay so the tool is called angry ip scanner you can just type that
17:02 angry ip scanner you can just type that
17:02 angry ip scanner you can just type that on Google and go to Angry i.org here and
17:07 on Google and go to Angry i.org here and
17:07 on Google and go to Angry i.org here and just find the download
17:09 just find the download
17:09 just find the download button so you can see you have the
17:11 button so you can see you have the
17:11 button so you can see you have the different instructions for Windows mic
17:13 different instructions for Windows mic
17:13 different instructions for Windows mic OS and Linux if you're using mic OS and
17:16 OS and Linux if you're using mic OS and
17:16 OS and Linux if you're using mic OS and Linux you might have to install Java
17:20 Linux you might have to install Java
17:20 Linux you might have to install Java before so actually not on mic OS anymore
17:23 before so actually not on mic OS anymore
17:23 before so actually not on mic OS anymore it's already included but on Linux you
17:24 it's already included but on Linux you
17:24 it's already included but on Linux you will need to install Java so you have
17:26 will need to install Java so you have
17:26 will need to install Java so you have the instructions here and on Windows
17:29 the instructions here and on Windows
17:30 the instructions here and on Windows here I'm on windows so I can just select
17:33 here I'm on windows so I can just select
17:33 here I'm on windows so I can just select the windows installer okay includes Java
17:36 the windows installer okay includes Java
17:36 the windows installer okay includes Java and runtime already uh just select the
17:38 and runtime already uh just select the
17:38 and runtime already uh just select the windows installer and let's install this
17:42 windows installer and let's install this
17:42 windows installer and let's install this so lots of ads but let's just wait for
17:46 so lots of ads but let's just wait for
17:46 so lots of ads but let's just wait for the execut
17:47 the execut
17:47 the execut table and let's install it okay you
17:50 table and let's install it okay you
17:50 table and let's install it okay you click on yes if you have a popup let's
17:53 click on yes if you have a popup let's
17:53 click on yes if you have a popup let's close that one let's install
17:59 okay finish and then once again you can
18:02 okay finish and then once again you can
18:02 okay finish and then once again you can go on the search bar here I'll just
18:03 go on the search bar here I'll just
18:04 go on the search bar here I'll just press the Windows key and angry ip
18:07 press the Windows key and angry ip
18:07 press the Windows key and angry ip scanner enter and that's the tool that
18:10 scanner enter and that's the tool that
18:10 scanner enter and that's the tool that we are going to use so before we do
18:12 we are going to use so before we do
18:12 we are going to use so before we do anything once again and I can't repeat
18:14 anything once again and I can't repeat
18:14 anything once again and I can't repeat that enough make sure that you are
18:16 that enough make sure that you are
18:16 that enough make sure that you are connected so here you can see my
18:18 connected so here you can see my
18:18 connected so here you can see my computer is connected to the uh Network
18:22 computer is connected to the uh Network
18:22 computer is connected to the uh Network called your Wi-Fi network and this is
18:25 called your Wi-Fi network and this is
18:25 called your Wi-Fi network and this is also the network that I have set up for
18:27 also the network that I have set up for
18:27 also the network that I have set up for the Raspberry Pi so both my computer and
18:29 the Raspberry Pi so both my computer and
18:29 the Raspberry Pi so both my computer and the Raspberry Pi should be on the same
18:31 the Raspberry Pi should be on the same
18:31 the Raspberry Pi should be on the same network if it's not the case then we
18:34 network if it's not the case then we
18:34 network if it's not the case then we won't find any IP address here so very
18:36 won't find any IP address here so very
18:36 won't find any IP address here so very important now back to this tool so what
18:40 important now back to this tool so what
18:40 important now back to this tool so what do we have here well we have the IP
18:42 do we have here well we have the IP
18:42 do we have here well we have the IP range that we want to scan okay if you
18:46 range that we want to scan okay if you
18:46 range that we want to scan okay if you click on the IP here so you have your
18:48 click on the IP here so you have your
18:48 click on the IP here so you have your the host name of your computer here if
18:50 the host name of your computer here if
18:50 the host name of your computer here if you click on that button you will see
18:52 you click on that button you will see
18:53 you click on that button you will see well you might have a lot or not a lot
18:54 well you might have a lot or not a lot
18:54 well you might have a lot or not a lot of stuff depends but you should see
18:56 of stuff depends but you should see
18:56 of stuff depends but you should see something with the Wi-Fi so what do I
18:59 something with the Wi-Fi so what do I
18:59 something with the Wi-Fi so what do I have here well I have this network here
19:02 have here well I have this network here
19:03 have here well I have this network here 19268 you might have the same two uh
19:05 19268 you might have the same two uh
19:05 19268 you might have the same two uh numbers first and then I have
19:09 numbers first and then I have
19:09 numbers first and then I have 203 okay that's the basically the mask
19:12 203 okay that's the basically the mask
19:12 203 okay that's the basically the mask for the network so what we want to do is
19:14 for the network so what we want to do is
19:14 for the network so what we want to do is we want to scan the addresses from zero
19:17 we want to scan the addresses from zero
19:17 we want to scan the addresses from zero to
19:18 to
19:18 to 255 with those three first numbers okay
19:22 255 with those three first numbers okay
19:22 255 with those three first numbers okay and of course this number here is going
19:24 and of course this number here is going
19:24 and of course this number here is going to be different for you because well you
19:26 to be different for you because well you
19:26 to be different for you because well you don't have the same Wi-Fi network as has
19:29 don't have the same Wi-Fi network as has
19:29 don't have the same Wi-Fi network as has the one that I have so by default it
19:30 the one that I have so by default it
19:30 the one that I have so by default it should already be good but just in case
19:32 should already be good but just in case
19:32 should already be good but just in case you can click here okay on the Wi-Fi
19:36 you can click here okay on the Wi-Fi
19:36 you can click here okay on the Wi-Fi here to get the correct Network and then
19:39 here to get the correct Network and then
19:39 here to get the correct Network and then you can click on start okay it's going
19:42 you can click on start okay it's going
19:42 you can click on start okay it's going to scan all the IP addresses here so
19:45 to scan all the IP addresses here so
19:45 to scan all the IP addresses here so it's going to take a few seconds a bit
19:47 it's going to take a few seconds a bit
19:47 it's going to take a few seconds a bit less than one minute depends on your
19:49 less than one minute depends on your
19:49 less than one minute depends on your computer so let's wait a
19:52 computer so let's wait a
19:52 computer so let's wait a bit okay and it took 36 seconds for me I
19:56 bit okay and it took 36 seconds for me I
19:56 bit okay and it took 36 seconds for me I can see I have three host on my network
20:00 can see I have three host on my network
20:00 can see I have three host on my network so I'm going to click on close and then
20:03 so I'm going to click on close and then
20:03 so I'm going to click on close and then how to find them easily well you can
20:04 how to find them easily well you can
20:04 how to find them easily well you can just click on PING here and sort by ping
20:08 just click on PING here and sort by ping
20:08 just click on PING here and sort by ping okay the first one is my laptop here and
20:11 okay the first one is my laptop here and
20:11 okay the first one is my laptop here and I have two other hosts here uh but you
20:15 I have two other hosts here uh but you
20:15 I have two other hosts here uh but you can see in the host name so somehow I
20:18 can see in the host name so somehow I
20:18 can see in the host name so somehow I don't see Raspberry Pi in the host name
20:21 don't see Raspberry Pi in the host name
20:21 don't see Raspberry Pi in the host name so since it's the first time that the
20:23 so since it's the first time that the
20:23 so since it's the first time that the Raspberry Pi is booting I don't know
20:25 Raspberry Pi is booting I don't know
20:25 Raspberry Pi is booting I don't know maybe the the host name is not correctly
20:26 maybe the the host name is not correctly
20:26 maybe the the host name is not correctly displayed so it should one of those two
20:29 displayed so it should one of those two
20:29 displayed so it should one of those two to be sure what I could do is I'm just
20:33 to be sure what I could do is I'm just
20:33 to be sure what I could do is I'm just going to remove the power from the
20:35 going to remove the power from the
20:35 going to remove the power from the Raspberry Pi so not really something
20:38 Raspberry Pi so not really something
20:38 Raspberry Pi so not really something that we will do as a best practice later
20:40 that we will do as a best practice later
20:40 that we will do as a best practice later and I will tell you exactly how to shut
20:42 and I will tell you exactly how to shut
20:43 and I will tell you exactly how to shut down the Raspberry p properly but here I
20:44 down the Raspberry p properly but here I
20:45 down the Raspberry p properly but here I just remove the power from the Raspberry
20:46 just remove the power from the Raspberry
20:46 just remove the power from the Raspberry Pi I'm going to scan again and discard
20:50 Pi I'm going to scan again and discard
20:50 Pi I'm going to scan again and discard yes okay now you can see I have only two
20:54 yes okay now you can see I have only two
20:54 yes okay now you can see I have only two host on my network and I have so I still
20:57 host on my network and I have so I still
20:57 host on my network and I have so I still have my lapop top here and I have the
20:59 have my lapop top here and I have the
20:59 have my lapop top here and I have the one that ends with 199 so there was
21:02 one that ends with 199 so there was
21:02 one that ends with 199 so there was another one with
21:03 another one with
21:04 another one with 222 that one should be the Rasberry Pi
21:07 222 that one should be the Rasberry Pi
21:07 222 that one should be the Rasberry Pi I'm just going to power the Raspberry Pi
21:10 I'm just going to power the Raspberry Pi
21:10 I'm just going to power the Raspberry Pi again okay so now it's powered on and
21:13 again okay so now it's powered on and
21:13 again okay so now it's powered on and I'm going to wait uh maybe 30 seconds to
21:16 I'm going to wait uh maybe 30 seconds to
21:16 I'm going to wait uh maybe 30 seconds to try again so that the Raspberry Pi has
21:18 try again so that the Raspberry Pi has
21:18 try again so that the Raspberry Pi has the time to connect to the Wi-Fi okay so
21:20 the time to connect to the Wi-Fi okay so
21:20 the time to connect to the Wi-Fi okay so give it 30 seconds 1 minute and then
21:22 give it 30 seconds 1 minute and then
21:22 give it 30 seconds 1 minute and then let's scan
21:24 let's scan
21:24 let's scan again okay scanning completed I have
21:27 again okay scanning completed I have
21:27 again okay scanning completed I have three holes so let's go sort by ping
21:30 three holes so let's go sort by ping
21:31 three holes so let's go sort by ping again and you can see now this one is
21:33 again and you can see now this one is
21:33 again and you can see now this one is back so this is the IP address of my
21:35 back so this is the IP address of my
21:35 back so this is the IP address of my Raspberry Pi so in my case that's 192
21:39 Raspberry Pi so in my case that's 192
21:39 Raspberry Pi so in my case that's 192 168 203 and
21:41 168 203 and
21:41 168 203 and 222 for you of course it's going to be
21:43 222 for you of course it's going to be
21:43 222 for you of course it's going to be different and well as you can see this
21:45 different and well as you can see this
21:45 different and well as you can see this is not a perfect case scenario where you
21:48 is not a perfect case scenario where you
21:48 is not a perfect case scenario where you just uh scan and you have the IP address
21:50 just uh scan and you have the IP address
21:50 just uh scan and you have the IP address directly with the host name Raspberry Pi
21:53 directly with the host name Raspberry Pi
21:53 directly with the host name Raspberry Pi sometimes I guess it could work like
21:55 sometimes I guess it could work like
21:55 sometimes I guess it could work like this and I did a test previously where
21:57 this and I did a test previously where
21:57 this and I did a test previously where it was the case but here some I don't
21:59 it was the case but here some I don't
21:59 it was the case but here some I don't have the host name so I'm just letting
22:00 have the host name so I'm just letting
22:00 have the host name so I'm just letting this in the video to show you actually
22:02 this in the video to show you actually
22:02 this in the video to show you actually how you can make some tests and see
22:04 how you can make some tests and see
22:05 how you can make some tests and see which is the Raspberry Pi IP address
22:07 which is the Raspberry Pi IP address
22:07 which is the Raspberry Pi IP address here if it still doesn't appear if you
22:09 here if it still doesn't appear if you
22:09 here if it still doesn't appear if you didn't find anything well check again
22:12 didn't find anything well check again
22:12 didn't find anything well check again that your computer is connected to the
22:14 that your computer is connected to the
22:14 that your computer is connected to the correct Wi-Fi network maybe if you are
22:16 correct Wi-Fi network maybe if you are
22:16 correct Wi-Fi network maybe if you are using your smartphone as a hotspot you
22:19 using your smartphone as a hotspot you
22:19 using your smartphone as a hotspot you can usually Chas so it depends on the
22:21 can usually Chas so it depends on the
22:21 can usually Chas so it depends on the brand and and the kind of phone that you
22:24 brand and and the kind of phone that you
22:24 brand and and the kind of phone that you have but you can usually check how many
22:26 have but you can usually check how many
22:26 have but you can usually check how many devices are connected to your hotspot
22:28 devices are connected to your hotspot
22:28 devices are connected to your hotspot okay so if you see two devices one is
22:30 okay so if you see two devices one is
22:30 okay so if you see two devices one is your computer one is the Raspberry Pi
22:32 your computer one is the Raspberry Pi
22:32 your computer one is the Raspberry Pi you know that the Raspberry Pi is
22:34 you know that the Raspberry Pi is
22:34 you know that the Raspberry Pi is connected but if you see only one device
22:37 connected but if you see only one device
22:37 connected but if you see only one device then the Raspberry Pi is not connected
22:39 then the Raspberry Pi is not connected
22:39 then the Raspberry Pi is not connected so if the Raspberry Pi is not connected
22:40 so if the Raspberry Pi is not connected
22:40 so if the Raspberry Pi is not connected maybe try to P it off and P it on again
22:45 maybe try to P it off and P it on again
22:45 maybe try to P it off and P it on again wait some time at least a few minutes
22:47 wait some time at least a few minutes
22:47 wait some time at least a few minutes and then it could also be that you
22:49 and then it could also be that you
22:49 and then it could also be that you provided the wrong SS ID and the wrong
22:52 provided the wrong SS ID and the wrong
22:52 provided the wrong SS ID and the wrong password when you configured uh the p on
22:55 password when you configured uh the p on
22:55 password when you configured uh the p on the SD card so there are many reasons
22:57 the SD card so there are many reasons
22:57 the SD card so there are many reasons why things could go wrong here but if
23:00 why things could go wrong here but if
23:00 why things could go wrong here but if you correctly followed all the
23:01 you correctly followed all the
23:01 you correctly followed all the instructions and you made no mistake
23:04 instructions and you made no mistake
23:04 instructions and you made no mistake then you should be able to find the IP
23:06 then you should be able to find the IP
23:06 then you should be able to find the IP address what we can do now is to use SSH
23:09 address what we can do now is to use SSH
23:10 address what we can do now is to use SSH to take control over the pie and really
23:12 to take control over the pie and really
23:12 to take control over the pie and really get access to it this will provide you
23:14 get access to it this will provide you
23:15 get access to it this will provide you with command line access in a terminal
23:17 with command line access in a terminal
23:17 with command line access in a terminal which we will use just in the next
23:19 which we will use just in the next
23:19 which we will use just in the next lesson to install VNC and get access to
23:22 lesson to install VNC and get access to
23:22 lesson to install VNC and get access to the Raspberry Pi desktop and the first
23:25 the Raspberry Pi desktop and the first
23:25 the Raspberry Pi desktop and the first thing we are going to do just to make
23:27 thing we are going to do just to make
23:27 thing we are going to do just to make sure that we don't have an eror or later
23:29 sure that we don't have an eror or later
23:29 sure that we don't have an eror or later on you can open a file manager so let's
23:33 on you can open a file manager so let's
23:33 on you can open a file manager so let's open a file manager on your computer
23:35 open a file manager on your computer
23:35 open a file manager on your computer just browse to uh this PC and then you
23:39 just browse to uh this PC and then you
23:39 just browse to uh this PC and then you basically want to go in there and go to
23:42 basically want to go in there and go to
23:42 basically want to go in there and go to users and just find your user okay so
23:44 users and just find your user okay so
23:44 users and just find your user okay so just go to basically what we can call
23:47 just go to basically what we can call
23:47 just go to basically what we can call the home directory in Linux or in Mac OS
23:50 the home directory in Linux or in Mac OS
23:50 the home directory in Linux or in Mac OS it's going to be where the place the
23:52 it's going to be where the place the
23:52 it's going to be where the place the folder where you have your user and in
23:54 folder where you have your user and in
23:54 folder where you have your user and in this you would find a folder named Dot
23:59 this you would find a folder named Dot
23:59 this you would find a folder named Dot SSH if you don't see this one maybe it's
24:02 SSH if you don't see this one maybe it's
24:02 SSH if you don't see this one maybe it's probably because it's hidden somewhere
24:03 probably because it's hidden somewhere
24:03 probably because it's hidden somewhere so you can click on view and show show
24:08 so you can click on view and show show
24:08 so you can click on view and show show hidden items okay something like that so
24:11 hidden items okay something like that so
24:12 hidden items okay something like that so if you find SSH folder in the directory
24:15 if you find SSH folder in the directory
24:15 if you find SSH folder in the directory for your main user you go in there and
24:19 for your main user you go in there and
24:19 for your main user you go in there and you have a file named non hosts I also
24:22 you have a file named non hosts I also
24:22 you have a file named non hosts I also have that one too and I'm just going to
24:24 have that one too and I'm just going to
24:24 have that one too and I'm just going to remove those okay so you just remove
24:27 remove those okay so you just remove
24:27 remove those okay so you just remove those files and that's it um if you
24:29 those files and that's it um if you
24:29 those files and that's it um if you really can't find this folder I guess
24:31 really can't find this folder I guess
24:32 really can't find this folder I guess it's okay if you don't have an error
24:33 it's okay if you don't have an error
24:33 it's okay if you don't have an error later on that's fine this is kind of a
24:35 later on that's fine this is kind of a
24:35 later on that's fine this is kind of a preventive step okay so now we can close
24:39 preventive step okay so now we can close
24:39 preventive step okay so now we can close this and we will need to open a terminal
24:41 this and we will need to open a terminal
24:41 this and we will need to open a terminal so how to open a terminal on Windows
24:44 so how to open a terminal on Windows
24:44 so how to open a terminal on Windows just go to the search bar or press the
24:46 just go to the search bar or press the
24:46 just go to the search bar or press the Windows key and type something like CMD
24:49 Windows key and type something like CMD
24:49 Windows key and type something like CMD okay command prompt you can open
24:52 okay command prompt you can open
24:52 okay command prompt you can open that okay I guess on micos is going to
24:55 that okay I guess on micos is going to
24:55 that okay I guess on micos is going to be similar and well if you using Linux
24:58 be similar and well if you using Linux
24:58 be similar and well if you using Linux you probably know how to open a terminal
25:00 you probably know how to open a terminal
25:00 you probably know how to open a terminal already so just open a terminal and the
25:02 already so just open a terminal and the
25:02 already so just open a terminal and the command is going to be the same for
25:03 command is going to be the same for
25:03 command is going to be the same for Windows Mac OS and Linux okay we are
25:06 Windows Mac OS and Linux okay we are
25:06 Windows Mac OS and Linux okay we are going to use the SSH command so if you
25:09 going to use the SSH command so if you
25:09 going to use the SSH command so if you press SSH and enter you should have this
25:12 press SSH and enter you should have this
25:13 press SSH and enter you should have this kind of message okay usage SSH that
25:17 kind of message okay usage SSH that
25:17 kind of message okay usage SSH that means that the SSH Common exists in some
25:19 means that the SSH Common exists in some
25:19 means that the SSH Common exists in some older versions of Windows you might not
25:22 older versions of Windows you might not
25:22 older versions of Windows you might not have ssh in this case you can use I'm
25:24 have ssh in this case you can use I'm
25:24 have ssh in this case you can use I'm putting on the screen here you can use a
25:26 putting on the screen here you can use a
25:27 putting on the screen here you can use a software called putty okay you can
25:28 software called putty okay you can
25:28 software called putty okay you can download it install it and just provide
25:31 download it install it and just provide
25:31 download it install it and just provide the IP address the username and the
25:33 the IP address the username and the
25:33 the IP address the username and the password to connect to SSH but I guess
25:36 password to connect to SSH but I guess
25:36 password to connect to SSH but I guess that for most of you watching this video
25:40 that for most of you watching this video
25:40 that for most of you watching this video you should be able to have the SSH
25:42 you should be able to have the SSH
25:42 you should be able to have the SSH Common installed on your computer so now
25:44 Common installed on your computer so now
25:44 Common installed on your computer so now what do we need to do well we will write
25:47 what do we need to do well we will write
25:47 what do we need to do well we will write SSH and space and then you need to put
25:50 SSH and space and then you need to put
25:50 SSH and space and then you need to put which user well you want to connect as
25:52 which user well you want to connect as
25:53 which user well you want to connect as on the Raspberry Pi and if you remember
25:55 on the Raspberry Pi and if you remember
25:55 on the Raspberry Pi and if you remember we have created a user with the name Pi
25:58 we have created a user with the name Pi
25:58 we have created a user with the name Pi okay so if you have used a different
26:00 okay so if you have used a different
26:00 okay so if you have used a different name change it here but if you just
26:03 name change it here but if you just
26:03 name change it here but if you just follow the video exactly as I did you
26:05 follow the video exactly as I did you
26:05 follow the video exactly as I did you should have the user Pi then you put the
26:08 should have the user Pi then you put the
26:08 should have the user Pi then you put the at and we will need to put the IP
26:10 at and we will need to put the IP
26:10 at and we will need to put the IP address of the Raspberry Pi so what's
26:12 address of the Raspberry Pi so what's
26:12 address of the Raspberry Pi so what's the IP address this is the one we have
26:14 the IP address this is the one we have
26:14 the IP address this is the one we have found right here so for me is
26:18 found right here so for me is
26:18 found right here so for me is
26:20 168 do
26:23 168 do
26:23 168 do 23.
26:24 23.
26:24 23. 222 so don't just copy this of course
26:27 222 so don't just copy this of course
26:27 222 so don't just copy this of course your IP address is is going to be uh
26:30 your IP address is is going to be uh
26:30 your IP address is is going to be uh different now I can press enter and if
26:33 different now I can press enter and if
26:33 different now I can press enter and if everything worked well you should see a
26:36 everything worked well you should see a
26:36 everything worked well you should see a message like this okay the authenticity
26:39 message like this okay the authenticity
26:39 message like this okay the authenticity of host etc etc basically the question
26:42 of host etc etc basically the question
26:42 of host etc etc basically the question is are you sure you want to continue yes
26:45 is are you sure you want to continue yes
26:45 is are you sure you want to continue yes or no and you just put yes and you press
26:49 or no and you just put yes and you press
26:49 or no and you just put yes and you press enter and now it should ask you for the
26:52 enter and now it should ask you for the
26:52 enter and now it should ask you for the password of the pi user okay if you
26:55 password of the pi user okay if you
26:55 password of the pi user okay if you didn't get that if you got an error with
26:57 didn't get that if you got an error with
26:57 didn't get that if you got an error with this no nonhost thingy then you need to
27:00 this no nonhost thingy then you need to
27:00 this no nonhost thingy then you need to go back and remove this nonhost file
27:03 go back and remove this nonhost file
27:03 go back and remove this nonhost file like I just show you in the beginning of
27:04 like I just show you in the beginning of
27:04 like I just show you in the beginning of the video but if you see the password
27:06 the video but if you see the password
27:06 the video but if you see the password like this all find you just put the
27:08 like this all find you just put the
27:08 like this all find you just put the password that you have provided during
27:11 password that you have provided during
27:11 password that you have provided during the setup so when you flashed the
27:12 the setup so when you flashed the
27:12 the setup so when you flashed the operating system and here you can see
27:15 operating system and here you can see
27:15 operating system and here you can see when I type something it doesn't show so
27:17 when I type something it doesn't show so
27:17 when I type something it doesn't show so you just type the password and you press
27:19 you just type the password and you press
27:19 you just type the password and you press enter if you provided the correct
27:21 enter if you provided the correct
27:21 enter if you provided the correct password now you can see that we are
27:24 password now you can see that we are
27:24 password now you can see that we are actually inside the Raspberry Pi okay
27:27 actually inside the Raspberry Pi okay
27:27 actually inside the Raspberry Pi okay it's not
27:29 it's not
27:29 it's not this anymore so we are not operating
27:31 this anymore so we are not operating
27:31 this anymore so we are not operating from Windows now you can see we have Pi
27:34 from Windows now you can see we have Pi
27:34 from Windows now you can see we have Pi at Raspberry Pi and we have a common
27:37 at Raspberry Pi and we have a common
27:37 at Raspberry Pi and we have a common line from inside the Raspberry Pi and
27:40 line from inside the Raspberry Pi and
27:40 line from inside the Raspberry Pi and well here if you have an error with the
27:41 well here if you have an error with the
27:41 well here if you have an error with the password it is simply because this is
27:43 password it is simply because this is
27:43 password it is simply because this is the wrong password okay if you manage to
27:46 the wrong password okay if you manage to
27:46 the wrong password okay if you manage to get there and the password doesn't work
27:48 get there and the password doesn't work
27:48 get there and the password doesn't work make sure you don't have a typo also
27:50 make sure you don't have a typo also
27:50 make sure you don't have a typo also make sure that maybe your keyboard is
27:51 make sure that maybe your keyboard is
27:51 make sure that maybe your keyboard is configured the same and you type exactly
27:54 configured the same and you type exactly
27:54 configured the same and you type exactly the same thing that you typed when you
27:56 the same thing that you typed when you
27:56 the same thing that you typed when you set up the Raspberry Pi and maybe you
27:58 set up the Raspberry Pi and maybe you
27:58 set up the Raspberry Pi and maybe you made a mistake and maybe you need to
28:00 made a mistake and maybe you need to
28:00 made a mistake and maybe you need to flash the operating system again if you
28:02 flash the operating system again if you
28:02 flash the operating system again if you provided a wrong password okay and now
28:04 provided a wrong password okay and now
28:04 provided a wrong password okay and now great we are on the Raspberry Pi so we
28:07 great we are on the Raspberry Pi so we
28:07 great we are on the Raspberry Pi so we have internal access to the Raspberry Pi
28:10 have internal access to the Raspberry Pi
28:10 have internal access to the Raspberry Pi the next thing we can do is to set up
28:12 the next thing we can do is to set up
28:12 the next thing we can do is to set up VNC so we can have access to the
28:17 desktop welcome back this is episode
28:20 desktop welcome back this is episode
28:20 desktop welcome back this is episode number three of this tutoral series on
28:22 number three of this tutoral series on
28:22 number three of this tutoral series on Raspberry Pi for complete beginners
28:25 Raspberry Pi for complete beginners
28:25 Raspberry Pi for complete beginners let's now install and configure VNC VNC
28:28 let's now install and configure VNC VNC
28:28 let's now install and configure VNC VNC will simply allow you to use the
28:29 will simply allow you to use the
28:29 will simply allow you to use the Raspberry Pi desktop from your own
28:32 Raspberry Pi desktop from your own
28:32 Raspberry Pi desktop from your own computer this is great so you don't need
28:34 computer this is great so you don't need
28:34 computer this is great so you don't need to only use the terminal with common
28:36 to only use the terminal with common
28:36 to only use the terminal with common length and you also don't need to have a
28:38 length and you also don't need to have a
28:38 length and you also don't need to have a monitor plugged to your Raspberry Pi
28:40 monitor plugged to your Raspberry Pi
28:40 monitor plugged to your Raspberry Pi even if you have a monitor you would see
28:42 even if you have a monitor you would see
28:42 even if you have a monitor you would see that it may be more convenient to work
28:45 that it may be more convenient to work
28:45 that it may be more convenient to work without it and the reason we did all
28:47 without it and the reason we did all
28:47 without it and the reason we did all this setup with SSH before is simply
28:49 this setup with SSH before is simply
28:49 this setup with SSH before is simply because we need to access the Raspberry
28:52 because we need to access the Raspberry
28:52 because we need to access the Raspberry p through SSH here so we can type a few
28:54 p through SSH here so we can type a few
28:54 p through SSH here so we can type a few command lines to configure and set up
28:57 command lines to configure and set up
28:57 command lines to configure and set up VNC so here make sure that you are
28:59 VNC so here make sure that you are
28:59 VNC so here make sure that you are connected to the Raspberry Pi okay you
29:01 connected to the Raspberry Pi okay you
29:02 connected to the Raspberry Pi okay you can see I have Pi at Raspberry Pi which
29:04 can see I have Pi at Raspberry Pi which
29:04 can see I have Pi at Raspberry Pi which means that I'm going to type commands
29:06 means that I'm going to type commands
29:06 means that I'm going to type commands inside the Raspberry Pi if you don't
29:08 inside the Raspberry Pi if you don't
29:08 inside the Raspberry Pi if you don't have this go back to the previous video
29:11 have this go back to the previous video
29:11 have this go back to the previous video and just note that here I am on the
29:13 and just note that here I am on the
29:13 and just note that here I am on the Raspberry Pi if I want to go back to my
29:15 Raspberry Pi if I want to go back to my
29:15 Raspberry Pi if I want to go back to my windows terminal or if you're on Linux
29:18 windows terminal or if you're on Linux
29:18 windows terminal or if you're on Linux or mic OS go back to your previous
29:20 or mic OS go back to your previous
29:20 or mic OS go back to your previous terminal you can just type exit and you
29:25 terminal you can just type exit and you
29:25 terminal you can just type exit and you can see now I have lost the connection
29:27 can see now I have lost the connection
29:27 can see now I have lost the connection it do doesn't mean that the Raspberry Pi
29:29 it do doesn't mean that the Raspberry Pi
29:29 it do doesn't mean that the Raspberry Pi is PED off okay it's still on it's just
29:31 is PED off okay it's still on it's just
29:31 is PED off okay it's still on it's just that you lost the connection and then
29:33 that you lost the connection and then
29:33 that you lost the connection and then with the up Arrow I can go back to
29:36 with the up Arrow I can go back to
29:36 with the up Arrow I can go back to running the same command I press enter I
29:38 running the same command I press enter I
29:38 running the same command I press enter I need to put the password
29:40 need to put the password
29:40 need to put the password again and you see here for example well
29:43 again and you see here for example well
29:43 again and you see here for example well I did a mistake so this is what you
29:44 I did a mistake so this is what you
29:44 I did a mistake so this is what you would have if you put the wrong
29:47 would have if you put the wrong
29:47 would have if you put the wrong password and if you put the right
29:49 password and if you put the right
29:49 password and if you put the right password so to use VNC we actually need
29:52 password so to use VNC we actually need
29:52 password so to use VNC we actually need to enable VNC because it's uh disabled
29:56 to enable VNC because it's uh disabled
29:56 to enable VNC because it's uh disabled by default and to do that we will will
29:58 by default and to do that we will will
29:58 by default and to do that we will will start a menu you can just type P sudo
30:01 start a menu you can just type P sudo
30:01 start a menu you can just type P sudo like that and then
30:04 like that and then
30:04 like that and then raspy Das config and you can press tab
30:07 raspy Das config and you can press tab
30:07 raspy Das config and you can press tab for autoc completion okay so Pudo
30:10 for autoc completion okay so Pudo
30:10 for autoc completion okay so Pudo raspi-config you press enter and you get
30:14 raspi-config you press enter and you get
30:14 raspi-config you press enter and you get to a menu like this that you can
30:16 to a menu like this that you can
30:16 to a menu like this that you can navigate with the uh arrows of your
30:18 navigate with the uh arrows of your
30:18 navigate with the uh arrows of your keyboard and we have two things to do
30:20 keyboard and we have two things to do
30:20 keyboard and we have two things to do here first you will go to interface
30:24 here first you will go to interface
30:24 here first you will go to interface options so you press enter then you go
30:27 options so you press enter then you go
30:27 options so you press enter then you go down to
30:28 down to
30:28 down to VNC press enter and would you like to uh
30:32 VNC press enter and would you like to uh
30:32 VNC press enter and would you like to uh so would you like the VNC server to be
30:34 so would you like the VNC server to be
30:34 so would you like the VNC server to be enabled you're going to go on yes press
30:37 enabled you're going to go on yes press
30:37 enabled you're going to go on yes press enter okay and you should go back to the
30:41 enter okay and you should go back to the
30:41 enter okay and you should go back to the menu the VNC server is enabled you press
30:45 menu the VNC server is enabled you press
30:45 menu the VNC server is enabled you press enter again and you are back to the menu
30:47 enter again and you are back to the menu
30:47 enter again and you are back to the menu now we're going to do one more step uh
30:49 now we're going to do one more step uh
30:49 now we're going to do one more step uh you're going to go to system options so
30:52 you're going to go to system options so
30:52 you're going to go to system options so that's the first menu here you press
30:53 that's the first menu here you press
30:53 that's the first menu here you press enter and then you go on boot Auto Lin
30:57 enter and then you go on boot Auto Lin
30:57 enter and then you go on boot Auto Lin so you should have a menu that looks
30:58 so you should have a menu that looks
30:58 so you should have a menu that looks like this and you're going to choose
31:01 like this and you're going to choose
31:01 like this and you're going to choose desktop or maybe desktop Auto Lin so
31:05 desktop or maybe desktop Auto Lin so
31:05 desktop or maybe desktop Auto Lin so just in case the default is console it
31:07 just in case the default is console it
31:07 just in case the default is console it means the desktop is not going to boot
31:10 means the desktop is not going to boot
31:10 means the desktop is not going to boot so with VNC because we want to get
31:12 so with VNC because we want to get
31:12 so with VNC because we want to get access to the desktop we want to make
31:13 access to the desktop we want to make
31:13 access to the desktop we want to make sure that the desktop is enabled and you
31:16 sure that the desktop is enabled and you
31:16 sure that the desktop is enabled and you can choose desktop in this case you will
31:18 can choose desktop in this case you will
31:18 can choose desktop in this case you will have to login uh into the desktop I'm
31:20 have to login uh into the desktop I'm
31:20 have to login uh into the desktop I'm just going to choose Auto Lin for
31:22 just going to choose Auto Lin for
31:22 just going to choose Auto Lin for Simplicity so when we uh log actually
31:25 Simplicity so when we uh log actually
31:25 Simplicity so when we uh log actually through VNC to get to the Rasberry pios
31:28 through VNC to get to the Rasberry pios
31:28 through VNC to get to the Rasberry pios we directly arrive to the desktop and
31:31 we directly arrive to the desktop and
31:31 we directly arrive to the desktop and everything is correctly configured so
31:33 everything is correctly configured so
31:33 everything is correctly configured so I'm going to press enter on this
31:35 I'm going to press enter on this
31:36 I'm going to press enter on this option okay we go back to the menu and
31:39 option okay we go back to the menu and
31:39 option okay we go back to the menu and then I click on the right arrow to go to
31:41 then I click on the right arrow to go to
31:41 then I click on the right arrow to go to finish and it's going to ask us to
31:44 finish and it's going to ask us to
31:44 finish and it's going to ask us to reboot so I can press
31:47 reboot so I can press
31:47 reboot so I can press yes and as you can see we lose the
31:50 yes and as you can see we lose the
31:50 yes and as you can see we lose the connection why do we lose the connection
31:52 connection why do we lose the connection
31:52 connection why do we lose the connection because well the Raspberry Pi is
31:54 because well the Raspberry Pi is
31:54 because well the Raspberry Pi is rebooting if it's rebooting then of
31:56 rebooting if it's rebooting then of
31:56 rebooting if it's rebooting then of course we lose the s connection and we
31:58 course we lose the s connection and we
31:58 course we lose the s connection and we are back to the uh here to the windows
32:02 are back to the uh here to the windows
32:02 are back to the uh here to the windows terminal so we just need to wait that
32:04 terminal so we just need to wait that
32:04 terminal so we just need to wait that the Raspberry Pi is back on the network
32:06 the Raspberry Pi is back on the network
32:06 the Raspberry Pi is back on the network and then well we should not need uh to
32:09 and then well we should not need uh to
32:09 and then well we should not need uh to use the terminal here again so I'm going
32:12 use the terminal here again so I'm going
32:12 use the terminal here again so I'm going to close that I'm going to keep that on
32:13 to close that I'm going to keep that on
32:13 to close that I'm going to keep that on the side for later and what do we do now
32:16 the side for later and what do we do now
32:16 the side for later and what do we do now so the Raspberry p should be back on the
32:19 so the Raspberry p should be back on the
32:19 so the Raspberry p should be back on the network with the VNC server enabled so
32:23 network with the VNC server enabled so
32:23 network with the VNC server enabled so what we need is a VNC client so that we
32:25 what we need is a VNC client so that we
32:25 what we need is a VNC client so that we can uh well we can use a software to
32:28 can uh well we can use a software to
32:28 can uh well we can use a software to use VNC and connect to the rer and to do
32:31 use VNC and connect to the rer and to do
32:31 use VNC and connect to the rer and to do that I'm going to so you can open a web
32:34 that I'm going to so you can open a web
32:34 that I'm going to so you can open a web browser and we're going to use tiger VNC
32:38 browser and we're going to use tiger VNC
32:38 browser and we're going to use tiger VNC so there are lots of different VNC
32:40 so there are lots of different VNC
32:40 so there are lots of different VNC clients VNC viewers here we're going to
32:43 clients VNC viewers here we're going to
32:43 clients VNC viewers here we're going to use tiger VNC so you can just type tiger
32:45 use tiger VNC so you can just type tiger
32:45 use tiger VNC so you can just type tiger VNC in Google and go to tiger vc.org so
32:50 VNC in Google and go to tiger vc.org so
32:50 VNC in Google and go to tiger vc.org so they don't have executable to download
32:53 they don't have executable to download
32:53 they don't have executable to download here but you can go you can see you can
32:56 here but you can go you can see you can
32:56 here but you can go you can see you can go on the GTH Hub release page and you
32:59 go on the GTH Hub release page and you
32:59 go on the GTH Hub release page and you see that uh they say that they have uh
33:02 see that uh they say that they have uh
33:02 see that uh they say that they have uh binaries for Linux windows and also Mac
33:07 binaries for Linux windows and also Mac
33:07 binaries for Linux windows and also Mac so you click here okay and on releases
33:11 so you click here okay and on releases
33:11 so you click here okay and on releases you're going to get to GitHub don't
33:12 you're going to get to GitHub don't
33:12 you're going to get to GitHub don't worry about this just get the latest
33:14 worry about this just get the latest
33:14 worry about this just get the latest release uh it can be another version
33:16 release uh it can be another version
33:16 release uh it can be another version than this one it's okay and then they
33:19 than this one it's okay and then they
33:19 than this one it's okay and then they will give you a link here to Source
33:22 will give you a link here to Source
33:22 will give you a link here to Source Forge so you click on that link and you
33:24 Forge so you click on that link and you
33:24 Forge so you click on that link and you go to Source Forge where you can
33:26 go to Source Forge where you can
33:26 go to Source Forge where you can download the uh latest so you can click
33:29 download the uh latest so you can click
33:29 download the uh latest so you can click here on this button for Windows but if
33:31 here on this button for Windows but if
33:31 here on this button for Windows but if you're on other operating system you can
33:33 you're on other operating system you can
33:33 you're on other operating system you can see you have other versions you can
33:34 see you have other versions you can
33:34 see you have other versions you can choose your operating system okay and
33:37 choose your operating system okay and
33:37 choose your operating system okay and I'm just going to click here to
33:39 I'm just going to click here to
33:39 I'm just going to click here to download okay your download will start
33:42 download okay your download will start
33:42 download okay your download will start shortly we just wait for this we don't
33:45 shortly we just wait for this we don't
33:45 shortly we just wait for this we don't click on
33:48 anything okay and it's downloading and
33:51 anything okay and it's downloading and
33:51 anything okay and it's downloading and then we can install so just
33:55 then we can install so just
33:55 then we can install so just click um okay
33:58 click um okay
33:59 click um okay so somehow my Windows Defender doesn't
34:01 so somehow my Windows Defender doesn't
34:01 so somehow my Windows Defender doesn't like this uh I'm going to click on more
34:03 like this uh I'm going to click on more
34:03 like this uh I'm going to click on more info and just run anyway okay if you
34:06 info and just run anyway okay if you
34:06 info and just run anyway okay if you follow so here I'm going to say yes I
34:09 follow so here I'm going to say yes I
34:09 follow so here I'm going to say yes I have a popup to allow the software to
34:11 have a popup to allow the software to
34:11 have a popup to allow the software to run so if you follow the links from the
34:13 run so if you follow the links from the
34:13 run so if you follow the links from the official website of tiger VNC it should
34:15 official website of tiger VNC it should
34:15 official website of tiger VNC it should be fine okay don't go to other links
34:18 be fine okay don't go to other links
34:18 be fine okay don't go to other links than that and now we are on the uh setup
34:21 than that and now we are on the uh setup
34:21 than that and now we are on the uh setup so
34:22 so
34:22 so next accept the agreement and you can
34:25 next accept the agreement and you can
34:26 next accept the agreement and you can install it okay next
34:29 install it okay next
34:29 install it okay next install finish and then you can just uh
34:33 install finish and then you can just uh
34:33 install finish and then you can just uh go to the search bar or press Windows
34:36 go to the search bar or press Windows
34:36 go to the search bar or press Windows key for example and type tiger
34:39 key for example and type tiger
34:39 key for example and type tiger VNC and just launch tiger VNC so it's
34:42 VNC and just launch tiger VNC so it's
34:42 VNC and just launch tiger VNC so it's going to be empty like
34:43 going to be empty like
34:43 going to be empty like that all right so here the interface is
34:46 that all right so here the interface is
34:46 that all right so here the interface is quite simple here you're going to put
34:48 quite simple here you're going to put
34:48 quite simple here you're going to put simply the IP address of the Raspberry p
34:52 simply the IP address of the Raspberry p
34:52 simply the IP address of the Raspberry p you have some options that might be it
34:55 you have some options that might be it
34:55 you have some options that might be it might be Auto Select by default
34:58 might be Auto Select by default
34:58 might be Auto Select by default but you don't need to change anything on
34:59 but you don't need to change anything on
34:59 but you don't need to change anything on the options for now so I'm just going to
35:01 the options for now so I'm just going to
35:01 the options for now so I'm just going to leave it by default and you will put the
35:04 leave it by default and you will put the
35:04 leave it by default and you will put the IP address so for me it was
35:07 IP address so for me it was
35:07 IP address so for me it was
35:12 222 and here once again it's very
35:15 222 and here once again it's very
35:15 222 and here once again it's very important that you are so your computer
35:17 important that you are so your computer
35:17 important that you are so your computer here is on the same network as the
35:19 here is on the same network as the
35:19 here is on the same network as the Raspberry Pi because once again if you
35:22 Raspberry Pi because once again if you
35:22 Raspberry Pi because once again if you are not then you won't be able to find
35:23 are not then you won't be able to find
35:23 are not then you won't be able to find the pi from your computer so once I have
35:26 the pi from your computer so once I have
35:26 the pi from your computer so once I have put the IP address here I can click on
35:28 put the IP address here I can click on
35:28 put the IP address here I can click on connect and very shortly after you
35:31 connect and very shortly after you
35:31 connect and very shortly after you should have something like that so
35:34 should have something like that so
35:34 should have something like that so certificate Etc do you want to make an
35:36 certificate Etc do you want to make an
35:36 certificate Etc do you want to make an exception for the server so you can
35:38 exception for the server so you can
35:38 exception for the server so you can click on yes okay this is just security
35:42 click on yes okay this is just security
35:42 click on yes okay this is just security warning because we don't have any
35:43 warning because we don't have any
35:43 warning because we don't have any certificate but it doesn't really matter
35:44 certificate but it doesn't really matter
35:44 certificate but it doesn't really matter you just click on yes and you can see
35:48 you just click on yes and you can see
35:48 you just click on yes and you can see here now we have username and password
35:51 here now we have username and password
35:51 here now we have username and password so if you reach that it means that the
35:53 so if you reach that it means that the
35:53 so if you reach that it means that the VNC server is actually working and you
35:54 VNC server is actually working and you
35:55 VNC server is actually working and you could find it now you just need to put
35:56 could find it now you just need to put
35:56 could find it now you just need to put username will be pi and the password is
35:59 username will be pi and the password is
35:59 username will be pi and the password is the same that you put before for SSH and
36:02 the same that you put before for SSH and
36:02 the same that you put before for SSH and it's the one that you have set when you
36:04 it's the one that you have set when you
36:04 it's the one that you have set when you flashed the Raspberry Pi OS and click on
36:08 flashed the Raspberry Pi OS and click on
36:08 flashed the Raspberry Pi OS and click on okay and we are on the Raspberry Pi
36:11 okay and we are on the Raspberry Pi
36:11 okay and we are on the Raspberry Pi desktop so this what you see here this
36:14 desktop so this what you see here this
36:14 desktop so this what you see here this is not my Windows computer this is the
36:16 is not my Windows computer this is the
36:16 is not my Windows computer this is the desktop of the Raspberry Pi and here
36:19 desktop of the Raspberry Pi and here
36:19 desktop of the Raspberry Pi and here just a quick parenthesis so here I have
36:21 just a quick parenthesis so here I have
36:21 just a quick parenthesis so here I have selected the uh so the IP address that I
36:23 selected the uh so the IP address that I
36:23 selected the uh so the IP address that I have found here okay so if you get
36:26 have found here okay so if you get
36:26 have found here okay so if you get access to uh this it's working correctly
36:28 access to uh this it's working correctly
36:28 access to uh this it's working correctly but let's say that in the future you try
36:30 but let's say that in the future you try
36:30 but let's say that in the future you try again with the same IP address for
36:33 again with the same IP address for
36:33 again with the same IP address for example you try tomorrow or in one week
36:35 example you try tomorrow or in one week
36:35 example you try tomorrow or in one week and it doesn't work anymore why is that
36:37 and it doesn't work anymore why is that
36:37 and it doesn't work anymore why is that probably because the IP address so the
36:39 probably because the IP address so the
36:39 probably because the IP address so the network mask may have changed so in this
36:42 network mask may have changed so in this
36:43 network mask may have changed so in this case I recommend that you just uh find
36:45 case I recommend that you just uh find
36:45 case I recommend that you just uh find the IP address of the Raspberry Pi
36:47 the IP address of the Raspberry Pi
36:47 the IP address of the Raspberry Pi before okay so in the case that it works
36:50 before okay so in the case that it works
36:50 before okay so in the case that it works now and that let's say tomorrow it
36:52 now and that let's say tomorrow it
36:52 now and that let's say tomorrow it doesn't work anymore it's probably
36:54 doesn't work anymore it's probably
36:54 doesn't work anymore it's probably because maybe the IP address changed it
36:56 because maybe the IP address changed it
36:57 because maybe the IP address changed it happens for me for example I use my
36:59 happens for me for example I use my
36:59 happens for me for example I use my smartphone as a hotspot and somehow when
37:02 smartphone as a hotspot and somehow when
37:02 smartphone as a hotspot and somehow when I disconnect the hotspot and I create a
37:04 I disconnect the hotspot and I create a
37:04 I disconnect the hotspot and I create a new one it gives a different IP address
37:08 new one it gives a different IP address
37:08 new one it gives a different IP address so the IP address I have today uh is not
37:10 so the IP address I have today uh is not
37:10 so the IP address I have today uh is not going to be the same as the one I have
37:11 going to be the same as the one I have
37:11 going to be the same as the one I have tomorrow so probably is a way to to fix
37:14 tomorrow so probably is a way to to fix
37:14 tomorrow so probably is a way to to fix that but it's going to be more complex
37:16 that but it's going to be more complex
37:16 that but it's going to be more complex but just know that you might have to uh
37:19 but just know that you might have to uh
37:19 but just know that you might have to uh check the IP address again just in case
37:22 check the IP address again just in case
37:22 check the IP address again just in case it works now and it doesn't work in the
37:24 it works now and it doesn't work in the
37:24 it works now and it doesn't work in the future but if it doesn't work now well
37:26 future but if it doesn't work now well
37:26 future but if it doesn't work now well you need to go back and make make sure
37:27 you need to go back and make make sure
37:27 you need to go back and make make sure that you can connect with SSH make sure
37:29 that you can connect with SSH make sure
37:29 that you can connect with SSH make sure that you can access the menu that we
37:31 that you can access the menu that we
37:31 that you can access the menu that we just did in this video and that the well
37:34 just did in this video and that the well
37:34 just did in this video and that the well the VNC server is enabled and that you
37:36 the VNC server is enabled and that you
37:36 the VNC server is enabled and that you can download the tiger VNC
37:39 can download the tiger VNC
37:39 can download the tiger VNC client and I'm just adding this small
37:41 client and I'm just adding this small
37:42 client and I'm just adding this small extra troubleshooting parenthesis here
37:44 extra troubleshooting parenthesis here
37:44 extra troubleshooting parenthesis here okay to address the issue where you
37:46 okay to address the issue where you
37:46 okay to address the issue where you could have at this point not you would
37:48 could have at this point not you would
37:48 could have at this point not you would not see the desktop but you would see a
37:50 not see the desktop but you would see a
37:50 not see the desktop but you would see a gray screen so you could still connect
37:53 gray screen so you could still connect
37:53 gray screen so you could still connect with tiger VNC but you would see a gray
37:56 with tiger VNC but you would see a gray
37:56 with tiger VNC but you would see a gray screen uh that has happened to me
37:58 screen uh that has happened to me
37:59 screen uh that has happened to me recently when I tried on the Raspberry
38:01 recently when I tried on the Raspberry
38:01 recently when I tried on the Raspberry Pi 4 so I don't know if it's due to
38:03 Pi 4 so I don't know if it's due to
38:03 Pi 4 so I don't know if it's due to Raspberry Pi 4 I could try again here on
38:05 Raspberry Pi 4 I could try again here on
38:05 Raspberry Pi 4 I could try again here on the Raspberry Pi 5 it works correctly
38:07 the Raspberry Pi 5 it works correctly
38:07 the Raspberry Pi 5 it works correctly but anyway if you have a gray screen
38:09 but anyway if you have a gray screen
38:09 but anyway if you have a gray screen well it means you won't see that so
38:11 well it means you won't see that so
38:11 well it means you won't see that so probably you just uh close tiger VNC and
38:15 probably you just uh close tiger VNC and
38:15 probably you just uh close tiger VNC and then what we will do is uh go back to
38:17 then what we will do is uh go back to
38:17 then what we will do is uh go back to the terminal okay so you should be able
38:20 the terminal okay so you should be able
38:20 the terminal okay so you should be able to connect with SSH we're going to go
38:22 to connect with SSH we're going to go
38:22 to connect with SSH we're going to go back here so I put the password we go
38:27 back here so I put the password we go
38:27 back here so I put the password we go back to the Raspberry Pi with
38:29 back to the Raspberry Pi with
38:29 back to the Raspberry Pi with SSH and we are going to do a pseudo AP
38:32 SSH and we are going to do a pseudo AP
38:32 SSH and we are going to do a pseudo AP update okay so you write exactly this
38:35 update okay so you write exactly this
38:35 update okay so you write exactly this command sud sudo AP update you press
38:39 command sud sudo AP update you press
38:39 command sud sudo AP update you press enter you might need to put your
38:41 enter you might need to put your
38:41 enter you might need to put your password but here it works okay it's
38:44 password but here it works okay it's
38:44 password but here it works okay it's going to update the packages and then
38:46 going to update the packages and then
38:46 going to update the packages and then you need to do pseudo
38:49 you need to do pseudo
38:49 you need to do pseudo AP upgrade okay so actually update is
38:53 AP upgrade okay so actually update is
38:53 AP upgrade okay so actually update is going to fetch the new packages and
38:55 going to fetch the new packages and
38:56 going to fetch the new packages and upgrade is going to update them this is
38:58 upgrade is going to update them this is
38:58 upgrade is going to update them this is something we're going to see a bit later
38:59 something we're going to see a bit later
39:00 something we're going to see a bit later when we talk about Linux so you don't
39:01 when we talk about Linux so you don't
39:01 when we talk about Linux so you don't really need to worry about this for now
39:03 really need to worry about this for now
39:03 really need to worry about this for now you just type those comments exactly so
39:05 you just type those comments exactly so
39:05 you just type those comments exactly so you upgrade this is probably going to
39:07 you upgrade this is probably going to
39:07 you upgrade this is probably going to show you a lot of packages and it's
39:09 show you a lot of packages and it's
39:09 show you a lot of packages and it's going to stop and ask you to uh validate
39:12 going to stop and ask you to uh validate
39:12 going to stop and ask you to uh validate so you just press enter and then you can
39:14 so you just press enter and then you can
39:14 so you just press enter and then you can wait so you might wait for 10 15 minutes
39:17 wait so you might wait for 10 15 minutes
39:17 wait so you might wait for 10 15 minutes for everything to be updated here it
39:19 for everything to be updated here it
39:19 for everything to be updated here it shows me zero to upgrade because I have
39:23 shows me zero to upgrade because I have
39:23 shows me zero to upgrade because I have actually already upgraded the system
39:24 actually already upgraded the system
39:24 actually already upgraded the system before but for you it might take well
39:27 before but for you it might take well
39:27 before but for you it might take well like I told you 10 to 15 minutes depends
39:29 like I told you 10 to 15 minutes depends
39:29 like I told you 10 to 15 minutes depends and then after that you can reboot the
39:31 and then after that you can reboot the
39:31 and then after that you can reboot the Raspberry Pi how do you reboot the
39:33 Raspberry Pi how do you reboot the
39:33 Raspberry Pi how do you reboot the Raspberry Pi well we're not gonna take
39:35 Raspberry Pi well we're not gonna take
39:35 Raspberry Pi well we're not gonna take the cable out and put it again no we can
39:38 the cable out and put it again no we can
39:38 the cable out and put it again no we can use pseudo and then roboot just like
39:42 use pseudo and then roboot just like
39:42 use pseudo and then roboot just like that so you press enter okay you can see
39:45 that so you press enter okay you can see
39:45 that so you press enter okay you can see the system will reboot now and now we
39:47 the system will reboot now and now we
39:47 the system will reboot now and now we lose the connection okay because if you
39:49 lose the connection okay because if you
39:49 lose the connection okay because if you reboot then well the Raspberry Pi is
39:51 reboot then well the Raspberry Pi is
39:51 reboot then well the Raspberry Pi is shut down so you lose the connection and
39:53 shut down so you lose the connection and
39:53 shut down so you lose the connection and then you can go back to uh tiger so
39:56 then you can go back to uh tiger so
39:56 then you can go back to uh tiger so tiger VNC
39:59 so you should wait a bit okay maybe 30
40:02 so you should wait a bit okay maybe 30
40:02 so you should wait a bit okay maybe 30 seconds let's try to
40:04 seconds let's try to
40:04 seconds let's try to connect okay we have this again so
40:09 connect okay we have this again so
40:09 connect okay we have this again so pi and then the
40:11 pi and then the
40:11 pi and then the password and you should be able to get
40:14 password and you should be able to get
40:14 password and you should be able to get to this what we do know are the last
40:18 to this what we do know are the last
40:18 to this what we do know are the last steps so after this everything will be
40:20 steps so after this everything will be
40:20 steps so after this everything will be fully configured so we got access to the
40:23 fully configured so we got access to the
40:23 fully configured so we got access to the Raspberry Pi desktop with VNC and we're
40:26 Raspberry Pi desktop with VNC and we're
40:26 Raspberry Pi desktop with VNC and we're just going to do a few things here get
40:28 just going to do a few things here get
40:28 just going to do a few things here get used to the desktop uh check a few
40:30 used to the desktop uh check a few
40:31 used to the desktop uh check a few options okay do some updates Etc so
40:34 options okay do some updates Etc so
40:34 options okay do some updates Etc so first of all here to go full screen I uh
40:37 first of all here to go full screen I uh
40:37 first of all here to go full screen I uh click if I click on f8 I should be able
40:40 click if I click on f8 I should be able
40:40 click if I click on f8 I should be able to get this menu okay and you can click
40:43 to get this menu okay and you can click
40:43 to get this menu okay and you can click on full screen and so if I click on f8
40:47 on full screen and so if I click on f8
40:47 on full screen and so if I click on f8 again so I need to click on the desktop
40:49 again so I need to click on the desktop
40:49 again so I need to click on the desktop f8 I can uh go back to the uh previous
40:53 f8 I can uh go back to the uh previous
40:53 f8 I can uh go back to the uh previous mod okay you also have the options so
40:56 mod okay you also have the options so
40:56 mod okay you also have the options so this is the options of tiger VNC okay
40:58 this is the options of tiger VNC okay
40:58 this is the options of tiger VNC okay it's not raspberry piie it's about tiger
41:00 it's not raspberry piie it's about tiger
41:00 it's not raspberry piie it's about tiger VNC um about different options for
41:04 VNC um about different options for
41:04 VNC um about different options for encoding if you have weird colors here
41:06 encoding if you have weird colors here
41:06 encoding if you have weird colors here you might uh select for example tight or
41:10 you might uh select for example tight or
41:10 you might uh select for example tight or X stle well it doesn't really matter but
41:12 X stle well it doesn't really matter but
41:12 X stle well it doesn't really matter but if you have weird colors you might
41:14 if you have weird colors you might
41:14 if you have weird colors you might change the encoding here apart from that
41:17 change the encoding here apart from that
41:17 change the encoding here apart from that I would not really change anything so
41:20 I would not really change anything so
41:20 I would not really change anything so what do we have on this desktop well we
41:22 what do we have on this desktop well we
41:22 what do we have on this desktop well we have a menu bar on top so if you used to
41:25 have a menu bar on top so if you used to
41:25 have a menu bar on top so if you used to uh Windows the menu bar is at the bottom
41:27 uh Windows the menu bar is at the bottom
41:27 uh Windows the menu bar is at the bottom it's basically the same thing and the
41:29 it's basically the same thing and the
41:29 it's basically the same thing and the first thing I'm going to do so I'm going
41:31 first thing I'm going to do so I'm going
41:31 first thing I'm going to do so I'm going to click on this launch menu and go to
41:35 to click on this launch menu and go to
41:35 to click on this launch menu and go to preferences and appearance settings okay
41:39 preferences and appearance settings okay
41:39 preferences and appearance settings okay so this is optional I'm just doing this
41:41 so this is optional I'm just doing this
41:41 so this is optional I'm just doing this so that when I do the course you can
41:43 so that when I do the course you can
41:43 so that when I do the course you can easily read and see what I'm doing so if
41:46 easily read and see what I'm doing so if
41:46 easily read and see what I'm doing so if I go on
41:48 I go on
41:48 I go on taskbar I can choose uh the size okay
41:51 taskbar I can choose uh the size okay
41:51 taskbar I can choose uh the size okay and I'm going to go from large to very
41:53 and I'm going to go from large to very
41:53 and I'm going to go from large to very large you can see it's bigger so you
41:55 large you can see it's bigger so you
41:55 large you can see it's bigger so you don't need to do that but it's going to
41:56 don't need to do that but it's going to
41:56 don't need to do that but it's going to be easy iier for you to read on my
41:58 be easy iier for you to read on my
41:58 be easy iier for you to read on my screen when I record the course okay and
42:01 screen when I record the course okay and
42:01 screen when I record the course okay and I can also put the menu on the bottom if
42:03 I can also put the menu on the bottom if
42:03 I can also put the menu on the bottom if I want I'm going to leave it at the top
42:06 I want I'm going to leave it at the top
42:06 I want I'm going to leave it at the top now if I go on system I'm also going to
42:08 now if I go on system I'm also going to
42:08 now if I go on system I'm also going to increase the font size from 12 to I
42:11 increase the font size from 12 to I
42:11 increase the font size from 12 to I don't know something like 15 I might
42:13 don't know something like 15 I might
42:13 don't know something like 15 I might increase it a bit later face it's not
42:16 increase it a bit later face it's not
42:17 increase it a bit later face it's not enough okay so with this the text is
42:19 enough okay so with this the text is
42:19 enough okay so with this the text is bigger and you can try the Dark theme
42:21 bigger and you can try the Dark theme
42:21 bigger and you can try the Dark theme Etc okay so I click on okay and now
42:25 Etc okay so I click on okay and now
42:25 Etc okay so I click on okay and now while the the important thing to check
42:26 while the the important thing to check
42:26 while the the important thing to check you go back to the menu here
42:29 you go back to the menu here
42:29 you go back to the menu here preferences and Raspberry Pi
42:32 preferences and Raspberry Pi
42:32 preferences and Raspberry Pi configuration and here you can see you
42:34 configuration and here you can see you
42:34 configuration and here you can see you have the password so if you want to
42:35 have the password so if you want to
42:36 have the password so if you want to change the password you can do it here
42:37 change the password you can do it here
42:37 change the password you can do it here you can change the host name make sure
42:39 you can change the host name make sure
42:40 you can change the host name make sure that well the boot option is to desktop
42:41 that well the boot option is to desktop
42:41 that well the boot option is to desktop so make sure to keep that you can enable
42:43 so make sure to keep that you can enable
42:43 so make sure to keep that you can enable disable the auto login Etc if I go on
42:47 disable the auto login Etc if I go on
42:47 disable the auto login Etc if I go on interfaces uh you can see we have the
42:49 interfaces uh you can see we have the
42:49 interfaces uh you can see we have the VNC server that's enabled so don't
42:52 VNC server that's enabled so don't
42:52 VNC server that's enabled so don't disable it and you have other stuff here
42:54 disable it and you have other stuff here
42:54 disable it and you have other stuff here so SSH is enabled as well and then on
42:57 so SSH is enabled as well and then on
42:57 so SSH is enabled as well and then on localization you can also change a local
43:00 localization you can also change a local
43:00 localization you can also change a local if needed time zone keyboard so you have
43:02 if needed time zone keyboard so you have
43:02 if needed time zone keyboard so you have all the options here in this Raspberry
43:04 all the options here in this Raspberry
43:04 all the options here in this Raspberry Pi configuration menu then what we can
43:07 Pi configuration menu then what we can
43:07 Pi configuration menu then what we can check is you see we have the Wi-Fi here
43:10 check is you see we have the Wi-Fi here
43:10 check is you see we have the Wi-Fi here so this is your Wi-Fi network this is
43:12 so this is your Wi-Fi network this is
43:12 so this is your Wi-Fi network this is the one I have chosen okay you can even
43:14 the one I have chosen okay you can even
43:14 the one I have chosen okay you can even see the IP address we have the Bluetooth
43:17 see the IP address we have the Bluetooth
43:17 see the IP address we have the Bluetooth that's enabled by default I guess I can
43:20 that's enabled by default I guess I can
43:20 that's enabled by default I guess I can turn it off okay since we don't need it
43:22 turn it off okay since we don't need it
43:22 turn it off okay since we don't need it for now and then that's pretty much it
43:24 for now and then that's pretty much it
43:24 for now and then that's pretty much it so one thing we're going to do is to
43:27 so one thing we're going to do is to
43:27 so one thing we're going to do is to update the software so here on the top
43:28 update the software so here on the top
43:29 update the software so here on the top you can see we have this updates are
43:31 you can see we have this updates are
43:31 you can see we have this updates are available click to install box uh you
43:34 available click to install box uh you
43:34 available click to install box uh you can see the updates but you can just
43:35 can see the updates but you can just
43:35 can see the updates but you can just install the update okay and this is
43:39 install the update okay and this is
43:39 install the update okay and this is going to take a few minutes okay so you
43:40 going to take a few minutes okay so you
43:40 going to take a few minutes okay so you can wait now you might think why do we
43:42 can wait now you might think why do we
43:42 can wait now you might think why do we need to update the system if we just
43:44 need to update the system if we just
43:44 need to update the system if we just installed it well you installed a
43:46 installed it well you installed a
43:46 installed it well you installed a version that was kind of Frozen at some
43:49 version that was kind of Frozen at some
43:49 version that was kind of Frozen at some point and since this point there's been
43:51 point and since this point there's been
43:51 point and since this point there's been new versions for the software that you
43:53 new versions for the software that you
43:53 new versions for the software that you already have in the Raspberry Pi OS so
43:56 already have in the Raspberry Pi OS so
43:56 already have in the Raspberry Pi OS so by doing this you make sure that
43:58 by doing this you make sure that
43:58 by doing this you make sure that everything is up to date okay and I
44:00 everything is up to date okay and I
44:00 everything is up to date okay and I recommend that as soon as you see that
44:02 recommend that as soon as you see that
44:02 recommend that as soon as you see that updates are available you update your
44:04 updates are available you update your
44:04 updates are available you update your system again so let's just wait for a
44:07 system again so let's just wait for a
44:07 system again so let's just wait for a few
44:08 few
44:08 few minutes all right and in the end you
44:11 minutes all right and in the end you
44:11 minutes all right and in the end you will see this system is up to date so
44:14 will see this system is up to date so
44:14 will see this system is up to date so for me in this case it took about well
44:17 for me in this case it took about well
44:17 for me in this case it took about well something like 15 minutes so that's
44:18 something like 15 minutes so that's
44:18 something like 15 minutes so that's still quite long it's not going to be 15
44:20 still quite long it's not going to be 15
44:20 still quite long it's not going to be 15 minutes every time basically the first
44:22 minutes every time basically the first
44:22 minutes every time basically the first time might be long and then if you wait
44:24 time might be long and then if you wait
44:24 time might be long and then if you wait for a few weeks or a few months and you
44:26 for a few weeks or a few months and you
44:26 for a few weeks or a few months and you don't update your system of course
44:27 don't update your system of course
44:27 don't update your system of course there's going to be more packages to
44:29 there's going to be more packages to
44:29 there's going to be more packages to update so if you do it quite frequently
44:32 update so if you do it quite frequently
44:32 update so if you do it quite frequently it's going to be quite quick and when
44:33 it's going to be quite quick and when
44:33 it's going to be quite quick and when you have this you can just click on okay
44:35 you have this you can just click on okay
44:35 you have this you can just click on okay and that's basically it your Raspberry
44:37 and that's basically it your Raspberry
44:37 and that's basically it your Raspberry Pi OS is correctly configured and now
44:40 Pi OS is correctly configured and now
44:40 Pi OS is correctly configured and now before we continue I actually need to
44:41 before we continue I actually need to
44:41 before we continue I actually need to show you something that's well quite
44:43 show you something that's well quite
44:44 show you something that's well quite important is how to shut down your
44:46 important is how to shut down your
44:46 important is how to shut down your Raspberry Pi properly because you might
44:48 Raspberry Pi properly because you might
44:48 Raspberry Pi properly because you might think well you just need to remove the
44:50 think well you just need to remove the
44:50 think well you just need to remove the the power cable and that's what we did
44:52 the power cable and that's what we did
44:52 the power cable and that's what we did once uh during the setup to find the IP
44:55 once uh during the setup to find the IP
44:55 once uh during the setup to find the IP address okay it's not ideal but some
44:57 address okay it's not ideal but some
44:57 address okay it's not ideal but some sometimes you need to do it but if you
44:59 sometimes you need to do it but if you
44:59 sometimes you need to do it but if you have access to the Raspberry p desktop
45:01 have access to the Raspberry p desktop
45:01 have access to the Raspberry p desktop like this well you should definitely
45:03 like this well you should definitely
45:03 like this well you should definitely shut it down like you would shut down a
45:05 shut it down like you would shut down a
45:05 shut it down like you would shut down a normal computer you have a menu here and
45:08 normal computer you have a menu here and
45:08 normal computer you have a menu here and you click on shut down you can shut down
45:10 you click on shut down you can shut down
45:10 you click on shut down you can shut down a roboot you click on shut down and you
45:13 a roboot you click on shut down and you
45:13 a roboot you click on shut down and you can see then you will lose of course the
45:16 can see then you will lose of course the
45:16 can see then you will lose of course the VNC connection and that's normal because
45:20 VNC connection and that's normal because
45:20 VNC connection and that's normal because if you shut down then the VNC server is
45:22 if you shut down then the VNC server is
45:22 if you shut down then the VNC server is turned off and you lose the VNC
45:25 turned off and you lose the VNC
45:25 turned off and you lose the VNC connection okay so I recommend that you
45:27 connection okay so I recommend that you
45:27 connection okay so I recommend that you always shut down your raspberry pipe
45:28 always shut down your raspberry pipe
45:28 always shut down your raspberry pipe properly simply because well imagine
45:31 properly simply because well imagine
45:31 properly simply because well imagine another computer you don't remove the
45:33 another computer you don't remove the
45:33 another computer you don't remove the battery of the computer or you don't
45:34 battery of the computer or you don't
45:35 battery of the computer or you don't just unplug it from the wall you shut
45:36 just unplug it from the wall you shut
45:37 just unplug it from the wall you shut down your computer properly I mean I
45:38 down your computer properly I mean I
45:38 down your computer properly I mean I hope you do so same thing for the
45:40 hope you do so same thing for the
45:41 hope you do so same thing for the raspberry pip as much as possible try to
45:43 raspberry pip as much as possible try to
45:43 raspberry pip as much as possible try to shut it down correctly and then once you
45:44 shut it down correctly and then once you
45:44 shut it down correctly and then once you shut it down you can remove the power
45:47 shut it down you can remove the power
45:47 shut it down you can remove the power cable okay so wait maybe a few seconds
45:51 cable okay so wait maybe a few seconds
45:51 cable okay so wait maybe a few seconds 10 seconds after you shut it down and if
45:53 10 seconds after you shut it down and if
45:53 10 seconds after you shut it down and if you want to start it again you just need
45:54 you want to start it again you just need
45:54 you want to start it again you just need to pour it on again
45:58 to pour it on again
45:58 to pour it on again so I just did that I P it on again you
46:01 so I just did that I P it on again you
46:01 so I just did that I P it on again you wait for maybe 20 30
46:04 wait for maybe 20 30
46:04 wait for maybe 20 30 seconds and after you waited a bit uh
46:07 seconds and after you waited a bit uh
46:07 seconds and after you waited a bit uh you can connect so let's just click on
46:10 you can connect so let's just click on
46:10 you can connect so let's just click on yes okay it's going to ask us to put the
46:14 yes okay it's going to ask us to put the
46:14 yes okay it's going to ask us to put the username and password
46:16 username and password
46:16 username and password again okay and we are back to the
46:19 again okay and we are back to the
46:19 again okay and we are back to the Raspberry p hey I hope you're learning a
46:21 Raspberry p hey I hope you're learning a
46:21 Raspberry p hey I hope you're learning a lot and I also hope you like this
46:23 lot and I also hope you like this
46:23 lot and I also hope you like this tutorial if you find it useful then you
46:26 tutorial if you find it useful then you
46:26 tutorial if you find it useful then you can check out out the full course named
46:28 can check out out the full course named
46:28 can check out out the full course named Raspberry Pi for beginners which
46:30 Raspberry Pi for beginners which
46:30 Raspberry Pi for beginners which actually contains 10 hours of Hands-On
46:33 actually contains 10 hours of Hands-On
46:33 actually contains 10 hours of Hands-On video lessons I will leave a link in the
46:35 video lessons I will leave a link in the
46:35 video lessons I will leave a link in the description if you're interested all
46:36 description if you're interested all
46:36 description if you're interested all right and let's continue with the
46:40 video Welcome Back this is episode
46:43 video Welcome Back this is episode
46:43 video Welcome Back this is episode number four of this tutorial series on
46:46 number four of this tutorial series on
46:46 number four of this tutorial series on Raspberry Pi for complete beginners from
46:48 Raspberry Pi for complete beginners from
46:48 Raspberry Pi for complete beginners from this tutorial and going forward you are
46:50 this tutorial and going forward you are
46:50 this tutorial and going forward you are going to learn how to use and program
46:53 going to learn how to use and program
46:53 going to learn how to use and program the gpios of your Raspberry Pi board the
46:55 the gpios of your Raspberry Pi board the
46:55 the gpios of your Raspberry Pi board the GPI pins are a great way to make your
46:58 GPI pins are a great way to make your
46:58 GPI pins are a great way to make your Raspberry Pi control simple Hardware
47:00 Raspberry Pi control simple Hardware
47:00 Raspberry Pi control simple Hardware components like LEDs and push buttons
47:03 components like LEDs and push buttons
47:03 components like LEDs and push buttons and to be able to create a hardware
47:05 and to be able to create a hardware
47:05 and to be able to create a hardware ciruit with Raspberry Pi you have to
47:07 ciruit with Raspberry Pi you have to
47:07 ciruit with Raspberry Pi you have to know just a bit about breadboards and
47:09 know just a bit about breadboards and
47:09 know just a bit about breadboards and resistors that's what I will explain
47:12 resistors that's what I will explain
47:12 resistors that's what I will explain right now first of all let's see how to
47:14 right now first of all let's see how to
47:14 right now first of all let's see how to use a breadboard a breadboard is very
47:17 use a breadboard a breadboard is very
47:17 use a breadboard a breadboard is very useful for prototyping and to start your
47:19 useful for prototyping and to start your
47:19 useful for prototyping and to start your own first project you will use it to
47:22 own first project you will use it to
47:22 own first project you will use it to connect multiple components together and
47:24 connect multiple components together and
47:24 connect multiple components together and with your Raspberry Pi gpio you can plug
47:26 with your Raspberry Pi gpio you can plug
47:27 with your Raspberry Pi gpio you can plug some wires resistors LEDs well anything
47:30 some wires resistors LEDs well anything
47:30 some wires resistors LEDs well anything you want on a braid board what you need
47:32 you want on a braid board what you need
47:32 you want on a braid board what you need to know is that underneath the surface
47:35 to know is that underneath the surface
47:35 to know is that underneath the surface there are some metal lines that make
47:37 there are some metal lines that make
47:37 there are some metal lines that make connections between components so a
47:39 connections between components so a
47:40 connections between components so a component that you plug on a line is
47:42 component that you plug on a line is
47:42 component that you plug on a line is going to be electrically connected to
47:44 going to be electrically connected to
47:44 going to be electrically connected to all the other components on this line
47:46 all the other components on this line
47:47 all the other components on this line and here I'm going to start with this
47:48 and here I'm going to start with this
47:48 and here I'm going to start with this representation of the breadboard so the
47:50 representation of the breadboard so the
47:51 representation of the breadboard so the connections are going to look like this
47:53 connections are going to look like this
47:53 connections are going to look like this usually on top so if you orientate the
47:55 usually on top so if you orientate the
47:55 usually on top so if you orientate the braid board like this you have two lines
47:58 braid board like this you have two lines
47:59 braid board like this you have two lines okay it's minus and plus so usually
48:02 okay it's minus and plus so usually
48:02 okay it's minus and plus so usually minus we're going to use that for the
48:04 minus we're going to use that for the
48:04 minus we're going to use that for the ground also named G and D and the plus
48:07 ground also named G and D and the plus
48:07 ground also named G and D and the plus we're going to use that for power or
48:09 we're going to use that for power or
48:09 we're going to use that for power or also VCC and what you can see is that
48:13 also VCC and what you can see is that
48:13 also VCC and what you can see is that all the Dots here are actually connected
48:16 all the Dots here are actually connected
48:16 all the Dots here are actually connected between with each other okay so this dot
48:19 between with each other okay so this dot
48:19 between with each other okay so this dot is connecting with that one and it's
48:21 is connecting with that one and it's
48:21 is connecting with that one and it's connected with that one so all the dots
48:23 connected with that one so all the dots
48:23 connected with that one so all the dots together and the same thing for the plus
48:24 together and the same thing for the plus
48:25 together and the same thing for the plus lines okay so those are two front lines
48:27 lines okay so those are two front lines
48:27 lines okay so those are two front lines they are not connected between each
48:29 they are not connected between each
48:29 they are not connected between each other okay the minus and the plus but
48:31 other okay the minus and the plus but
48:31 other okay the minus and the plus but within one line all the dots are
48:33 within one line all the dots are
48:33 within one line all the dots are connected together so you have this at
48:36 connected together so you have this at
48:36 connected together so you have this at the top you might also have this at the
48:38 the top you might also have this at the
48:38 the top you might also have this at the bottom if you see another plus and minus
48:40 bottom if you see another plus and minus
48:40 bottom if you see another plus and minus line like this so those will will use
48:43 line like this so those will will use
48:43 line like this so those will will use them for ground and power and then you
48:45 them for ground and power and then you
48:45 them for ground and power and then you have a lot of other dots in the middle
48:48 have a lot of other dots in the middle
48:48 have a lot of other dots in the middle here and as you can see those are not
48:51 here and as you can see those are not
48:51 here and as you can see those are not connected here horizontally but they are
48:53 connected here horizontally but they are
48:53 connected here horizontally but they are connected vertically okay so you see
48:57 connected vertically okay so you see
48:57 connected vertically okay so you see here for example we have those five dots
48:59 here for example we have those five dots
48:59 here for example we have those five dots are connected together so if you put a
49:02 are connected together so if you put a
49:02 are connected together so if you put a component here so one side of a
49:04 component here so one side of a
49:04 component here so one side of a component here and one side of a
49:06 component here and one side of a
49:06 component here and one side of a component in that one here they are
49:08 component in that one here they are
49:08 component in that one here they are connected together but if you put them
49:10 connected together but if you put them
49:10 connected together but if you put them on a different column here they will not
49:13 on a different column here they will not
49:13 on a different column here they will not be connected together okay so that's
49:15 be connected together okay so that's
49:15 be connected together okay so that's basically how a breadboard work you have
49:17 basically how a breadboard work you have
49:17 basically how a breadboard work you have two big lines here at the top at the
49:20 two big lines here at the top at the
49:20 two big lines here at the top at the bottom as well and then you have columns
49:23 bottom as well and then you have columns
49:23 bottom as well and then you have columns here those dots are connected in columns
49:26 here those dots are connected in columns
49:26 here those dots are connected in columns and before I go to the real breadboard
49:28 and before I go to the real breadboard
49:28 and before I go to the real breadboard here you can see I have uh two images
49:31 here you can see I have uh two images
49:31 here you can see I have uh two images okay so here is what a breadboard might
49:34 okay so here is what a breadboard might
49:34 okay so here is what a breadboard might look like so you might have something
49:35 look like so you might have something
49:35 look like so you might have something like this maybe you have a small version
49:38 like this maybe you have a small version
49:38 like this maybe you have a small version okay that's basically only half of this
49:41 okay that's basically only half of this
49:41 okay that's basically only half of this maybe you have a long one so you can see
49:43 maybe you have a long one so you can see
49:43 maybe you have a long one so you can see here we have numbers of columns between
49:45 here we have numbers of columns between
49:45 here we have numbers of columns between zero he and 60 something so the size of
49:48 zero he and 60 something so the size of
49:48 zero he and 60 something so the size of the breadboard here doesn't matter you
49:50 the breadboard here doesn't matter you
49:50 the breadboard here doesn't matter you might have only half one or a large one
49:53 might have only half one or a large one
49:53 might have only half one or a large one it doesn't matter what I wanted to show
49:55 it doesn't matter what I wanted to show
49:55 it doesn't matter what I wanted to show you here is that so at the bottom here
49:57 you here is that so at the bottom here
49:57 you here is that so at the bottom here is the one that I'm going to be using
49:59 is the one that I'm going to be using
49:59 is the one that I'm going to be using and you can see we have the plus line
50:01 and you can see we have the plus line
50:01 and you can see we have the plus line here that's continuous and the minus
50:03 here that's continuous and the minus
50:03 here that's continuous and the minus line here but I know that some of you
50:05 line here but I know that some of you
50:05 line here but I know that some of you might have a breadboard like that and
50:08 might have a breadboard like that and
50:08 might have a breadboard like that and you can see there's a big difference is
50:09 you can see there's a big difference is
50:09 you can see there's a big difference is that uh the plus and the minus line here
50:13 that uh the plus and the minus line here
50:13 that uh the plus and the minus line here are actually cut in the middle so all
50:16 are actually cut in the middle so all
50:16 are actually cut in the middle so all those dots here are connected for
50:18 those dots here are connected for
50:18 those dots here are connected for example on the plus line but those dots
50:20 example on the plus line but those dots
50:20 example on the plus line but those dots are not connected with that other side
50:23 are not connected with that other side
50:23 are not connected with that other side of the breadboard so in this case what
50:25 of the breadboard so in this case what
50:25 of the breadboard so in this case what you might need to do is to connect just
50:28 you might need to do is to connect just
50:28 you might need to do is to connect just a wire between for example that dot here
50:31 a wire between for example that dot here
50:31 a wire between for example that dot here and that dot here so that you make the
50:33 and that dot here so that you make the
50:34 and that dot here so that you make the whole line connected you can connect one
50:36 whole line connected you can connect one
50:36 whole line connected you can connect one small wire for example a red wire
50:38 small wire for example a red wire
50:38 small wire for example a red wire between the two plus sides and a small
50:41 between the two plus sides and a small
50:41 between the two plus sides and a small black wire between the two minus sides
50:44 black wire between the two minus sides
50:45 black wire between the two minus sides so you can do this now you can do it
50:46 so you can do this now you can do it
50:46 so you can do this now you can do it later I'm going to come back to this and
50:48 later I'm going to come back to this and
50:48 later I'm going to come back to this and I'm going to point that when we actually
50:50 I'm going to point that when we actually
50:50 I'm going to point that when we actually need to do it in the circuit okay so
50:52 need to do it in the circuit okay so
50:52 need to do it in the circuit okay so don't worry too much about this but just
50:54 don't worry too much about this but just
50:54 don't worry too much about this but just note that if you have a this connection
50:57 note that if you have a this connection
50:57 note that if you have a this connection here you will just need to do an extra
50:59 here you will just need to do an extra
50:59 here you will just need to do an extra step with some parts of the circuit if
51:01 step with some parts of the circuit if
51:01 step with some parts of the circuit if you have something like this well you
51:03 you have something like this well you
51:03 you have something like this well you don't need to worry at all and so here
51:06 don't need to worry at all and so here
51:06 don't need to worry at all and so here is my breadboard so here's the
51:08 is my breadboard so here's the
51:08 is my breadboard so here's the breadboard I will be using for this
51:09 breadboard I will be using for this
51:09 breadboard I will be using for this course so it's exactly the same as on
51:11 course so it's exactly the same as on
51:11 course so it's exactly the same as on the image and you can see here we have
51:14 the image and you can see here we have
51:14 the image and you can see here we have the plus line so I have a plus line at
51:17 the plus line so I have a plus line at
51:17 the plus line so I have a plus line at the top and then a minus line okay so
51:19 the top and then a minus line okay so
51:19 the top and then a minus line okay so all the Dots here are horizontally
51:22 all the Dots here are horizontally
51:22 all the Dots here are horizontally connected on the plus line and all the
51:24 connected on the plus line and all the
51:24 connected on the plus line and all the dots are also horizontally connected on
51:27 dots are also horizontally connected on
51:27 dots are also horizontally connected on the minus line and then we have 60 plus
51:30 the minus line and then we have 60 plus
51:31 the minus line and then we have 60 plus something column here okay and all the
51:34 something column here okay and all the
51:34 something column here okay and all the dots for example on the column number 60
51:37 dots for example on the column number 60
51:37 dots for example on the column number 60 you can see I have 1 two three four five
51:39 you can see I have 1 two three four five
51:39 you can see I have 1 two three four five dots those five dots are connected
51:42 dots those five dots are connected
51:42 dots those five dots are connected together but are completely independent
51:44 together but are completely independent
51:44 together but are completely independent from all the other column that I have
51:46 from all the other column that I have
51:46 from all the other column that I have here okay and I have this here at the
51:49 here okay and I have this here at the
51:49 here okay and I have this here at the top and also at the bottom so you can
51:50 top and also at the bottom so you can
51:50 top and also at the bottom so you can see it's kind of a here this line in the
51:53 see it's kind of a here this line in the
51:53 see it's kind of a here this line in the middle is a symmetry line for the
51:55 middle is a symmetry line for the
51:55 middle is a symmetry line for the breadboard and that's basically all
51:57 breadboard and that's basically all
51:57 breadboard and that's basically all there is to it for the breadboard the
51:59 there is to it for the breadboard the
51:59 there is to it for the breadboard the most important thing is to know which
52:01 most important thing is to know which
52:01 most important thing is to know which dot is connected to which after that you
52:03 dot is connected to which after that you
52:03 dot is connected to which after that you can do everything you want the first
52:05 can do everything you want the first
52:05 can do everything you want the first secet we will do contains an LED and we
52:07 secet we will do contains an LED and we
52:07 secet we will do contains an LED and we will make this led blink okay and to
52:10 will make this led blink okay and to
52:10 will make this led blink okay and to make an LED blink we will need an LED
52:12 make an LED blink we will need an LED
52:12 make an LED blink we will need an LED some wires but also one resistor the
52:15 some wires but also one resistor the
52:15 some wires but also one resistor the resistor is here to lower the amount of
52:18 resistor is here to lower the amount of
52:18 resistor is here to lower the amount of current that goes through the LED and
52:21 current that goes through the LED and
52:21 current that goes through the LED and it's also helping to protect the gpio so
52:23 it's also helping to protect the gpio so
52:24 it's also helping to protect the gpio so they don't get burnt with too much
52:25 they don't get burnt with too much
52:25 they don't get burnt with too much current and for this course we will use
52:28 current and for this course we will use
52:28 current and for this course we will use 1 kilm resistors it's very standard
52:30 1 kilm resistors it's very standard
52:30 1 kilm resistors it's very standard value and I'm not going to give much
52:32 value and I'm not going to give much
52:32 value and I'm not going to give much details about this uh value but if you
52:34 details about this uh value but if you
52:34 details about this uh value but if you want to know more about that you can
52:36 want to know more about that you can
52:36 want to know more about that you can also find many resources on the internet
52:39 also find many resources on the internet
52:39 also find many resources on the internet so now that you know what resistor we
52:41 so now that you know what resistor we
52:41 so now that you know what resistor we want to use then how to know which
52:43 want to use then how to know which
52:43 want to use then how to know which resistor to pick from the resistor set
52:46 resistor to pick from the resistor set
52:46 resistor to pick from the resistor set that you have so maybe the resistors are
52:48 that you have so maybe the resistors are
52:48 that you have so maybe the resistors are correctly set per value in the kit you
52:50 correctly set per value in the kit you
52:50 correctly set per value in the kit you have but if it's not the case you will
52:52 have but if it's not the case you will
52:53 have but if it's not the case you will have to read the value from the color
52:55 have to read the value from the color
52:55 have to read the value from the color and here is a table to help you find the
52:57 and here is a table to help you find the
52:57 and here is a table to help you find the value of a resistor with the colors on
53:00 value of a resistor with the colors on
53:00 value of a resistor with the colors on the resistor usually you will have
53:02 the resistor usually you will have
53:02 the resistor usually you will have either four bands or five bands resistor
53:06 either four bands or five bands resistor
53:06 either four bands or five bands resistor and here the first band the second band
53:08 and here the first band the second band
53:08 and here the first band the second band and optionally the third band correspond
53:11 and optionally the third band correspond
53:11 and optionally the third band correspond to a number the next one corresponds to
53:14 to a number the next one corresponds to
53:14 to a number the next one corresponds to a multiplier and finally the last band
53:17 a multiplier and finally the last band
53:17 a multiplier and finally the last band is for the tolerance or the Precision of
53:19 is for the tolerance or the Precision of
53:19 is for the tolerance or the Precision of the resistor and for what we will do in
53:21 the resistor and for what we will do in
53:21 the resistor and for what we will do in this course you don't really need to
53:22 this course you don't really need to
53:22 this course you don't really need to worry about the tolerance okay any value
53:25 worry about the tolerance okay any value
53:25 worry about the tolerance okay any value will do usually you will have here plus
53:28 will do usually you will have here plus
53:28 will do usually you will have here plus - 5% or plus - 10% here we don't really
53:31 - 5% or plus - 10% here we don't really
53:31 - 5% or plus - 10% here we don't really need to care about the precise value for
53:33 need to care about the precise value for
53:33 need to care about the precise value for the resistors and here's the example
53:35 the resistors and here's the example
53:35 the resistors and here's the example with the resistor we're going to use the
53:37 with the resistor we're going to use the
53:37 with the resistor we're going to use the 1 kiloohm resistor if you have a four
53:40 1 kiloohm resistor if you have a four
53:40 1 kiloohm resistor if you have a four band resistor so that's the one on the
53:43 band resistor so that's the one on the
53:43 band resistor so that's the one on the top here you see that the first two
53:45 top here you see that the first two
53:45 top here you see that the first two bands are going to represent a number so
53:47 bands are going to represent a number so
53:47 bands are going to represent a number so here one zero that's 10 and the third
53:49 here one zero that's 10 and the third
53:50 here one zero that's 10 and the third band is going to be here the multiplier
53:52 band is going to be here the multiplier
53:52 band is going to be here the multiplier so to get 1,000 you need to multiply 10
53:55 so to get 1,000 you need to multiply 10
53:55 so to get 1,000 you need to multiply 10 by 100 so that's why you have brown
53:58 by 100 so that's why you have brown
53:58 by 100 so that's why you have brown black and red and then you have the
54:00 black and red and then you have the
54:00 black and red and then you have the tolerance which can be any color it
54:02 tolerance which can be any color it
54:02 tolerance which can be any color it doesn't matter if you have a five Bend
54:04 doesn't matter if you have a five Bend
54:04 doesn't matter if you have a five Bend resistor like the one I would show you
54:06 resistor like the one I would show you
54:06 resistor like the one I would show you just in the minute then we will have one
54:09 just in the minute then we will have one
54:09 just in the minute then we will have one zero and zero so brown black and black
54:12 zero and zero so brown black and black
54:12 zero and zero so brown black and black those are the first second and third
54:14 those are the first second and third
54:14 those are the first second and third band and then the multiplier is going to
54:16 band and then the multiplier is going to
54:16 band and then the multiplier is going to be only 10 okay because we multiply 100
54:19 be only 10 okay because we multiply 100
54:19 be only 10 okay because we multiply 100 by 10 to have 1,000 so in this case you
54:23 by 10 to have 1,000 so in this case you
54:23 by 10 to have 1,000 so in this case you have brown black black and brown Plus
54:26 have brown black black and brown Plus
54:26 have brown black black and brown Plus the tolerance okay and if you are
54:28 the tolerance okay and if you are
54:28 the tolerance okay and if you are confused about well what side to read
54:31 confused about well what side to read
54:31 confused about well what side to read the resistor from usually all the colors
54:34 the resistor from usually all the colors
54:34 the resistor from usually all the colors are you can see close so you have one
54:36 are you can see close so you have one
54:36 are you can see close so you have one Bend here at each extremity but most of
54:39 Bend here at each extremity but most of
54:39 Bend here at each extremity but most of the bins will be close to that first
54:41 the bins will be close to that first
54:42 the bins will be close to that first value here so where you have more space
54:44 value here so where you have more space
54:44 value here so where you have more space here it corresponds to the tolerance
54:46 here it corresponds to the tolerance
54:46 here it corresponds to the tolerance that's how you can correctly read the
54:49 that's how you can correctly read the
54:49 that's how you can correctly read the value so here is the resistor that I'm
54:52 value so here is the resistor that I'm
54:52 value so here is the resistor that I'm going to be using okay so you can see I
54:54 going to be using okay so you can see I
54:54 going to be using okay so you can see I can read it uh
54:56 can read it uh
54:56 can read it uh here there is so I have five BS I have
54:59 here there is so I have five BS I have
54:59 here there is so I have five BS I have brown black black brown and then another
55:02 brown black black brown and then another
55:02 brown black black brown and then another color for the tolerance that I don't
55:04 color for the tolerance that I don't
55:04 color for the tolerance that I don't really care about okay so if you can see
55:07 really care about okay so if you can see
55:07 really care about okay so if you can see here that's the resistance I'm going to
55:09 here that's the resistance I'm going to
55:09 here that's the resistance I'm going to use if you have a five band resistor it
55:11 use if you have a five band resistor it
55:11 use if you have a five band resistor it should look like this and then if you
55:13 should look like this and then if you
55:13 should look like this and then if you have a four band well you just have
55:16 have a four band well you just have
55:16 have a four band well you just have brown black and red coming back to the
55:19 brown black and red coming back to the
55:19 brown black and red coming back to the color code here if you don't have 1
55:22 color code here if you don't have 1
55:22 color code here if you don't have 1 kiloohm don't worry too much you can
55:24 kiloohm don't worry too much you can
55:24 kiloohm don't worry too much you can also use 330 or 470 ohm resistors so I'm
55:29 also use 330 or 470 ohm resistors so I'm
55:29 also use 330 or 470 ohm resistors so I'm getting those values because they are
55:31 getting those values because they are
55:31 getting those values because they are very common values as well and if you
55:33 very common values as well and if you
55:33 very common values as well and if you have 330 for example you can see that we
55:36 have 330 for example you can see that we
55:36 have 330 for example you can see that we first need three and three so the first
55:39 first need three and three so the first
55:39 first need three and three so the first two bands should be orange okay and then
55:42 two bands should be orange okay and then
55:42 two bands should be orange okay and then depends on if it's a four band or five
55:45 depends on if it's a four band or five
55:45 depends on if it's a four band or five band the rest is going to be different
55:46 band the rest is going to be different
55:46 band the rest is going to be different but you should start with orange and
55:47 but you should start with orange and
55:47 but you should start with orange and orange and if you have a 470 ohm the
55:51 orange and if you have a 470 ohm the
55:51 orange and if you have a 470 ohm the first two numbers are four and seven so
55:53 first two numbers are four and seven so
55:53 first two numbers are four and seven so the first two bands should be yellow and
55:57 the first two bands should be yellow and
55:57 the first two bands should be yellow and uh Violet here purple all right so
55:59 uh Violet here purple all right so
55:59 uh Violet here purple all right so that's how you can find a resistor value
56:02 that's how you can find a resistor value
56:02 that's how you can find a resistor value it's quite easy Once you done this once
56:04 it's quite easy Once you done this once
56:04 it's quite easy Once you done this once or twice is very easy to find and I
56:06 or twice is very easy to find and I
56:06 or twice is very easy to find and I would just recommend one thing is not
56:08 would just recommend one thing is not
56:08 would just recommend one thing is not going below 330 ohm for the LEDs okay 1
56:12 going below 330 ohm for the LEDs okay 1
56:12 going below 330 ohm for the LEDs okay 1 kilohm is in fact a pretty high value
56:14 kilohm is in fact a pretty high value
56:14 kilohm is in fact a pretty high value for an LED with the Raspberry Pi but
56:16 for an LED with the Raspberry Pi but
56:16 for an LED with the Raspberry Pi but it's a nice value if you want to connect
56:18 it's a nice value if you want to connect
56:18 it's a nice value if you want to connect many LEDs so the total current
56:20 many LEDs so the total current
56:20 many LEDs so the total current consumption will not be too high and
56:22 consumption will not be too high and
56:22 consumption will not be too high and will not go beyond the Raspberry p limit
56:25 will not go beyond the Raspberry p limit
56:25 will not go beyond the Raspberry p limit which is 50 Mill amp so to connect
56:27 which is 50 Mill amp so to connect
56:27 which is 50 Mill amp so to connect components such as LEDs the higher the
56:30 components such as LEDs the higher the
56:30 components such as LEDs the higher the resistance value the less current you
56:33 resistance value the less current you
56:33 resistance value the less current you will take and thus you can plug more
56:35 will take and thus you can plug more
56:35 will take and thus you can plug more LEDs and components to your circuit
56:37 LEDs and components to your circuit
56:37 LEDs and components to your circuit while keeping it
56:40 safe welcome back this is episode number
56:43 safe welcome back this is episode number
56:43 safe welcome back this is episode number five of this tutorial series on
56:45 five of this tutorial series on
56:45 five of this tutorial series on Raspberry Pi for complete beginners so
56:48 Raspberry Pi for complete beginners so
56:48 Raspberry Pi for complete beginners so in this tutorial you are going to create
56:50 in this tutorial you are going to create
56:50 in this tutorial you are going to create your first circuit for that you will
56:52 your first circuit for that you will
56:52 your first circuit for that you will need to have your Raspberry p board an
56:54 need to have your Raspberry p board an
56:54 need to have your Raspberry p board an LED a 1 km resistor a breadboard and
56:58 LED a 1 km resistor a breadboard and
56:58 LED a 1 km resistor a breadboard and some wires if you are not sure about how
57:00 some wires if you are not sure about how
57:00 some wires if you are not sure about how to read the resistors value then please
57:02 to read the resistors value then please
57:02 to read the resistors value then please go back to the previous tutorial in the
57:04 go back to the previous tutorial in the
57:04 go back to the previous tutorial in the series and I'm going to start with a
57:06 series and I'm going to start with a
57:06 series and I'm going to start with a quick note on how to safely manipulate
57:09 quick note on how to safely manipulate
57:09 quick note on how to safely manipulate the Raspberry Pi so you can avoid
57:11 the Raspberry Pi so you can avoid
57:11 the Raspberry Pi so you can avoid burning it and having to buy a new one
57:13 burning it and having to buy a new one
57:13 burning it and having to buy a new one and then we will build the circuit
57:15 and then we will build the circuit
57:15 and then we will build the circuit together with the LED and the resistor
57:17 together with the LED and the resistor
57:17 together with the LED and the resistor working with the Raspberry Pi gpio can
57:20 working with the Raspberry Pi gpio can
57:20 working with the Raspberry Pi gpio can be quite dangerous for your board if you
57:22 be quite dangerous for your board if you
57:22 be quite dangerous for your board if you don't follow exactly the instructions
57:24 don't follow exactly the instructions
57:24 don't follow exactly the instructions and if you plug a wire in the wrong
57:26 and if you plug a wire in the wrong
57:26 and if you plug a wire in the wrong place note that you don't risk anything
57:29 place note that you don't risk anything
57:29 place note that you don't risk anything for yourself okay the current is way too
57:31 for yourself okay the current is way too
57:31 for yourself okay the current is way too low to get hurt or to hurt anyone the
57:34 low to get hurt or to hurt anyone the
57:34 low to get hurt or to hurt anyone the risk here is to kind of fry your boat
57:37 risk here is to kind of fry your boat
57:37 risk here is to kind of fry your boat and after you fry your raspberry pie you
57:39 and after you fry your raspberry pie you
57:39 and after you fry your raspberry pie you won't be able to use it anymore so here
57:42 won't be able to use it anymore so here
57:42 won't be able to use it anymore so here are a few important points that you have
57:44 are a few important points that you have
57:44 are a few important points that you have to follow if you carefully follow them
57:46 to follow if you carefully follow them
57:46 to follow if you carefully follow them you won't have any problem first of all
57:50 you won't have any problem first of all
57:50 you won't have any problem first of all always power off your Raspberry Pi first
57:53 always power off your Raspberry Pi first
57:53 always power off your Raspberry Pi first when you make a change in the circuit
57:56 when you make a change in the circuit
57:56 when you make a change in the circuit even if it's just to disconnect and
57:58 even if it's just to disconnect and
57:58 even if it's just to disconnect and reconnect one single cable okay you
58:00 reconnect one single cable okay you
58:00 reconnect one single cable okay you power off your Raspberry Pi you remove
58:02 power off your Raspberry Pi you remove
58:02 power off your Raspberry Pi you remove the power cable you make the hardware
58:04 the power cable you make the hardware
58:04 the power cable you make the hardware changes and then and only then you can
58:06 changes and then and only then you can
58:06 changes and then and only then you can power the pie again second point is when
58:08 power the pie again second point is when
58:08 power the pie again second point is when the Raspberry Pi is powered on with some
58:11 the Raspberry Pi is powered on with some
58:11 the Raspberry Pi is powered on with some Hardware components don't touch the
58:13 Hardware components don't touch the
58:13 Hardware components don't touch the components with your finger so try not
58:15 components with your finger so try not
58:15 components with your finger so try not to do it too much you may damage your
58:17 to do it too much you may damage your
58:17 to do it too much you may damage your pie with an electrostatic discharge also
58:20 pie with an electrostatic discharge also
58:20 pie with an electrostatic discharge also called ESD and also this is quite obious
58:23 called ESD and also this is quite obious
58:23 called ESD and also this is quite obious but don't use any metallic tool to touch
58:26 but don't use any metallic tool to touch
58:26 but don't use any metallic tool to touch the hardware setup when it's running for
58:28 the hardware setup when it's running for
58:28 the hardware setup when it's running for example with a screwdriver okay only bad
58:31 example with a screwdriver okay only bad
58:31 example with a screwdriver okay only bad things can happen if you do that third
58:33 things can happen if you do that third
58:33 things can happen if you do that third Point here is that before you power on
58:35 Point here is that before you power on
58:35 Point here is that before you power on your Raspberry Pi double check and even
58:38 your Raspberry Pi double check and even
58:38 your Raspberry Pi double check and even triple check your hardware setup even if
58:40 triple check your hardware setup even if
58:40 triple check your hardware setup even if you are sure about it personally even if
58:43 you are sure about it personally even if
58:43 you are sure about it personally even if I make the simplest hardware setup and
58:45 I make the simplest hardware setup and
58:45 I make the simplest hardware setup and that I'm sure about I still double check
58:48 that I'm sure about I still double check
58:48 that I'm sure about I still double check everything that I do fourth point is
58:50 everything that I do fourth point is
58:50 everything that I do fourth point is when you build a circuit always start
58:53 when you build a circuit always start
58:53 when you build a circuit always start with the ground pins and then make sure
58:55 with the ground pins and then make sure
58:55 with the ground pins and then make sure that the ground is common for all your
58:57 that the ground is common for all your
58:57 that the ground is common for all your components and I'm going to come back to
58:59 components and I'm going to come back to
58:59 components and I'm going to come back to this when we build the circuit and
59:01 this when we build the circuit and
59:01 this when we build the circuit and finally the GPI is only support 3.3 volt
59:06 finally the GPI is only support 3.3 volt
59:06 finally the GPI is only support 3.3 volt so don't connect anything that uses 5
59:08 so don't connect anything that uses 5
59:08 so don't connect anything that uses 5 volt directly okay you might burn GPI
59:12 volt directly okay you might burn GPI
59:12 volt directly okay you might burn GPI pin not necessarily burn the Raspberry
59:14 pin not necessarily burn the Raspberry
59:14 pin not necessarily burn the Raspberry Pi but you might burn the pin and then
59:16 Pi but you might burn the pin and then
59:16 Pi but you might burn the pin and then you can't use that specific pin anymore
59:19 you can't use that specific pin anymore
59:19 you can't use that specific pin anymore so to recap here just plugging a wrong
59:21 so to recap here just plugging a wrong
59:21 so to recap here just plugging a wrong Cable in the wrong PIN can destroy your
59:24 Cable in the wrong PIN can destroy your
59:24 Cable in the wrong PIN can destroy your pie in a fraction of seconds and then
59:26 pie in a fraction of seconds and then
59:26 pie in a fraction of seconds and then you have to buy a new one it happened to
59:28 you have to buy a new one it happened to
59:28 you have to buy a new one it happened to me in the past and it's not really fun
59:30 me in the past and it's not really fun
59:30 me in the past and it's not really fun of course I'm not saying that to scare
59:32 of course I'm not saying that to scare
59:32 of course I'm not saying that to scare you I just want to make you extra
59:34 you I just want to make you extra
59:34 you I just want to make you extra careful with any hardware setup you will
59:36 careful with any hardware setup you will
59:36 careful with any hardware setup you will do if you follow what I do and if you
59:38 do if you follow what I do and if you
59:38 do if you follow what I do and if you always double check any setup before you
59:40 always double check any setup before you
59:40 always double check any setup before you boot the Raspberry Pi then everything
59:43 boot the Raspberry Pi then everything
59:43 boot the Raspberry Pi then everything will be okay so when I do a circuit or
59:45 will be okay so when I do a circuit or
59:45 will be okay so when I do a circuit or if I improve the current one I will
59:47 if I improve the current one I will
59:47 if I improve the current one I will first use this software tool here to
59:50 first use this software tool here to
59:50 first use this software tool here to design the circuit and then I will also
59:52 design the circuit and then I will also
59:52 design the circuit and then I will also show you in the same video the real
59:54 show you in the same video the real
59:54 show you in the same video the real circuit on my real breadboard and
59:56 circuit on my real breadboard and
59:56 circuit on my real breadboard and Raspberry Pi so let's start the circuit
59:59 Raspberry Pi so let's start the circuit
59:59 Raspberry Pi so let's start the circuit here I have my breadboard okay I have my
1:00:02 here I have my breadboard okay I have my
1:00:02 here I have my breadboard okay I have my Raspberry Pi I have an LED okay and I
1:00:05 Raspberry Pi I have an LED okay and I
1:00:05 Raspberry Pi I have an LED okay and I have my 1 kiloohm resistor as you can
1:00:08 have my 1 kiloohm resistor as you can
1:00:08 have my 1 kiloohm resistor as you can see here I have brown black and red
1:00:11 see here I have brown black and red
1:00:11 see here I have brown black and red because it's a four Bend resistor and
1:00:13 because it's a four Bend resistor and
1:00:13 because it's a four Bend resistor and then the uh tolerance here doesn't
1:00:15 then the uh tolerance here doesn't
1:00:16 then the uh tolerance here doesn't really matter and so the first thing we
1:00:18 really matter and so the first thing we
1:00:18 really matter and so the first thing we are going to do is to actually connect
1:00:20 are going to do is to actually connect
1:00:20 are going to do is to actually connect the ground so for the ground in the
1:00:23 the ground so for the ground in the
1:00:23 the ground so for the ground in the brightboard we will use that line here
1:00:26 brightboard we will use that line here
1:00:26 brightboard we will use that line here that blue line and then what pin will we
1:00:29 that blue line and then what pin will we
1:00:29 that blue line and then what pin will we use on the Raspberry Pi well you will
1:00:33 use on the Raspberry Pi well you will
1:00:33 use on the Raspberry Pi well you will have so you see we have two different
1:00:34 have so you see we have two different
1:00:34 have so you see we have two different lines of gpos okay so we have 20 here
1:00:37 lines of gpos okay so we have 20 here
1:00:37 lines of gpos okay so we have 20 here and 20 there we're going to go to the
1:00:39 and 20 there we're going to go to the
1:00:39 and 20 there we're going to go to the line that's closest that's on the inside
1:00:42 line that's closest that's on the inside
1:00:42 line that's closest that's on the inside of the Raspberry Pi and we're going to
1:00:43 of the Raspberry Pi and we're going to
1:00:44 of the Raspberry Pi and we're going to count to five so one two three four and
1:00:48 count to five so one two three four and
1:00:48 count to five so one two three four and five this here this is a ground pin okay
1:00:53 five this here this is a ground pin okay
1:00:53 five this here this is a ground pin okay so I'm just going to take my wire and
1:00:57 so I'm just going to take my wire and
1:00:57 so I'm just going to take my wire and connect it to that line on the first on
1:01:00 connect it to that line on the first on
1:01:00 connect it to that line on the first on the second it doesn't really matter and
1:01:03 the second it doesn't really matter and
1:01:03 the second it doesn't really matter and I can just do
1:01:07 that okay I'll make it look nicer when I
1:01:10 that okay I'll make it look nicer when I
1:01:11 that okay I'll make it look nicer when I take the screenshot and just going to
1:01:13 take the screenshot and just going to
1:01:13 take the screenshot and just going to use a black
1:01:15 use a black
1:01:15 use a black wire okay we use black usually okay
1:01:18 wire okay we use black usually okay
1:01:18 wire okay we use black usually okay that's the convention for ground we use
1:01:21 that's the convention for ground we use
1:01:21 that's the convention for ground we use black so you know that when you see a
1:01:23 black so you know that when you see a
1:01:23 black so you know that when you see a black wire this is for the ground so we
1:01:25 black wire this is for the ground so we
1:01:25 black wire this is for the ground so we don't make any confusion okay and you
1:01:27 don't make any confusion okay and you
1:01:27 don't make any confusion okay and you could connect this to any pin okay as
1:01:30 could connect this to any pin okay as
1:01:30 could connect this to any pin okay as you can see any pin on that line they
1:01:32 you can see any pin on that line they
1:01:32 you can see any pin on that line they all connected together so it doesn't
1:01:34 all connected together so it doesn't
1:01:34 all connected together so it doesn't matter okay so now the ground of the
1:01:35 matter okay so now the ground of the
1:01:35 matter okay so now the ground of the breadboard here and the ground of the
1:01:37 breadboard here and the ground of the
1:01:37 breadboard here and the ground of the Raspberry Pi are connected together good
1:01:40 Raspberry Pi are connected together good
1:01:40 Raspberry Pi are connected together good now we're going to take our LED and you
1:01:42 now we're going to take our LED and you
1:01:42 now we're going to take our LED and you can see that the LED has two legs but
1:01:45 can see that the LED has two legs but
1:01:45 can see that the LED has two legs but one of them is shorter than the other
1:01:48 one of them is shorter than the other
1:01:48 one of them is shorter than the other one so the short side is going to be the
1:01:51 one so the short side is going to be the
1:01:51 one so the short side is going to be the negative side and the long side so the
1:01:54 negative side and the long side so the
1:01:54 negative side and the long side so the long leg is going to be the positive
1:01:57 long leg is going to be the positive
1:01:57 long leg is going to be the positive side so here I'm going to put my uh LED
1:02:02 side so here I'm going to put my uh LED
1:02:02 side so here I'm going to put my uh LED here on the circuit I'm going to go a
1:02:04 here on the circuit I'm going to go a
1:02:04 here on the circuit I'm going to go a bit more on the left so we have more
1:02:05 bit more on the left so we have more
1:02:05 bit more on the left so we have more space for the following and I'm going to
1:02:08 space for the following and I'm going to
1:02:08 space for the following and I'm going to connect the shorter leg to the ground so
1:02:11 connect the shorter leg to the ground so
1:02:11 connect the shorter leg to the ground so how to do this as you can see here all
1:02:14 how to do this as you can see here all
1:02:14 how to do this as you can see here all those dots here are connected
1:02:16 those dots here are connected
1:02:16 those dots here are connected vertically so I will take one of the
1:02:18 vertically so I will take one of the
1:02:18 vertically so I will take one of the dots so for example that one or that one
1:02:20 dots so for example that one or that one
1:02:20 dots so for example that one or that one or that one and just connect it to the
1:02:23 or that one and just connect it to the
1:02:23 or that one and just connect it to the ground with a black wire here so ground
1:02:26 ground with a black wire here so ground
1:02:26 ground with a black wire here so ground is connected here and it's connected
1:02:28 is connected here and it's connected
1:02:28 is connected here and it's connected there on the other side of the LED so on
1:02:31 there on the other side of the LED so on
1:02:31 there on the other side of the LED so on the longer leg I will take my resistor
1:02:35 the longer leg I will take my resistor
1:02:35 the longer leg I will take my resistor and I told you previously about the
1:02:37 and I told you previously about the
1:02:37 and I told you previously about the correct way to read the resistor from
1:02:39 correct way to read the resistor from
1:02:39 correct way to read the resistor from which side to start but when you connect
1:02:41 which side to start but when you connect
1:02:41 which side to start but when you connect this resistor to a circuit there is no
1:02:44 this resistor to a circuit there is no
1:02:44 this resistor to a circuit there is no positive or negative side okay you can
1:02:46 positive or negative side okay you can
1:02:46 positive or negative side okay you can just take your resistor and connect one
1:02:48 just take your resistor and connect one
1:02:48 just take your resistor and connect one leg to the positive side here of the LED
1:02:55 leg to the positive side here of the LED
1:02:55 leg to the positive side here of the LED and another leg that you connect to any
1:02:58 and another leg that you connect to any
1:02:58 and another leg that you connect to any other dot here you can see that on a
1:03:01 other dot here you can see that on a
1:03:01 other dot here you can see that on a different column and then to close the
1:03:04 different column and then to close the
1:03:04 different column and then to close the circuit well we are going to connect
1:03:06 circuit well we are going to connect
1:03:06 circuit well we are going to connect that side here of the uh resistor to
1:03:11 that side here of the uh resistor to
1:03:11 that side here of the uh resistor to this pin right here so the one next to
1:03:13 this pin right here so the one next to
1:03:13 this pin right here so the one next to the ground that is called gpio 17 so you
1:03:17 the ground that is called gpio 17 so you
1:03:17 the ground that is called gpio 17 so you can see here on the image we want the
1:03:19 can see here on the image we want the
1:03:19 can see here on the image we want the gpio 17 and so there are two ways to
1:03:22 gpio 17 and so there are two ways to
1:03:22 gpio 17 and so there are two ways to represent uh pins you can see we have
1:03:25 represent uh pins you can see we have
1:03:25 represent uh pins you can see we have the gray numbers with 1 2 3 4 5 Etc so
1:03:29 the gray numbers with 1 2 3 4 5 Etc so
1:03:29 the gray numbers with 1 2 3 4 5 Etc so the gnd D here would be the pin number
1:03:31 the gnd D here would be the pin number
1:03:31 the gnd D here would be the pin number nine and this one will be the pin number
1:03:33 nine and this one will be the pin number
1:03:33 nine and this one will be the pin number 11 but we're going to use the alternate
1:03:36 11 but we're going to use the alternate
1:03:36 11 but we're going to use the alternate names so here it's going to be gnd D and
1:03:39 names so here it's going to be gnd D and
1:03:39 names so here it's going to be gnd D and this one is going to be gpio 17 okay
1:03:41 this one is going to be gpio 17 okay
1:03:41 this one is going to be gpio 17 okay that's going to be important for when we
1:03:43 that's going to be important for when we
1:03:43 that's going to be important for when we write the code just okay I see here it's
1:03:47 write the code just okay I see here it's
1:03:47 write the code just okay I see here it's Raspberry Pi 4 model B I'm using a
1:03:49 Raspberry Pi 4 model B I'm using a
1:03:49 Raspberry Pi 4 model B I'm using a Raspberry Pi 5 but the gpio panel is the
1:03:52 Raspberry Pi 5 but the gpio panel is the
1:03:52 Raspberry Pi 5 but the gpio panel is the same between those two Raspberry Pi
1:03:54 same between those two Raspberry Pi
1:03:54 same between those two Raspberry Pi board so for the CIT it doesn't matter
1:03:56 board so for the CIT it doesn't matter
1:03:56 board so for the CIT it doesn't matter here okay so don't be confused with this
1:03:57 here okay so don't be confused with this
1:03:57 here okay so don't be confused with this name so what I will do is I will take
1:04:00 name so what I will do is I will take
1:04:00 name so what I will do is I will take this GP and connect to that here that
1:04:05 this GP and connect to that here that
1:04:05 this GP and connect to that here that leg of the resistor and use a I'm going
1:04:07 leg of the resistor and use a I'm going
1:04:08 leg of the resistor and use a I'm going to use a so here I'm going to use a
1:04:10 to use a so here I'm going to use a
1:04:10 to use a so here I'm going to use a yellow cable so make sure you don't use
1:04:12 yellow cable so make sure you don't use
1:04:12 yellow cable so make sure you don't use black for this and also don't use red
1:04:15 black for this and also don't use red
1:04:15 black for this and also don't use red but you can use any color you want okay
1:04:17 but you can use any color you want okay
1:04:17 but you can use any color you want okay so in the end the C is complete you can
1:04:19 so in the end the C is complete you can
1:04:19 so in the end the C is complete you can see we start from the ground we go here
1:04:22 see we start from the ground we go here
1:04:22 see we start from the ground we go here ground is connected to the shorter leg
1:04:24 ground is connected to the shorter leg
1:04:24 ground is connected to the shorter leg of the LED then goes through the led the
1:04:27 of the LED then goes through the led the
1:04:27 of the LED then goes through the led the longer leg is connected to one side of
1:04:29 longer leg is connected to one side of
1:04:29 longer leg is connected to one side of the resistor the other side of the
1:04:31 the resistor the other side of the
1:04:31 the resistor the other side of the resistor is connected to this gpio
1:04:34 resistor is connected to this gpio
1:04:34 resistor is connected to this gpio number 17 and the circuit is complete so
1:04:37 number 17 and the circuit is complete so
1:04:37 number 17 and the circuit is complete so double check especially the connection
1:04:38 double check especially the connection
1:04:38 double check especially the connection you make here okay double check that
1:04:40 you make here okay double check that
1:04:40 you make here okay double check that everything is correctly placed and here
1:04:43 everything is correctly placed and here
1:04:43 everything is correctly placed and here is the real circuit so what do I have
1:04:46 is the real circuit so what do I have
1:04:46 is the real circuit so what do I have here I have my Raspberry Pi first with
1:04:48 here I have my Raspberry Pi first with
1:04:48 here I have my Raspberry Pi first with the with the case you might not have a
1:04:51 the with the case you might not have a
1:04:51 the with the case you might not have a case uh so first make sure that you
1:04:53 case uh so first make sure that you
1:04:53 case uh so first make sure that you unplug okay the r so it's powered off
1:04:57 unplug okay the r so it's powered off
1:04:57 unplug okay the r so it's powered off completely if you don't have a case I
1:04:59 completely if you don't have a case I
1:04:59 completely if you don't have a case I would recommend to remove the SD card
1:05:02 would recommend to remove the SD card
1:05:02 would recommend to remove the SD card okay and then plug it back at the end
1:05:04 okay and then plug it back at the end
1:05:04 okay and then plug it back at the end here because the case is protecting it I
1:05:06 here because the case is protecting it I
1:05:06 here because the case is protecting it I can leave it there okay and I have some
1:05:09 can leave it there okay and I have some
1:05:09 can leave it there okay and I have some space here to plug the wires for the GP
1:05:12 space here to plug the wires for the GP
1:05:12 space here to plug the wires for the GP panel so I'm going to use the case as is
1:05:15 panel so I'm going to use the case as is
1:05:16 panel so I'm going to use the case as is okay that's not going to be a problem I
1:05:17 okay that's not going to be a problem I
1:05:17 okay that's not going to be a problem I have my
1:05:18 have my
1:05:18 have my breadboard and then I have a black wire
1:05:21 breadboard and then I have a black wire
1:05:21 breadboard and then I have a black wire I also have a uh yellow wire so those
1:05:24 I also have a uh yellow wire so those
1:05:24 I also have a uh yellow wire so those two are m to female wires I have my LED
1:05:28 two are m to female wires I have my LED
1:05:28 two are m to female wires I have my LED which you can see has a shorter leg and
1:05:32 which you can see has a shorter leg and
1:05:32 which you can see has a shorter leg and a longer leg okay so the shorter leg
1:05:34 a longer leg okay so the shorter leg
1:05:34 a longer leg okay so the shorter leg here is on the left and then I have my
1:05:37 here is on the left and then I have my
1:05:37 here is on the left and then I have my resistor so the resistor I just show you
1:05:40 resistor so the resistor I just show you
1:05:40 resistor so the resistor I just show you before uh well either side okay it
1:05:43 before uh well either side okay it
1:05:43 before uh well either side okay it doesn't matter you can plug any side
1:05:46 doesn't matter you can plug any side
1:05:46 doesn't matter you can plug any side where you want it doesn't have any uh
1:05:49 where you want it doesn't have any uh
1:05:49 where you want it doesn't have any uh Direction so I will start with the
1:05:51 Direction so I will start with the
1:05:51 Direction so I will start with the ground and plug the ground so I will
1:05:53 ground and plug the ground so I will
1:05:53 ground and plug the ground so I will count here one 1 two 3 four five on the
1:05:58 count here one 1 two 3 four five on the
1:05:58 count here one 1 two 3 four five on the inside okay so 1 two 3 4 five again I
1:06:02 inside okay so 1 two 3 4 five again I
1:06:02 inside okay so 1 two 3 4 five again I make sure that it is plug to the right
1:06:05 make sure that it is plug to the right
1:06:05 make sure that it is plug to the right place and then I will start for example
1:06:08 place and then I will start for example
1:06:08 place and then I will start for example here plug on that minus line so now the
1:06:13 here plug on that minus line so now the
1:06:13 here plug on that minus line so now the ground is connected great I will take my
1:06:16 ground is connected great I will take my
1:06:16 ground is connected great I will take my LED and what I did what I did in the in
1:06:20 LED and what I did what I did in the in
1:06:20 LED and what I did what I did in the in the software is that I just plug the LED
1:06:23 the software is that I just plug the LED
1:06:23 the software is that I just plug the LED like this for example between two
1:06:26 like this for example between two
1:06:26 like this for example between two uh between two column and then I have
1:06:28 uh between two column and then I have
1:06:28 uh between two column and then I have another black wire between the uh
1:06:32 another black wire between the uh
1:06:32 another black wire between the uh shorter leg and the minus line but what
1:06:35 shorter leg and the minus line but what
1:06:35 shorter leg and the minus line but what I can do here is going to be simpler is
1:06:38 I can do here is going to be simpler is
1:06:38 I can do here is going to be simpler is I'm just going to put directly the
1:06:40 I'm just going to put directly the
1:06:40 I'm just going to put directly the shorter side so the shorter leg directly
1:06:45 shorter side so the shorter leg directly
1:06:45 shorter side so the shorter leg directly on the ground just like that and then
1:06:48 on the ground just like that and then
1:06:48 on the ground just like that and then plug this one like
1:06:51 plug this one like
1:06:51 plug this one like this okay so you can see the shorter
1:06:56 this okay so you can see the shorter
1:06:56 this okay so you can see the shorter um leg is directly on the ground and the
1:06:59 um leg is directly on the ground and the
1:06:59 um leg is directly on the ground and the longer leg is in another column here in
1:07:02 longer leg is in another column here in
1:07:02 longer leg is in another column here in the breadboard so that's the same thing
1:07:04 the breadboard so that's the same thing
1:07:04 the breadboard so that's the same thing we just save one wire okay that we don't
1:07:07 we just save one wire okay that we don't
1:07:07 we just save one wire okay that we don't really need for
1:07:08 really need for
1:07:08 really need for that then I will take my resistor and
1:07:10 that then I will take my resistor and
1:07:10 that then I will take my resistor and plug it
1:07:12 plug it
1:07:12 plug it between
1:07:13 between
1:07:13 between that leg of the LED so make sure it's on
1:07:16 that leg of the LED so make sure it's on
1:07:16 that leg of the LED so make sure it's on the same column and on another column so
1:07:19 the same column and on another column so
1:07:19 the same column and on another column so I'm just going to do like
1:07:21 I'm just going to do like
1:07:21 I'm just going to do like this okay you can see here how the
1:07:25 this okay you can see here how the
1:07:25 this okay you can see here how the resistor and finally I'm going to take
1:07:28 resistor and finally I'm going to take
1:07:28 resistor and finally I'm going to take this uh wire so it could be any color
1:07:31 this uh wire so it could be any color
1:07:31 this uh wire so it could be any color just avoid black and red because black
1:07:33 just avoid black and red because black
1:07:33 just avoid black and red because black is going to be used for ground and red
1:07:35 is going to be used for ground and red
1:07:35 is going to be used for ground and red for power so we try to keep this
1:07:38 for power so we try to keep this
1:07:38 for power so we try to keep this consistent but then for other
1:07:40 consistent but then for other
1:07:40 consistent but then for other connections it doesn't really matter and
1:07:42 connections it doesn't really matter and
1:07:42 connections it doesn't really matter and I'm going to connect so one side of the
1:07:44 I'm going to connect so one side of the
1:07:44 I'm going to connect so one side of the resistor here so the same column to the
1:07:48 resistor here so the same column to the
1:07:48 resistor here so the same column to the gpio number 17 which should be just
1:07:50 gpio number 17 which should be just
1:07:50 gpio number 17 which should be just right to the ground so that's going to
1:07:53 right to the ground so that's going to
1:07:53 right to the ground so that's going to be that one here
1:07:56 okay so I check again one two three four
1:07:59 okay so I check again one two three four
1:07:59 okay so I check again one two three four five on the inside for the ground and
1:08:01 five on the inside for the ground and
1:08:01 five on the inside for the ground and then six for the uh wire here and the
1:08:07 then six for the uh wire here and the
1:08:07 then six for the uh wire here and the circuit is finished you see I have put
1:08:09 circuit is finished you see I have put
1:08:09 circuit is finished you see I have put everything at the top here on one short
1:08:14 everything at the top here on one short
1:08:14 everything at the top here on one short part of my breadboard so I have enough
1:08:16 part of my breadboard so I have enough
1:08:16 part of my breadboard so I have enough space for all the other LEDs and push
1:08:17 space for all the other LEDs and push
1:08:17 space for all the other LEDs and push button and other stuff we're going to
1:08:19 button and other stuff we're going to
1:08:19 button and other stuff we're going to add later okay and to recap so we have
1:08:22 add later okay and to recap so we have
1:08:22 add later okay and to recap so we have the ground going here and then the
1:08:24 the ground going here and then the
1:08:24 the ground going here and then the shorter leg of the LED is connected to
1:08:26 shorter leg of the LED is connected to
1:08:26 shorter leg of the LED is connected to the ground the longer leg is connected
1:08:28 the ground the longer leg is connected
1:08:28 the ground the longer leg is connected to another column that is also connected
1:08:31 to another column that is also connected
1:08:31 to another column that is also connected with one uh side of the resistor and
1:08:34 with one uh side of the resistor and
1:08:34 with one uh side of the resistor and then the other side of the resistor is
1:08:36 then the other side of the resistor is
1:08:36 then the other side of the resistor is connected to GP number 17 and the
1:08:39 connected to GP number 17 and the
1:08:39 connected to GP number 17 and the circuit is done so now you can put the
1:08:42 circuit is done so now you can put the
1:08:42 circuit is done so now you can put the SD card back if you removed it put the
1:08:45 SD card back if you removed it put the
1:08:45 SD card back if you removed it put the case back everything back and we can
1:08:49 case back everything back and we can
1:08:49 case back everything back and we can now
1:08:50 now
1:08:50 now plug Rasberry P again it's going to boot
1:08:54 plug Rasberry P again it's going to boot
1:08:54 plug Rasberry P again it's going to boot and now we can throw program our gpio
1:08:56 and now we can throw program our gpio
1:08:57 and now we can throw program our gpio and program our LED it's going to boot
1:09:00 and program our LED it's going to boot
1:09:00 and program our LED it's going to boot and now we can program our gpio and
1:09:02 and now we can program our gpio and
1:09:03 and now we can program our gpio and program our
1:09:06 LED and welcome back this is episode
1:09:09 LED and welcome back this is episode
1:09:09 LED and welcome back this is episode number six of this tutorial series on
1:09:11 number six of this tutorial series on
1:09:11 number six of this tutorial series on Raspberry Pi for complete beginners in
1:09:14 Raspberry Pi for complete beginners in
1:09:14 Raspberry Pi for complete beginners in this episode you will learn more about
1:09:15 this episode you will learn more about
1:09:15 this episode you will learn more about the gpio panel on the Raspberry Pi and
1:09:18 the gpio panel on the Raspberry Pi and
1:09:18 the gpio panel on the Raspberry Pi and how the GPI work this quick overview
1:09:21 how the GPI work this quick overview
1:09:21 how the GPI work this quick overview will be super useful for what's coming
1:09:23 will be super useful for what's coming
1:09:23 will be super useful for what's coming next here is the complete spine out for
1:09:25 next here is the complete spine out for
1:09:25 next here is the complete spine out for the Raspberry Pi 5 but it's also the
1:09:28 the Raspberry Pi 5 but it's also the
1:09:28 the Raspberry Pi 5 but it's also the same as for the Raspberry Pi 4 3 and two
1:09:31 same as for the Raspberry Pi 4 3 and two
1:09:31 same as for the Raspberry Pi 4 3 and two the gpios haven't changed with the
1:09:33 the gpios haven't changed with the
1:09:33 the gpios haven't changed with the latest evolution of the bolt so as you
1:09:36 latest evolution of the bolt so as you
1:09:36 latest evolution of the bolt so as you can see we have some pins in Black which
1:09:39 can see we have some pins in Black which
1:09:39 can see we have some pins in Black which represent the ground okay we've already
1:09:41 represent the ground okay we've already
1:09:41 represent the ground okay we've already used one all those pins are connected
1:09:43 used one all those pins are connected
1:09:43 used one all those pins are connected together then we have what we call power
1:09:46 together then we have what we call power
1:09:46 together then we have what we call power pins so we have two pins for 3.3 volt in
1:09:49 pins so we have two pins for 3.3 volt in
1:09:49 pins so we have two pins for 3.3 volt in yellow and two pins for 5 volt in red
1:09:53 yellow and two pins for 5 volt in red
1:09:53 yellow and two pins for 5 volt in red then we have the gpio in Orange so again
1:09:55 then we have the gpio in Orange so again
1:09:55 then we have the gpio in Orange so again GPI means general purpose input output
1:09:59 GPI means general purpose input output
1:09:59 GPI means general purpose input output and each gpio has a number that's the
1:10:02 and each gpio has a number that's the
1:10:02 and each gpio has a number that's the number you will use in your python code
1:10:04 number you will use in your python code
1:10:05 number you will use in your python code to interact with that gpio and a quick
1:10:08 to interact with that gpio and a quick
1:10:08 to interact with that gpio and a quick reminder here is that gpios support 3.3
1:10:11 reminder here is that gpios support 3.3
1:10:11 reminder here is that gpios support 3.3 volt not 5vt we only have two pins here
1:10:14 volt not 5vt we only have two pins here
1:10:14 volt not 5vt we only have two pins here that support 5vt So now how are gpos
1:10:18 that support 5vt So now how are gpos
1:10:18 that support 5vt So now how are gpos controlled well it's pretty simple a
1:10:21 controlled well it's pretty simple a
1:10:21 controlled well it's pretty simple a gpio will be set as either an input pin
1:10:25 gpio will be set as either an input pin
1:10:25 gpio will be set as either an input pin or or an output pin input will be used
1:10:28 or or an output pin input will be used
1:10:28 or or an output pin input will be used when you want to read some data for
1:10:30 when you want to read some data for
1:10:30 when you want to read some data for example with a push button you want to
1:10:32 example with a push button you want to
1:10:32 example with a push button you want to read the state of the button and output
1:10:35 read the state of the button and output
1:10:35 read the state of the button and output will be used when you want to write some
1:10:37 will be used when you want to write some
1:10:37 will be used when you want to write some data for example you want to set an LED
1:10:41 data for example you want to set an LED
1:10:41 data for example you want to set an LED so you want to turn on or off an LED so
1:10:43 so you want to turn on or off an LED so
1:10:43 so you want to turn on or off an LED so once the mode for the gpio is set you
1:10:46 once the mode for the gpio is set you
1:10:46 once the mode for the gpio is set you can use it if it set as an input you can
1:10:50 can use it if it set as an input you can
1:10:50 can use it if it set as an input you can wrate a value the value has only two
1:10:53 wrate a value the value has only two
1:10:53 wrate a value the value has only two states high and low so this is a binary
1:10:56 states high and low so this is a binary
1:10:56 states high and low so this is a binary State and high and low here correspond
1:10:58 State and high and low here correspond
1:10:58 State and high and low here correspond to the voltage which was read from the
1:11:01 to the voltage which was read from the
1:11:01 to the voltage which was read from the pin if the voltage is high enough and
1:11:03 pin if the voltage is high enough and
1:11:03 pin if the voltage is high enough and close to 3.3 volt then the value will be
1:11:06 close to 3.3 volt then the value will be
1:11:06 close to 3.3 volt then the value will be high otherwise it will be low and if you
1:11:09 high otherwise it will be low and if you
1:11:09 high otherwise it will be low and if you have set the GPI as output you can then
1:11:12 have set the GPI as output you can then
1:11:12 have set the GPI as output you can then write a value to it and it's also going
1:11:14 write a value to it and it's also going
1:11:14 write a value to it and it's also going to be high or low for an LED if you want
1:11:17 to be high or low for an LED if you want
1:11:17 to be high or low for an LED if you want to turn on the led the gpiu state will
1:11:20 to turn on the led the gpiu state will
1:11:20 to turn on the led the gpiu state will be high so close to 3.3 volt and if you
1:11:24 be high so close to 3.3 volt and if you
1:11:24 be high so close to 3.3 volt and if you want to turn off the LED
1:11:25 want to turn off the LED
1:11:25 want to turn off the LED the GPI state will be set as low so
1:11:28 the GPI state will be set as low so
1:11:28 the GPI state will be set as low so close to Zer volt and that's basically
1:11:31 close to Zer volt and that's basically
1:11:31 close to Zer volt and that's basically how a GPI work okay it's not that
1:11:33 how a GPI work okay it's not that
1:11:33 how a GPI work okay it's not that complicated and in the code we will use
1:11:35 complicated and in the code we will use
1:11:35 complicated and in the code we will use a python library that takes care of all
1:11:38 a python library that takes care of all
1:11:38 a python library that takes care of all that for you so basically we won't have
1:11:40 that for you so basically we won't have
1:11:40 that for you so basically we won't have to deal directly with this and you can
1:11:42 to deal directly with this and you can
1:11:42 to deal directly with this and you can just then focus on your application but
1:11:45 just then focus on your application but
1:11:45 just then focus on your application but with what you've seen here in those few
1:11:47 with what you've seen here in those few
1:11:47 with what you've seen here in those few minutes at least you understand the
1:11:50 minutes at least you understand the
1:11:50 minutes at least you understand the basics of how it works Under The Hoot
1:11:53 basics of how it works Under The Hoot
1:11:53 basics of how it works Under The Hoot now if we come back to the Raspberry Pi
1:11:55 now if we come back to the Raspberry Pi
1:11:55 now if we come back to the Raspberry Pi p pin out image you can see that the
1:11:57 p pin out image you can see that the
1:11:57 p pin out image you can see that the gpios are not set in any specific order
1:12:00 gpios are not set in any specific order
1:12:00 gpios are not set in any specific order okay and some numbers are missing and
1:12:02 okay and some numbers are missing and
1:12:02 okay and some numbers are missing and that's totally okay and it's nothing to
1:12:04 that's totally okay and it's nothing to
1:12:04 that's totally okay and it's nothing to worry about you just have to be extra
1:12:06 worry about you just have to be extra
1:12:06 worry about you just have to be extra careful when finding the GPI number
1:12:08 careful when finding the GPI number
1:12:08 careful when finding the GPI number corresponding to the pin number okay so
1:12:11 corresponding to the pin number okay so
1:12:11 corresponding to the pin number okay so you can see the pin number we have
1:12:12 you can see the pin number we have
1:12:12 you can see the pin number we have numbers from one until 40 so those are
1:12:15 numbers from one until 40 so those are
1:12:15 numbers from one until 40 so those are the gray pins and they are ordered but
1:12:17 the gray pins and they are ordered but
1:12:17 the gray pins and they are ordered but we are not going to use those numbers we
1:12:20 we are not going to use those numbers we
1:12:20 we are not going to use those numbers we are going to use the gpio numbers
1:12:22 are going to use the gpio numbers
1:12:22 are going to use the gpio numbers directly and then what else do we have
1:12:25 directly and then what else do we have
1:12:25 directly and then what else do we have you can see that we also have two
1:12:27 you can see that we also have two
1:12:27 you can see that we also have two reserved pin in Gray so you should not
1:12:30 reserved pin in Gray so you should not
1:12:30 reserved pin in Gray so you should not use those then we have two pins in green
1:12:33 use those then we have two pins in green
1:12:33 use those then we have two pins in green that are used for uart communication you
1:12:36 that are used for uart communication you
1:12:36 that are used for uart communication you also have alternate functions with i2c
1:12:38 also have alternate functions with i2c
1:12:38 also have alternate functions with i2c and SPI Communications so all those are
1:12:41 and SPI Communications so all those are
1:12:41 and SPI Communications so all those are more Advanced Communications and in this
1:12:43 more Advanced Communications and in this
1:12:43 more Advanced Communications and in this course we are just going to focus on the
1:12:45 course we are just going to focus on the
1:12:45 course we are just going to focus on the gpio but if you want to learn more about
1:12:47 gpio but if you want to learn more about
1:12:47 gpio but if you want to learn more about those Communications that can be a nice
1:12:49 those Communications that can be a nice
1:12:49 those Communications that can be a nice thing to research after this
1:12:53 course welcome back this is episode
1:12:56 course welcome back this is episode
1:12:56 course welcome back this is episode number seven of this tutorial series on
1:12:59 number seven of this tutorial series on
1:12:59 number seven of this tutorial series on Raspberry Pi for complete beginners in
1:13:01 Raspberry Pi for complete beginners in
1:13:01 Raspberry Pi for complete beginners in the last tutorial we built a circuit
1:13:03 the last tutorial we built a circuit
1:13:03 the last tutorial we built a circuit with an LED and a resistor let's see how
1:13:05 with an LED and a resistor let's see how
1:13:05 with an LED and a resistor let's see how to control the LED from the Raspberry Pi
1:13:08 to control the LED from the Raspberry Pi
1:13:08 to control the LED from the Raspberry Pi using Python Programming if it's not
1:13:11 using Python Programming if it's not
1:13:11 using Python Programming if it's not done yet you can pour on your Raspberry
1:13:13 done yet you can pour on your Raspberry
1:13:13 done yet you can pour on your Raspberry Pi and just connect to it like you did
1:13:15 Pi and just connect to it like you did
1:13:15 Pi and just connect to it like you did before for example here I'm using VNC
1:13:18 before for example here I'm using VNC
1:13:18 before for example here I'm using VNC then you can open Sony and we will write
1:13:20 then you can open Sony and we will write
1:13:21 then you can open Sony and we will write some python code right here and first of
1:13:23 some python code right here and first of
1:13:23 some python code right here and first of all we are going to include UD a python
1:13:26 all we are going to include UD a python
1:13:26 all we are going to include UD a python module named gpio z so gpio Z okay
1:13:31 module named gpio z so gpio Z okay
1:13:31 module named gpio z so gpio Z okay that's going to be the python module
1:13:33 that's going to be the python module
1:13:33 that's going to be the python module that we want to import so we can control
1:13:36 that we want to import so we can control
1:13:36 that we want to import so we can control the gpio for the LED and how to import
1:13:38 the gpio for the LED and how to import
1:13:39 the gpio for the LED and how to import this module well previously you saw that
1:13:41 this module well previously you saw that
1:13:41 this module well previously you saw that we did that import time for example okay
1:13:44 we did that import time for example okay
1:13:44 we did that import time for example okay because time is a library that uh we
1:13:47 because time is a library that uh we
1:13:47 because time is a library that uh we wanted to use we are also going to use
1:13:49 wanted to use we are also going to use
1:13:49 wanted to use we are also going to use it here so I'm going to keep it here you
1:13:50 it here so I'm going to keep it here you
1:13:50 it here so I'm going to keep it here you just write import and then the name of
1:13:52 just write import and then the name of
1:13:52 just write import and then the name of the library then we can add another
1:13:54 the library then we can add another
1:13:54 the library then we can add another import after that or even before that
1:13:57 import after that or even before that
1:13:57 import after that or even before that okay the order doesn't really matter and
1:13:59 okay the order doesn't really matter and
1:13:59 okay the order doesn't really matter and for example we could do import gpio Z
1:14:03 for example we could do import gpio Z
1:14:03 for example we could do import gpio Z Now the thing is when you do import
1:14:05 Now the thing is when you do import
1:14:05 Now the thing is when you do import Library that's going to import the whole
1:14:08 Library that's going to import the whole
1:14:08 Library that's going to import the whole library with all the functionalities in
1:14:11 library with all the functionalities in
1:14:11 library with all the functionalities in this library and as we will see with
1:14:13 this library and as we will see with
1:14:13 this library and as we will see with python sometimes it's better and we just
1:14:15 python sometimes it's better and we just
1:14:15 python sometimes it's better and we just want to import one specific
1:14:18 want to import one specific
1:14:18 want to import one specific functionality from the library because
1:14:20 functionality from the library because
1:14:20 functionality from the library because gpio0 contains a lot of things for LEDs
1:14:23 gpio0 contains a lot of things for LEDs
1:14:23 gpio0 contains a lot of things for LEDs push button and well many different
1:14:25 push button and well many different
1:14:25 push button and well many different devices so if we want to just import for
1:14:28 devices so if we want to just import for
1:14:28 devices so if we want to just import for example the LED from GP Z then we can
1:14:32 example the LED from GP Z then we can
1:14:32 example the LED from GP Z then we can just write and notice here I used the
1:14:35 just write and notice here I used the
1:14:35 just write and notice here I used the word from we can just do from okay
1:14:37 word from we can just do from okay
1:14:37 word from we can just do from okay there's a keyword from
1:14:39 there's a keyword from
1:14:39 there's a keyword from gpio0 import and then uh there's going
1:14:42 gpio0 import and then uh there's going
1:14:42 gpio0 import and then uh there's going to be l so here we just import the LED
1:14:46 to be l so here we just import the LED
1:14:46 to be l so here we just import the LED because that's the only thing we need
1:14:47 because that's the only thing we need
1:14:47 because that's the only thing we need from that Library so that's kind of a
1:14:50 from that Library so that's kind of a
1:14:50 from that Library so that's kind of a good practice and if you want to import
1:14:52 good practice and if you want to import
1:14:52 good practice and if you want to import several things from that Library you can
1:14:53 several things from that Library you can
1:14:53 several things from that Library you can just add a comma and then put other
1:14:57 just add a comma and then put other
1:14:57 just add a comma and then put other functionalities uh let's just test that
1:14:59 functionalities uh let's just test that
1:14:59 functionalities uh let's just test that it works here I'm just going to run that
1:15:01 it works here I'm just going to run that
1:15:01 it works here I'm just going to run that and you see we don't have any error this
1:15:03 and you see we don't have any error this
1:15:03 and you see we don't have any error this means that it was found okay so the gpio
1:15:07 means that it was found okay so the gpio
1:15:07 means that it was found okay so the gpio Z is already installed for you with
1:15:10 Z is already installed for you with
1:15:10 Z is already installed for you with Raspberry p you don't need to do
1:15:12 Raspberry p you don't need to do
1:15:12 Raspberry p you don't need to do anything it's already installed and
1:15:13 anything it's already installed and
1:15:13 anything it's already installed and configured great so now we can
1:15:15 configured great so now we can
1:15:15 configured great so now we can initialize our LED and how to do that
1:15:17 initialize our LED and how to do that
1:15:17 initialize our LED and how to do that well it's very simple we're going to
1:15:19 well it's very simple we're going to
1:15:19 well it's very simple we're going to create a variable here let's call it led
1:15:22 create a variable here let's call it led
1:15:22 create a variable here let's call it led lowercase is equal to and then we're
1:15:25 lowercase is equal to and then we're
1:15:25 lowercase is equal to and then we're going to use the LED here so uppercase
1:15:28 going to use the LED here so uppercase
1:15:28 going to use the LED here so uppercase LED we're going to open and close
1:15:30 LED we're going to open and close
1:15:30 LED we're going to open and close parenthesis and inside that we're going
1:15:32 parenthesis and inside that we're going
1:15:32 parenthesis and inside that we're going to need to put the gpio number so on the
1:15:36 to need to put the gpio number so on the
1:15:36 to need to put the gpio number so on the image you can see we used the gpio
1:15:38 image you can see we used the gpio
1:15:38 image you can see we used the gpio number 17 so you just put 17 right here
1:15:42 number 17 so you just put 17 right here
1:15:42 number 17 so you just put 17 right here and that's how you initialize an LED so
1:15:45 and that's how you initialize an LED so
1:15:45 and that's how you initialize an LED so under the hood what it will do and as
1:15:47 under the hood what it will do and as
1:15:47 under the hood what it will do and as you've seen in the previous lesson it
1:15:49 you've seen in the previous lesson it
1:15:49 you've seen in the previous lesson it will set the gpio 17 as output so then
1:15:54 will set the gpio 17 as output so then
1:15:54 will set the gpio 17 as output so then we can control
1:15:55 we can control
1:15:55 we can control then how to control it so how to say
1:15:57 then how to control it so how to say
1:15:57 then how to control it so how to say that we want the state to be high or to
1:15:59 that we want the state to be high or to
1:15:59 that we want the state to be high or to be low then you can do LED so you're
1:16:02 be low then you can do LED so you're
1:16:02 be low then you can do LED so you're going to use this variable which in fact
1:16:05 going to use this variable which in fact
1:16:05 going to use this variable which in fact more technically is going to be an
1:16:07 more technically is going to be an
1:16:07 more technically is going to be an object okay but I'm going to keep the
1:16:08 object okay but I'm going to keep the
1:16:08 object okay but I'm going to keep the word variable here so you're going to
1:16:10 word variable here so you're going to
1:16:10 word variable here so you're going to use LED Dot and then you have a function
1:16:14 use LED Dot and then you have a function
1:16:14 use LED Dot and then you have a function inside the LED uh functionality here LED
1:16:18 inside the LED uh functionality here LED
1:16:18 inside the LED uh functionality here LED dot on to turn on the LED it's quite
1:16:22 dot on to turn on the LED it's quite
1:16:22 dot on to turn on the LED it's quite simple and as you call a function you
1:16:24 simple and as you call a function you
1:16:24 simple and as you call a function you need to put some parenthesis okay every
1:16:26 need to put some parenthesis okay every
1:16:26 need to put some parenthesis okay every time you call a function directly you
1:16:28 time you call a function directly you
1:16:28 time you call a function directly you need to put the parenthesis here we
1:16:30 need to put the parenthesis here we
1:16:30 need to put the parenthesis here we don't have any argument to pass to the
1:16:33 don't have any argument to pass to the
1:16:33 don't have any argument to pass to the function okay but we still need to give
1:16:35 function okay but we still need to give
1:16:35 function okay but we still need to give the parenthesis so LED on is going to
1:16:39 the parenthesis so LED on is going to
1:16:39 the parenthesis so LED on is going to turn on the LED so it's going to set the
1:16:41 turn on the LED so it's going to set the
1:16:41 turn on the LED so it's going to set the state for the LED so for the PIN to high
1:16:44 state for the LED so for the PIN to high
1:16:45 state for the LED so for the PIN to high or 3.3 volt and then you also have led
1:16:48 or 3.3 volt and then you also have led
1:16:48 or 3.3 volt and then you also have led dot off okay so it's quite simple to
1:16:51 dot off okay so it's quite simple to
1:16:51 dot off okay so it's quite simple to understand and this one is going to turn
1:16:53 understand and this one is going to turn
1:16:53 understand and this one is going to turn off the LED so it's gonna set the GPI to
1:16:56 off the LED so it's gonna set the GPI to
1:16:56 off the LED so it's gonna set the GPI to low or basically close to zero volt okay
1:17:00 low or basically close to zero volt okay
1:17:00 low or basically close to zero volt okay and so what's going to happen if we run
1:17:02 and so what's going to happen if we run
1:17:02 and so what's going to happen if we run this program well we will not see
1:17:04 this program well we will not see
1:17:04 this program well we will not see anything because you ask to turn on the
1:17:06 anything because you ask to turn on the
1:17:06 anything because you ask to turn on the LED and to turn it off right after it so
1:17:09 LED and to turn it off right after it so
1:17:09 LED and to turn it off right after it so you will not see anything or maybe just
1:17:11 you will not see anything or maybe just
1:17:11 you will not see anything or maybe just very brief flash so what we can do is
1:17:14 very brief flash so what we can do is
1:17:14 very brief flash so what we can do is we're going to use this time Library
1:17:16 we're going to use this time Library
1:17:16 we're going to use this time Library here to do time dot slip and then let's
1:17:21 here to do time dot slip and then let's
1:17:21 here to do time dot slip and then let's slip for one second okay so this we have
1:17:24 slip for one second okay so this we have
1:17:24 slip for one second okay so this we have used already
1:17:25 used already
1:17:25 used already we're going to turn on the LED for one
1:17:27 we're going to turn on the LED for one
1:17:27 we're going to turn on the LED for one second and then turn off the LED and
1:17:30 second and then turn off the LED and
1:17:30 second and then turn off the LED and that's the end of the program so let's
1:17:32 that's the end of the program so let's
1:17:32 that's the end of the program so let's run this program and let's see what it's
1:17:34 run this program and let's see what it's
1:17:34 run this program and let's see what it's going to do and you can see the LED is
1:17:37 going to do and you can see the LED is
1:17:37 going to do and you can see the LED is turn on for one second and then turn off
1:17:40 turn on for one second and then turn off
1:17:40 turn on for one second and then turn off I can run the program again so I click
1:17:42 I can run the program again so I click
1:17:42 I can run the program again so I click again and we have the same behavior now
1:17:45 again and we have the same behavior now
1:17:45 again and we have the same behavior now there is one thing I want to show you is
1:17:48 there is one thing I want to show you is
1:17:48 there is one thing I want to show you is okay let's say that we only have this
1:17:49 okay let's say that we only have this
1:17:49 okay let's say that we only have this line so I'm going to comment you see the
1:17:51 line so I'm going to comment you see the
1:17:51 line so I'm going to comment you see the comment is quite useful here so I can
1:17:53 comment is quite useful here so I can
1:17:53 comment is quite useful here so I can comment it and then we can can uh put
1:17:55 comment it and then we can can uh put
1:17:55 comment it and then we can can uh put the code back again later so for now we
1:17:58 the code back again later so for now we
1:17:58 the code back again later so for now we just set the LED to on to high and let's
1:18:01 just set the LED to on to high and let's
1:18:01 just set the LED to on to high and let's see what's going to
1:18:03 see what's going to
1:18:03 see what's going to happen and as you can see the LED is
1:18:06 happen and as you can see the LED is
1:18:06 happen and as you can see the LED is turned on and then it stays on okay the
1:18:09 turned on and then it stays on okay the
1:18:09 turned on and then it stays on okay the program has finished but the LED stays
1:18:12 program has finished but the LED stays
1:18:12 program has finished but the LED stays on and you might think well it's quite
1:18:14 on and you might think well it's quite
1:18:14 on and you might think well it's quite obvious we didn't ask to turn it off but
1:18:17 obvious we didn't ask to turn it off but
1:18:17 obvious we didn't ask to turn it off but uh actually in this gpio zero there is a
1:18:20 uh actually in this gpio zero there is a
1:18:20 uh actually in this gpio zero there is a what is called a cleanup mechanism okay
1:18:22 what is called a cleanup mechanism okay
1:18:22 what is called a cleanup mechanism okay because when you finish your program you
1:18:24 because when you finish your program you
1:18:24 because when you finish your program you want to basically reset all the pins to
1:18:28 want to basically reset all the pins to
1:18:28 want to basically reset all the pins to their default State and default mode and
1:18:30 their default State and default mode and
1:18:30 their default State and default mode and basically the default mode for all the
1:18:32 basically the default mode for all the
1:18:32 basically the default mode for all the pins is input and this is just a simple
1:18:35 pins is input and this is just a simple
1:18:35 pins is input and this is just a simple safety mechanism because if you leave a
1:18:38 safety mechanism because if you leave a
1:18:38 safety mechanism because if you leave a pin as output and then let's say you
1:18:40 pin as output and then let's say you
1:18:40 pin as output and then let's say you plug a push button in it you might
1:18:43 plug a push button in it you might
1:18:43 plug a push button in it you might create a short circuit so no need to
1:18:45 create a short circuit so no need to
1:18:45 create a short circuit so no need to worry about this for now but you just
1:18:46 worry about this for now but you just
1:18:46 worry about this for now but you just need to know that if we run a code like
1:18:49 need to know that if we run a code like
1:18:49 need to know that if we run a code like this from Sony the gp0 is not going to
1:18:52 this from Sony the gp0 is not going to
1:18:52 this from Sony the gp0 is not going to do the cleanup correctly and I'm just
1:18:54 do the cleanup correctly and I'm just
1:18:54 do the cleanup correctly and I'm just talking about this now because later on
1:18:56 talking about this now because later on
1:18:56 talking about this now because later on we're going to actually use the terminal
1:18:58 we're going to actually use the terminal
1:18:58 we're going to actually use the terminal to run our programs and when using the
1:19:00 to run our programs and when using the
1:19:00 to run our programs and when using the terminal we won't have this problem okay
1:19:03 terminal we won't have this problem okay
1:19:03 terminal we won't have this problem okay so don't worry if you didn't really
1:19:05 so don't worry if you didn't really
1:19:05 so don't worry if you didn't really understand what I just said now it's
1:19:06 understand what I just said now it's
1:19:06 understand what I just said now it's going to make sense when we use the
1:19:09 going to make sense when we use the
1:19:09 going to make sense when we use the terminal and you're going to see the
1:19:10 terminal and you're going to see the
1:19:10 terminal and you're going to see the difference with what we did right now so
1:19:13 difference with what we did right now so
1:19:13 difference with what we did right now so we have our LED on I'm going to come
1:19:14 we have our LED on I'm going to come
1:19:14 we have our LED on I'm going to come back to this code LED on we sleep for
1:19:17 back to this code LED on we sleep for
1:19:17 back to this code LED on we sleep for one second and then LED off now what if
1:19:20 one second and then LED off now what if
1:19:20 one second and then LED off now what if you want to do this not just one time
1:19:23 you want to do this not just one time
1:19:23 you want to do this not just one time but maybe two three five 10 times or
1:19:26 but maybe two three five 10 times or
1:19:26 but maybe two three five 10 times or even an infinite amount of time well
1:19:28 even an infinite amount of time well
1:19:28 even an infinite amount of time well you're not going to repeat this code an
1:19:31 you're not going to repeat this code an
1:19:31 you're not going to repeat this code an infinite amount of time you can use a
1:19:33 infinite amount of time you can use a
1:19:33 infinite amount of time you can use a loop so for example let's say that I
1:19:35 loop so for example let's say that I
1:19:35 loop so for example let's say that I want to Simply do a infinite while loop
1:19:40 want to Simply do a infinite while loop
1:19:40 want to Simply do a infinite while loop and I just want to say that when I start
1:19:41 and I just want to say that when I start
1:19:41 and I just want to say that when I start the program the LED is going to Blink
1:19:44 the program the LED is going to Blink
1:19:44 the program the LED is going to Blink until I stop the program I can do while
1:19:47 until I stop the program I can do while
1:19:47 until I stop the program I can do while then how to create an infinite Loop well
1:19:49 then how to create an infinite Loop well
1:19:49 then how to create an infinite Loop well I'm just going to put true while true so
1:19:52 I'm just going to put true while true so
1:19:52 I'm just going to put true while true so true is always going to be true which
1:19:54 true is always going to be true which
1:19:54 true is always going to be true which means that we are always going to uh
1:19:56 means that we are always going to uh
1:19:56 means that we are always going to uh continue executing the loop until we uh
1:19:59 continue executing the loop until we uh
1:19:59 continue executing the loop until we uh here until we press on the stop button
1:20:01 here until we press on the stop button
1:20:01 here until we press on the stop button and so what I need to do here you can
1:20:02 and so what I need to do here you can
1:20:02 and so what I need to do here you can see I have to put that with an extra
1:20:04 see I have to put that with an extra
1:20:04 see I have to put that with an extra indentation so I select all the code and
1:20:06 indentation so I select all the code and
1:20:06 indentation so I select all the code and I press tab which means that this is
1:20:08 I press tab which means that this is
1:20:08 I press tab which means that this is going to be in the way Loop and it
1:20:11 going to be in the way Loop and it
1:20:11 going to be in the way Loop and it misses something because if you read the
1:20:13 misses something because if you read the
1:20:13 misses something because if you read the code what's going to happen with an on
1:20:16 code what's going to happen with an on
1:20:16 code what's going to happen with an on the LED we wait for one second then we
1:20:18 the LED we wait for one second then we
1:20:18 the LED we wait for one second then we turn off the LED we go back and we turn
1:20:21 turn off the LED we go back and we turn
1:20:21 turn off the LED we go back and we turn on the LED so we don't wait here before
1:20:24 on the LED so we don't wait here before
1:20:24 on the LED so we don't wait here before LED off and led on so if you run the
1:20:28 LED off and led on so if you run the
1:20:28 LED off and led on so if you run the code like this you will see the LED on
1:20:31 code like this you will see the LED on
1:20:31 code like this you will see the LED on all the time because there's there's no
1:20:34 all the time because there's there's no
1:20:34 all the time because there's there's no delay here between LED off and led on so
1:20:38 delay here between LED off and led on so
1:20:38 delay here between LED off and led on so we need to add another time do sleep
1:20:41 we need to add another time do sleep
1:20:41 we need to add another time do sleep with let's say one second as well so
1:20:44 with let's say one second as well so
1:20:44 with let's say one second as well so it's going to turn on the LED wait for
1:20:46 it's going to turn on the LED wait for
1:20:46 it's going to turn on the LED wait for one second and turn off the LED wait for
1:20:48 one second and turn off the LED wait for
1:20:49 one second and turn off the LED wait for one second Etc and let's run that
1:20:52 one second Etc and let's run that
1:20:52 one second Etc and let's run that program here
1:20:55 program here
1:20:55 program here okay you can see now the LED is blinking
1:20:59 okay you can see now the LED is blinking
1:20:59 okay you can see now the LED is blinking and if I want to stop the program I can
1:21:01 and if I want to stop the program I can
1:21:01 and if I want to stop the program I can just click on stop here okay so here I
1:21:05 just click on stop here okay so here I
1:21:05 just click on stop here okay so here I stopped and you can see it was uh off
1:21:08 stopped and you can see it was uh off
1:21:08 stopped and you can see it was uh off but now let's run it again and let's
1:21:10 but now let's run it again and let's
1:21:10 but now let's run it again and let's stop it now you see I stop it when it's
1:21:13 stop it now you see I stop it when it's
1:21:13 stop it now you see I stop it when it's on and the LED stays on for the same
1:21:16 on and the LED stays on for the same
1:21:16 on and the LED stays on for the same reason as I told you before because the
1:21:18 reason as I told you before because the
1:21:18 reason as I told you before because the gpio Z is not cleaning up correctly here
1:21:21 gpio Z is not cleaning up correctly here
1:21:21 gpio Z is not cleaning up correctly here when we run the code from thony but l
1:21:24 when we run the code from thony but l
1:21:24 when we run the code from thony but l later on as I told you before everything
1:21:26 later on as I told you before everything
1:21:26 later on as I told you before everything is going to be fixed with the terminal
1:21:28 is going to be fixed with the terminal
1:21:28 is going to be fixed with the terminal so you have learned how to control a LED
1:21:30 so you have learned how to control a LED
1:21:30 so you have learned how to control a LED with python and you can see with this
1:21:32 with python and you can see with this
1:21:32 with python and you can see with this GPI Library it's very easy to
1:21:37 do welcome back this is episode number
1:21:40 do welcome back this is episode number
1:21:40 do welcome back this is episode number eight of this tutorial series on
1:21:42 eight of this tutorial series on
1:21:42 eight of this tutorial series on Raspberry Pi for complete beginners our
1:21:45 Raspberry Pi for complete beginners our
1:21:45 Raspberry Pi for complete beginners our circuit now contains an LED and we are
1:21:47 circuit now contains an LED and we are
1:21:47 circuit now contains an LED and we are going to add a PGE button so I will show
1:21:50 going to add a PGE button so I will show
1:21:50 going to add a PGE button so I will show you step by step exactly what you need
1:21:52 you step by step exactly what you need
1:21:52 you step by step exactly what you need to do to add this PGE button and then in
1:21:54 to do to add this PGE button and then in
1:21:54 to do to add this PGE button and then in the next lesson we are going to control
1:21:56 the next lesson we are going to control
1:21:56 the next lesson we are going to control it with python and the first thing so
1:21:58 it with python and the first thing so
1:21:59 it with python and the first thing so here you can see I'm still on the
1:22:00 here you can see I'm still on the
1:22:00 here you can see I'm still on the Raspberry Pi OS desktop make sure first
1:22:03 Raspberry Pi OS desktop make sure first
1:22:03 Raspberry Pi OS desktop make sure first that you shut down the Raspberry p okay
1:22:06 that you shut down the Raspberry p okay
1:22:07 that you shut down the Raspberry p okay so shut it down and remove the power
1:22:10 so shut it down and remove the power
1:22:10 so shut it down and remove the power cable so here I'm back on my circuit I
1:22:13 cable so here I'm back on my circuit I
1:22:13 cable so here I'm back on my circuit I will first show you with this software
1:22:15 will first show you with this software
1:22:15 will first show you with this software and then with the real circuit we still
1:22:17 and then with the real circuit we still
1:22:17 and then with the real circuit we still have the LED here we not going to touch
1:22:19 have the LED here we not going to touch
1:22:19 have the LED here we not going to touch anything about that but we have two new
1:22:22 anything about that but we have two new
1:22:22 anything about that but we have two new components here we have this push button
1:22:24 components here we have this push button
1:22:24 components here we have this push button and we we also have a 1 kilm resistor so
1:22:27 and we we also have a 1 kilm resistor so
1:22:27 and we we also have a 1 kilm resistor so that's the exact same model as we had
1:22:29 that's the exact same model as we had
1:22:29 that's the exact same model as we had for the LED and once again here even if
1:22:32 for the LED and once again here even if
1:22:32 for the LED and once again here even if you see Raspberry Pi 4 on my software
1:22:36 you see Raspberry Pi 4 on my software
1:22:36 you see Raspberry Pi 4 on my software it's the same for Raspberry Pi 5
1:22:38 it's the same for Raspberry Pi 5
1:22:38 it's the same for Raspberry Pi 5 Raspberry Pi 3 Etc okay so the push
1:22:40 Raspberry Pi 3 Etc okay so the push
1:22:41 Raspberry Pi 3 Etc okay so the push button you will see that a push button
1:22:42 button you will see that a push button
1:22:42 button you will see that a push button has four legs but actually if I click
1:22:45 has four legs but actually if I click
1:22:45 has four legs but actually if I click here this leg on the left is connected
1:22:48 here this leg on the left is connected
1:22:48 here this leg on the left is connected to that one and this leg on the right is
1:22:51 to that one and this leg on the right is
1:22:51 to that one and this leg on the right is connected to that one so in the end you
1:22:54 connected to that one so in the end you
1:22:54 connected to that one so in the end you only have basically two connections okay
1:22:56 only have basically two connections okay
1:22:56 only have basically two connections okay so this one is connected to that one and
1:22:58 so this one is connected to that one and
1:22:58 so this one is connected to that one and this one to that one what I will do is I
1:23:01 this one to that one what I will do is I
1:23:01 this one to that one what I will do is I will put my push button usually what I
1:23:04 will put my push button usually what I
1:23:04 will put my push button usually what I do is so I'm going to go on the right
1:23:05 do is so I'm going to go on the right
1:23:05 do is so I'm going to go on the right here and I put it in the middle like
1:23:08 here and I put it in the middle like
1:23:08 here and I put it in the middle like that so it's connected to uh both sides
1:23:12 that so it's connected to uh both sides
1:23:13 that so it's connected to uh both sides just because if you put it here you see
1:23:15 just because if you put it here you see
1:23:15 just because if you put it here you see that then you only have one possible dot
1:23:18 that then you only have one possible dot
1:23:18 that then you only have one possible dot to connect something okay if I put it in
1:23:21 to connect something okay if I put it in
1:23:21 to connect something okay if I put it in the middle then I have additional dots
1:23:24 the middle then I have additional dots
1:23:24 the middle then I have additional dots okay I have more space basically so
1:23:26 okay I have more space basically so
1:23:26 okay I have more space basically so we're going to do it like this and now
1:23:27 we're going to do it like this and now
1:23:28 we're going to do it like this and now you can see that because of this
1:23:29 you can see that because of this
1:23:29 you can see that because of this connection here all the dots in this
1:23:31 connection here all the dots in this
1:23:31 connection here all the dots in this line are also connected to all the dot
1:23:35 line are also connected to all the dot
1:23:35 line are also connected to all the dot in that line so in that column okay so
1:23:37 in that line so in that column okay so
1:23:37 in that line so in that column okay so this whole column those five and five
1:23:40 this whole column those five and five
1:23:40 this whole column those five and five Dots here are connected together and the
1:23:42 Dots here are connected together and the
1:23:42 Dots here are connected together and the same for that side so the first thing I
1:23:45 same for that side so the first thing I
1:23:45 same for that side so the first thing I will do is connect the button to the
1:23:47 will do is connect the button to the
1:23:47 will do is connect the button to the ground and you can see we already have
1:23:49 ground and you can see we already have
1:23:49 ground and you can see we already have the ground so the ground is connected
1:23:51 the ground so the ground is connected
1:23:51 the ground so the ground is connected from the Raspberry Pi to this blue line
1:23:54 from the Raspberry Pi to this blue line
1:23:54 from the Raspberry Pi to this blue line here here so I'm going to take this dot
1:23:56 here here so I'm going to take this dot
1:23:56 here here so I'm going to take this dot here and connect it to the ground and
1:23:59 here and connect it to the ground and
1:23:59 here and connect it to the ground and I'm just going to choose a black
1:24:01 I'm just going to choose a black
1:24:01 I'm just going to choose a black color so why is black here all right
1:24:05 color so why is black here all right
1:24:06 color so why is black here all right okay we use black for ground so then
1:24:08 okay we use black for ground so then
1:24:08 okay we use black for ground so then it's much easier not to make mistakes in
1:24:10 it's much easier not to make mistakes in
1:24:10 it's much easier not to make mistakes in the future and then this is where so you
1:24:13 the future and then this is where so you
1:24:14 the future and then this is where so you can see here I have a full so the line
1:24:16 can see here I have a full so the line
1:24:16 can see here I have a full so the line is fully connected this is where if you
1:24:18 is fully connected this is where if you
1:24:18 is fully connected this is where if you have a disconnection in the middle for
1:24:20 have a disconnection in the middle for
1:24:20 have a disconnection in the middle for example here so that only applies for
1:24:23 example here so that only applies for
1:24:23 example here so that only applies for those of you who have a long bird board
1:24:25 those of you who have a long bird board
1:24:25 those of you who have a long bird board and it's disconnected in the middle then
1:24:27 and it's disconnected in the middle then
1:24:27 and it's disconnected in the middle then the ground here is not going to be
1:24:30 the ground here is not going to be
1:24:30 the ground here is not going to be connected to that side so maybe in this
1:24:32 connected to that side so maybe in this
1:24:32 connected to that side so maybe in this case you might want to add an extra wire
1:24:35 case you might want to add an extra wire
1:24:36 case you might want to add an extra wire here if it was disconnected okay I'm
1:24:38 here if it was disconnected okay I'm
1:24:38 here if it was disconnected okay I'm going to come back to this on the real
1:24:40 going to come back to this on the real
1:24:40 going to come back to this on the real circuit if you have a fully connected
1:24:43 circuit if you have a fully connected
1:24:43 circuit if you have a fully connected braad B like this you don't need to
1:24:44 braad B like this you don't need to
1:24:44 braad B like this you don't need to worry about that and then so we have one
1:24:46 worry about that and then so we have one
1:24:46 worry about that and then so we have one side of the button connected to the
1:24:48 side of the button connected to the
1:24:48 side of the button connected to the ground and I'm going to just connect
1:24:51 ground and I'm going to just connect
1:24:51 ground and I'm going to just connect here I'm going to plug an resistor so
1:24:54 here I'm going to plug an resistor so
1:24:54 here I'm going to plug an resistor so wherever here on the other side so I can
1:24:56 wherever here on the other side so I can
1:24:57 wherever here on the other side so I can even put it here if I want okay it's the
1:24:59 even put it here if I want okay it's the
1:24:59 even put it here if I want okay it's the same and then I will connect so
1:25:00 same and then I will connect so
1:25:01 same and then I will connect so basically I will connect this leg here
1:25:03 basically I will connect this leg here
1:25:03 basically I will connect this leg here on the right which is going through a
1:25:07 on the right which is going through a
1:25:07 on the right which is going through a resistor I will connect to a gpio on the
1:25:10 resistor I will connect to a gpio on the
1:25:10 resistor I will connect to a gpio on the Raspberry Pi and that's going to be that
1:25:12 Raspberry Pi and that's going to be that
1:25:12 Raspberry Pi and that's going to be that one gpio number
1:25:14 one gpio number
1:25:14 one gpio number 26 and I chose this one okay because
1:25:17 26 and I chose this one okay because
1:25:17 26 and I chose this one okay because it's quite easy to locate is going to be
1:25:19 it's quite easy to locate is going to be
1:25:19 it's quite easy to locate is going to be also on the inside of the Raspberry Pi
1:25:22 also on the inside of the Raspberry Pi
1:25:22 also on the inside of the Raspberry Pi and you can see that the first one here
1:25:23 and you can see that the first one here
1:25:23 and you can see that the first one here the first pin on the right is a ground
1:25:26 the first pin on the right is a ground
1:25:26 the first pin on the right is a ground so that's going to be the second to last
1:25:28 so that's going to be the second to last
1:25:28 so that's going to be the second to last pin so you're going to connect this one
1:25:31 pin so you're going to connect this one
1:25:31 pin so you're going to connect this one to to uh that part here so to that leg
1:25:36 to to uh that part here so to that leg
1:25:36 to to uh that part here so to that leg of the resistor I'm just going to make
1:25:38 of the resistor I'm just going to make
1:25:38 of the resistor I'm just going to make it
1:25:49 nicer and I'm going to change the color
1:25:52 nicer and I'm going to change the color
1:25:52 nicer and I'm going to change the color here because we don't want black um
1:25:54 here because we don't want black um
1:25:54 here because we don't want black um let's use blue for example because I'm
1:25:56 let's use blue for example because I'm
1:25:56 let's use blue for example because I'm going to use a blue wire later but it
1:25:58 going to use a blue wire later but it
1:25:58 going to use a blue wire later but it can be any color you want all right and
1:26:00 can be any color you want all right and
1:26:00 can be any color you want all right and that's basically it for the PGE button
1:26:02 that's basically it for the PGE button
1:26:02 that's basically it for the PGE button so we have the ground to one side of the
1:26:04 so we have the ground to one side of the
1:26:04 so we have the ground to one side of the button then on the other side we have
1:26:06 button then on the other side we have
1:26:06 button then on the other side we have this resistor which is basically just
1:26:08 this resistor which is basically just
1:26:09 this resistor which is basically just here to reduce the uh current that's
1:26:12 here to reduce the uh current that's
1:26:12 here to reduce the uh current that's more like a safety feature you might
1:26:14 more like a safety feature you might
1:26:14 more like a safety feature you might find some circuits online that don't
1:26:17 find some circuits online that don't
1:26:17 find some circuits online that don't even use the resistor okay they just
1:26:19 even use the resistor okay they just
1:26:19 even use the resistor okay they just connect the two legs of the push button
1:26:21 connect the two legs of the push button
1:26:21 connect the two legs of the push button directly to the Raspberry Pi here I just
1:26:24 directly to the Raspberry Pi here I just
1:26:24 directly to the Raspberry Pi here I just add this resistor to reduce the current
1:26:26 add this resistor to reduce the current
1:26:27 add this resistor to reduce the current as an additional safety and then
1:26:29 as an additional safety and then
1:26:29 as an additional safety and then basically so you see one side is
1:26:30 basically so you see one side is
1:26:31 basically so you see one side is connected to the ground and the other
1:26:32 connected to the ground and the other
1:26:32 connected to the ground and the other side is connected to a gpio and now
1:26:35 side is connected to a gpio and now
1:26:35 side is connected to a gpio and now let's go to the real
1:26:38 let's go to the real
1:26:38 let's go to the real circuit so we are on the real cqu and as
1:26:41 circuit so we are on the real cqu and as
1:26:41 circuit so we are on the real cqu and as you can see so I have just shut down my
1:26:42 you can see so I have just shut down my
1:26:43 you can see so I have just shut down my raspberry pie I'm going to make sure to
1:26:44 raspberry pie I'm going to make sure to
1:26:44 raspberry pie I'm going to make sure to power it off and just to make it easier
1:26:47 power it off and just to make it easier
1:26:47 power it off and just to make it easier for you to see I'm going to use the same
1:26:49 for you to see I'm going to use the same
1:26:49 for you to see I'm going to use the same orientation as in the software so like
1:26:53 orientation as in the software so like
1:26:53 orientation as in the software so like this and then then the first thing you
1:26:55 this and then then the first thing you
1:26:55 this and then then the first thing you might want to do just in case you have a
1:26:57 might want to do just in case you have a
1:26:57 might want to do just in case you have a disconnection in the middle here so I
1:26:59 disconnection in the middle here so I
1:26:59 disconnection in the middle here so I don't have a disconnection but if you
1:27:01 don't have a disconnection but if you
1:27:01 don't have a disconnection but if you have then you might for example put one
1:27:04 have then you might for example put one
1:27:04 have then you might for example put one you see take one small black wire male
1:27:06 you see take one small black wire male
1:27:06 you see take one small black wire male to male and then you plug it just like
1:27:09 to male and then you plug it just like
1:27:09 to male and then you plug it just like that for example if the disc connection
1:27:11 that for example if the disc connection
1:27:11 that for example if the disc connection is here which means that the left part
1:27:14 is here which means that the left part
1:27:14 is here which means that the left part here is going to be connected to the
1:27:15 here is going to be connected to the
1:27:15 here is going to be connected to the right part and then everything is going
1:27:18 right part and then everything is going
1:27:18 right part and then everything is going to be connected to the ground okay so
1:27:20 to be connected to the ground okay so
1:27:20 to be connected to the ground okay so that's just in case and now I'm going to
1:27:22 that's just in case and now I'm going to
1:27:22 that's just in case and now I'm going to remove that because I don't need it
1:27:24 remove that because I don't need it
1:27:24 remove that because I don't need it now what do I have I have my push button
1:27:27 now what do I have I have my push button
1:27:27 now what do I have I have my push button I have my 1 kilohm resistor that's the
1:27:30 I have my 1 kilohm resistor that's the
1:27:30 I have my 1 kilohm resistor that's the same as the one we use for the LED so if
1:27:34 same as the one we use for the LED so if
1:27:34 same as the one we use for the LED so if you have a doubt about the value and how
1:27:36 you have a doubt about the value and how
1:27:36 you have a doubt about the value and how to pick the color you can come back to
1:27:37 to pick the color you can come back to
1:27:37 to pick the color you can come back to previous videos and then I have a small
1:27:41 previous videos and then I have a small
1:27:41 previous videos and then I have a small black wire so male to male and I have a
1:27:45 black wire so male to male and I have a
1:27:45 black wire so male to male and I have a here blue wire the color doesn't matter
1:27:47 here blue wire the color doesn't matter
1:27:47 here blue wire the color doesn't matter just don't use red and don't use black
1:27:50 just don't use red and don't use black
1:27:50 just don't use red and don't use black and this one is a male to female
1:27:55 and this one is a male to female
1:27:55 and this one is a male to female so I'm going to take my push button and
1:27:57 so I'm going to take my push button and
1:27:57 so I'm going to take my push button and I'm going to connect it here while on
1:27:59 I'm going to connect it here while on
1:27:59 I'm going to connect it here while on the right okay just like this between
1:28:04 the right okay just like this between
1:28:04 the right okay just like this between the two parts okay now I'm going to
1:28:07 the two parts okay now I'm going to
1:28:07 the two parts okay now I'm going to connect the ground so let's just take
1:28:11 connect the ground so let's just take
1:28:11 connect the ground so let's just take whatever dot here and connect whatever
1:28:13 whatever dot here and connect whatever
1:28:13 whatever dot here and connect whatever dot on this blue line okay I just make
1:28:16 dot on this blue line okay I just make
1:28:16 dot on this blue line okay I just make sure that I don't put the wire too close
1:28:18 sure that I don't put the wire too close
1:28:18 sure that I don't put the wire too close to the button because what's going to
1:28:20 to the button because what's going to
1:28:20 to the button because what's going to happen is we actually going to push the
1:28:23 happen is we actually going to push the
1:28:23 happen is we actually going to push the button so we're going you need to touch
1:28:24 button so we're going you need to touch
1:28:24 button so we're going you need to touch the circuit and if you see you have the
1:28:27 the circuit and if you see you have the
1:28:27 the circuit and if you see you have the wire too close or the resistor too close
1:28:29 wire too close or the resistor too close
1:28:29 wire too close or the resistor too close then you might touch it and it's better
1:28:31 then you might touch it and it's better
1:28:31 then you might touch it and it's better to avoid doing that so I'm just going to
1:28:33 to avoid doing that so I'm just going to
1:28:33 to avoid doing that so I'm just going to plug it here okay so I have enough space
1:28:36 plug it here okay so I have enough space
1:28:36 plug it here okay so I have enough space then to push the button without touching
1:28:40 then to push the button without touching
1:28:40 then to push the button without touching anything so that's the left side of the
1:28:43 anything so that's the left side of the
1:28:43 anything so that's the left side of the button now on the right side I could
1:28:46 button now on the right side I could
1:28:46 button now on the right side I could plug it here but I'm going to plug it
1:28:47 plug it here but I'm going to plug it
1:28:47 plug it here but I'm going to plug it here so make sure it's on the same
1:28:50 here so make sure it's on the same
1:28:50 here so make sure it's on the same column
1:28:51 column
1:28:51 column right I'm going to put an resistor and
1:28:55 right I'm going to put an resistor and
1:28:55 right I'm going to put an resistor and right
1:28:56 right
1:28:56 right here it doesn't matter where you put it
1:28:59 here it doesn't matter where you put it
1:28:59 here it doesn't matter where you put it where you put the leg it just matters
1:29:01 where you put the leg it just matters
1:29:01 where you put the leg it just matters that it's column with no other
1:29:05 that it's column with no other
1:29:05 that it's column with no other components so just like this and then I
1:29:08 components so just like this and then I
1:29:08 components so just like this and then I will connect this side of the resistor
1:29:12 will connect this side of the resistor
1:29:12 will connect this side of the resistor so here for example to the S to last pin
1:29:17 so here for example to the S to last pin
1:29:17 so here for example to the S to last pin on the Rasberry Pi so from the bottom
1:29:21 on the Rasberry Pi so from the bottom
1:29:21 on the Rasberry Pi so from the bottom right which is that one
1:29:26 okay so now
1:29:29 okay so now
1:29:29 okay so now it's looks like it's in all right so
1:29:32 it's looks like it's in all right so
1:29:32 it's looks like it's in all right so just like that so now on the Rasberry
1:29:34 just like that so now on the Rasberry
1:29:34 just like that so now on the Rasberry pip we have the ground here we have the
1:29:37 pip we have the ground here we have the
1:29:37 pip we have the ground here we have the uh first LED and then we have the button
1:29:41 uh first LED and then we have the button
1:29:41 uh first LED and then we have the button right here and our circuit is now
1:29:45 right here and our circuit is now
1:29:45 right here and our circuit is now finished what you can do now is you just
1:29:48 finished what you can do now is you just
1:29:48 finished what you can do now is you just power on so if you have removed the SD
1:29:50 power on so if you have removed the SD
1:29:50 power on so if you have removed the SD count because you don't have a case you
1:29:52 count because you don't have a case you
1:29:52 count because you don't have a case you put it back and then you can for on the
1:29:55 put it back and then you can for on the
1:29:55 put it back and then you can for on the rber
1:29:59 p and welcome back this is episode
1:30:02 p and welcome back this is episode
1:30:02 p and welcome back this is episode number nine of this tutorial series on
1:30:04 number nine of this tutorial series on
1:30:04 number nine of this tutorial series on Raspberry Pi for complete beginners and
1:30:06 Raspberry Pi for complete beginners and
1:30:06 Raspberry Pi for complete beginners and we are back to our Raspberry Pi OS with
1:30:09 we are back to our Raspberry Pi OS with
1:30:10 we are back to our Raspberry Pi OS with thony so make sure that you wait enough
1:30:12 thony so make sure that you wait enough
1:30:12 thony so make sure that you wait enough time so that the Raspberry Pi is
1:30:13 time so that the Raspberry Pi is
1:30:13 time so that the Raspberry Pi is connected again to the Wi-Fi network if
1:30:16 connected again to the Wi-Fi network if
1:30:16 connected again to the Wi-Fi network if needed it can happen sometime that the
1:30:18 needed it can happen sometime that the
1:30:18 needed it can happen sometime that the rber P never connects well you just
1:30:20 rber P never connects well you just
1:30:20 rber P never connects well you just remove the power cable and you put it
1:30:22 remove the power cable and you put it
1:30:22 remove the power cable and you put it again but make sure that you wait at
1:30:23 again but make sure that you wait at
1:30:23 again but make sure that you wait at least two 3 minutes before you do this
1:30:25 least two 3 minutes before you do this
1:30:25 least two 3 minutes before you do this and then well we are connected back to
1:30:28 and then well we are connected back to
1:30:28 and then well we are connected back to the pi and we can use Python to detect
1:30:31 the pi and we can use Python to detect
1:30:31 the pi and we can use Python to detect when the button is pressed or not
1:30:34 when the button is pressed or not
1:30:34 when the button is pressed or not pressed so how are we going to do this
1:30:36 pressed so how are we going to do this
1:30:36 pressed so how are we going to do this well we are going to also use the gpio
1:30:40 well we are going to also use the gpio
1:30:40 well we are going to also use the gpio zero so we're going to do from gpio zero
1:30:43 zero so we're going to do from gpio zero
1:30:43 zero so we're going to do from gpio zero and then import so instead of LED this
1:30:46 and then import so instead of LED this
1:30:46 and then import so instead of LED this time we have button so button with only
1:30:49 time we have button so button with only
1:30:49 time we have button so button with only the B uppercase then I'm also going to
1:30:52 the B uppercase then I'm also going to
1:30:52 the B uppercase then I'm also going to import time because we're going to use
1:30:54 import time because we're going to use
1:30:54 import time because we're going to use it a bit later all right and we have
1:30:56 it a bit later all right and we have
1:30:56 it a bit later all right and we have everything correctly imported now how to
1:30:59 everything correctly imported now how to
1:30:59 everything correctly imported now how to initialize the button it's going to be
1:31:02 initialize the button it's going to be
1:31:02 initialize the button it's going to be very similar at what we did with the LED
1:31:04 very similar at what we did with the LED
1:31:04 very similar at what we did with the LED you're going to create a variable here
1:31:06 you're going to create a variable here
1:31:06 you're going to create a variable here let's name it button for example is
1:31:08 let's name it button for example is
1:31:08 let's name it button for example is equal to and you're going to use the
1:31:10 equal to and you're going to use the
1:31:10 equal to and you're going to use the same name here so button with B
1:31:14 same name here so button with B
1:31:14 same name here so button with B uppercase you open and close the
1:31:16 uppercase you open and close the
1:31:16 uppercase you open and close the parenthesis and you need to give the
1:31:18 parenthesis and you need to give the
1:31:18 parenthesis and you need to give the gpio number for that pin and the gpio we
1:31:22 gpio number for that pin and the gpio we
1:31:22 gpio number for that pin and the gpio we use to read the p button value is the
1:31:25 use to read the p button value is the
1:31:25 use to read the p button value is the gpio number 26 as you can see on the
1:31:29 gpio number 26 as you can see on the
1:31:29 gpio number 26 as you can see on the image so what this line is going to do
1:31:32 image so what this line is going to do
1:31:32 image so what this line is going to do is going to initialize the gpio 26 as an
1:31:36 is going to initialize the gpio 26 as an
1:31:36 is going to initialize the gpio 26 as an input pin okay for the LED was output
1:31:39 input pin okay for the LED was output
1:31:39 input pin okay for the LED was output here it's input so then we can read the
1:31:42 here it's input so then we can read the
1:31:42 here it's input so then we can read the value from the push button and how to
1:31:45 value from the push button and how to
1:31:45 value from the push button and how to read the value from the push button well
1:31:48 read the value from the push button well
1:31:48 read the value from the push button well we have inside button we can do button
1:31:50 we have inside button we can do button
1:31:50 we have inside button we can do button dot is pressed and note here that we
1:31:55 dot is pressed and note here that we
1:31:55 dot is pressed and note here that we don't have any parentheses okay it's
1:31:57 don't have any parentheses okay it's
1:31:57 don't have any parentheses okay it's just is pressed like that this is going
1:32:00 just is pressed like that this is going
1:32:00 just is pressed like that this is going to return true if the button is pressed
1:32:03 to return true if the button is pressed
1:32:04 to return true if the button is pressed and false if the button is not pressed
1:32:06 and false if the button is not pressed
1:32:06 and false if the button is not pressed which is basically the two states of the
1:32:08 which is basically the two states of the
1:32:08 which is basically the two states of the button so what to do with this we can
1:32:10 button so what to do with this we can
1:32:10 button so what to do with this we can put it inside a variable and we can
1:32:12 put it inside a variable and we can
1:32:12 put it inside a variable and we can print this variable we can also directly
1:32:14 print this variable we can also directly
1:32:14 print this variable we can also directly print it that's what we're going to do
1:32:17 print it that's what we're going to do
1:32:17 print it that's what we're going to do just to test so let's run that and let's
1:32:19 just to test so let's run that and let's
1:32:19 just to test so let's run that and let's see what we have and well you can see we
1:32:22 see what we have and well you can see we
1:32:22 see what we have and well you can see we have false so as I told you this is
1:32:24 have false so as I told you this is
1:32:24 have false so as I told you this is going to return true or false and
1:32:26 going to return true or false and
1:32:26 going to return true or false and because the button is not pressed then
1:32:28 because the button is not pressed then
1:32:28 because the button is not pressed then we have false and now what I will do is
1:32:31 we have false and now what I will do is
1:32:31 we have false and now what I will do is I will press the button okay so the
1:32:33 I will press the button okay so the
1:32:33 I will press the button okay so the button is pressed and at the same time I
1:32:34 button is pressed and at the same time I
1:32:35 button is pressed and at the same time I run the program and you see now it is
1:32:37 run the program and you see now it is
1:32:37 run the program and you see now it is true okay I run again true then I
1:32:41 true okay I run again true then I
1:32:41 true okay I run again true then I release and then it's false again so you
1:32:45 release and then it's false again so you
1:32:45 release and then it's false again so you can see for a push button is very easy
1:32:47 can see for a push button is very easy
1:32:47 can see for a push button is very easy you just initialize the push button and
1:32:49 you just initialize the push button and
1:32:49 you just initialize the push button and then you do button do is pressed and you
1:32:52 then you do button do is pressed and you
1:32:52 then you do button do is pressed and you just know if the button is pressed or
1:32:53 just know if the button is pressed or
1:32:53 just know if the button is pressed or not just to improve that let's say we
1:32:55 not just to improve that let's say we
1:32:55 not just to improve that let's say we want to keep uh reading the state of the
1:32:58 want to keep uh reading the state of the
1:32:58 want to keep uh reading the state of the button and print the state for example
1:33:00 button and print the state for example
1:33:00 button and print the state for example every one second we can do something
1:33:03 every one second we can do something
1:33:03 every one second we can do something similar as what we did with the LED we
1:33:05 similar as what we did with the LED we
1:33:05 similar as what we did with the LED we can do a while through okay so let's
1:33:08 can do a while through okay so let's
1:33:08 can do a while through okay so let's create an infinite Loop and we are going
1:33:11 create an infinite Loop and we are going
1:33:11 create an infinite Loop and we are going to print the button in this Loop and of
1:33:14 to print the button in this Loop and of
1:33:14 to print the button in this Loop and of course well we don't want to print it at
1:33:17 course well we don't want to print it at
1:33:17 course well we don't want to print it at an infinite speed so it's not infinite
1:33:20 an infinite speed so it's not infinite
1:33:20 an infinite speed so it's not infinite it's basically the the speed of the
1:33:21 it's basically the the speed of the
1:33:21 it's basically the the speed of the Raspberry Pi of the CPU but we want to
1:33:24 Raspberry Pi of the CPU but we want to
1:33:24 Raspberry Pi of the CPU but we want to print it every one second so time sleep
1:33:28 print it every one second so time sleep
1:33:28 print it every one second so time sleep with one okay so with this we initialize
1:33:30 with one okay so with this we initialize
1:33:30 with one okay so with this we initialize the button and then we just print it
1:33:32 the button and then we just print it
1:33:32 the button and then we just print it state every second so I'm going to run
1:33:36 state every second so I'm going to run
1:33:36 state every second so I'm going to run this program and you can see it is
1:33:40 false okay and now so it's still false I
1:33:43 false okay and now so it's still false I
1:33:44 false okay and now so it's still false I will press you see I press on the button
1:33:46 will press you see I press on the button
1:33:46 will press you see I press on the button it's true I release it's false I press
1:33:50 it's true I release it's false I press
1:33:50 it's true I release it's false I press again it is true I release it's false
1:33:54 again it is true I release it's false
1:33:54 again it is true I release it's false etc etc wow you're still here
1:33:57 etc etc wow you're still here
1:33:57 etc etc wow you're still here congratulations why I say that is
1:33:59 congratulations why I say that is
1:33:59 congratulations why I say that is because many people give up on tutorials
1:34:02 because many people give up on tutorials
1:34:02 because many people give up on tutorials after just a few minutes but you have
1:34:04 after just a few minutes but you have
1:34:04 after just a few minutes but you have made it until this point if you are
1:34:06 made it until this point if you are
1:34:06 made it until this point if you are enjoying this tutorial so far you can
1:34:08 enjoying this tutorial so far you can
1:34:08 enjoying this tutorial so far you can check out the full course named
1:34:10 check out the full course named
1:34:10 check out the full course named Raspberry Pi for beginners which
1:34:12 Raspberry Pi for beginners which
1:34:12 Raspberry Pi for beginners which actually contains 10 hours of Hands-On
1:34:14 actually contains 10 hours of Hands-On
1:34:14 actually contains 10 hours of Hands-On video lessons I will leave a link in the
1:34:17 video lessons I will leave a link in the
1:34:17 video lessons I will leave a link in the description if you're interested all
1:34:18 description if you're interested all
1:34:18 description if you're interested all right and let's continue with the
1:34:22 video welcome back this is episode
1:34:25 video welcome back this is episode
1:34:25 video welcome back this is episode number 10 of this tutorial series on
1:34:27 number 10 of this tutorial series on
1:34:27 number 10 of this tutorial series on Raspberry Pi for complete beginners this
1:34:30 Raspberry Pi for complete beginners this
1:34:30 Raspberry Pi for complete beginners this tutorial is actually a challenge I'm
1:34:32 tutorial is actually a challenge I'm
1:34:32 tutorial is actually a challenge I'm going to give to you to make you
1:34:33 going to give to you to make you
1:34:33 going to give to you to make you practice with what we've seen before in
1:34:35 practice with what we've seen before in
1:34:35 practice with what we've seen before in the tutorial Series so first I will
1:34:37 the tutorial Series so first I will
1:34:38 the tutorial Series so first I will explain what you have to do and then I
1:34:39 explain what you have to do and then I
1:34:39 explain what you have to do and then I will do the solution step by step so
1:34:42 will do the solution step by step so
1:34:42 will do the solution step by step so here is the challenge you will need to
1:34:44 here is the challenge you will need to
1:34:44 here is the challenge you will need to power on the LED when the button is
1:34:47 power on the LED when the button is
1:34:47 power on the LED when the button is pressed okay so as simple as that if the
1:34:50 pressed okay so as simple as that if the
1:34:50 pressed okay so as simple as that if the button is pressed the LED is powered on
1:34:53 button is pressed the LED is powered on
1:34:53 button is pressed the LED is powered on if the button is not pressed the LED is
1:34:56 if the button is not pressed the LED is
1:34:56 if the button is not pressed the LED is powered off and you can see the result
1:34:58 powered off and you can see the result
1:34:58 powered off and you can see the result on that video when I press the button
1:35:00 on that video when I press the button
1:35:00 on that video when I press the button the LED is turned on when I release the
1:35:03 the LED is turned on when I release the
1:35:03 the LED is turned on when I release the button the LED is turned off all right
1:35:06 button the LED is turned off all right
1:35:06 button the LED is turned off all right and now you can press pause on the video
1:35:08 and now you can press pause on the video
1:35:08 and now you can press pause on the video try to do the challenge by yourself and
1:35:10 try to do the challenge by yourself and
1:35:10 try to do the challenge by yourself and then watch the
1:35:12 then watch the
1:35:12 then watch the solution and here is the solution to
1:35:14 solution and here is the solution to
1:35:14 solution and here is the solution to this first challenge or what I also call
1:35:17 this first challenge or what I also call
1:35:17 this first challenge or what I also call activity so I'm first going to do the
1:35:19 activity so I'm first going to do the
1:35:19 activity so I'm first going to do the solution with the code that we have seen
1:35:21 solution with the code that we have seen
1:35:22 solution with the code that we have seen previously and then I'm going to give
1:35:23 previously and then I'm going to give
1:35:24 previously and then I'm going to give you two additional things that are very
1:35:26 you two additional things that are very
1:35:26 you two additional things that are very important first is a way to improve the
1:35:29 important first is a way to improve the
1:35:29 important first is a way to improve the program and make it more efficient and
1:35:31 program and make it more efficient and
1:35:31 program and make it more efficient and the second is well we're going to use a
1:35:33 the second is well we're going to use a
1:35:33 the second is well we're going to use a different way to write the program and
1:35:35 different way to write the program and
1:35:36 different way to write the program and that we will use directly for the next
1:35:38 that we will use directly for the next
1:35:38 that we will use directly for the next activity of this course so let's get
1:35:40 activity of this course so let's get
1:35:40 activity of this course so let's get started the first thing we need to do is
1:35:42 started the first thing we need to do is
1:35:42 started the first thing we need to do is to import stuff so from gpio Z import so
1:35:49 to import stuff so from gpio Z import so
1:35:49 to import stuff so from gpio Z import so we need to import the LED and the button
1:35:51 we need to import the LED and the button
1:35:52 we need to import the LED and the button because we're going to use both so so
1:35:54 because we're going to use both so so
1:35:54 because we're going to use both so so LED maybe you have written this from
1:35:57 LED maybe you have written this from
1:35:57 LED maybe you have written this from gpiu Z
1:36:00 gpiu Z
1:36:00 gpiu Z import like this import button and that
1:36:04 import like this import button and that
1:36:04 import like this import button and that is correct okay it's going to import the
1:36:06 is correct okay it's going to import the
1:36:06 is correct okay it's going to import the Ed and the button but what we can also
1:36:08 Ed and the button but what we can also
1:36:08 Ed and the button but what we can also do is to add a comma so I showed you
1:36:12 do is to add a comma so I showed you
1:36:12 do is to add a comma so I showed you that before we can add a comma and just
1:36:14 that before we can add a comma and just
1:36:14 that before we can add a comma and just do button okay so from library import
1:36:19 do button okay so from library import
1:36:19 do button okay so from library import functionality one comma functionality 2
1:36:22 functionality one comma functionality 2
1:36:22 functionality one comma functionality 2 comma Etc Great so now I will initialize
1:36:25 comma Etc Great so now I will initialize
1:36:25 comma Etc Great so now I will initialize my
1:36:25 my
1:36:26 my LED just like that so LED I put the GP
1:36:30 LED just like that so LED I put the GP
1:36:30 LED just like that so LED I put the GP number 17 and then
1:36:32 number 17 and then
1:36:32 number 17 and then button I put button and the GP number
1:36:37 button I put button and the GP number
1:36:37 button I put button and the GP number 26 so first things first we initialize
1:36:41 26 so first things first we initialize
1:36:41 26 so first things first we initialize the GP 17 and we initialize the gpio 26
1:36:45 the GP 17 and we initialize the gpio 26
1:36:45 the GP 17 and we initialize the gpio 26 and then we want to detect so when the
1:36:48 and then we want to detect so when the
1:36:48 and then we want to detect so when the button is pressed we power on the LED if
1:36:51 button is pressed we power on the LED if
1:36:51 button is pressed we power on the LED if it's not pressed well the LED is going
1:36:53 it's not pressed well the LED is going
1:36:53 it's not pressed well the LED is going to be turned off and I don't want to
1:36:55 to be turned off and I don't want to
1:36:55 to be turned off and I don't want to just do that one time here when we run
1:36:58 just do that one time here when we run
1:36:58 just do that one time here when we run the program I want to do it continuously
1:37:01 the program I want to do it continuously
1:37:01 the program I want to do it continuously so I'm also going to use this while
1:37:03 so I'm also going to use this while
1:37:03 so I'm also going to use this while through Loop so an infinite Loop and I'm
1:37:07 through Loop so an infinite Loop and I'm
1:37:07 through Loop so an infinite Loop and I'm going to say simply if button dot is
1:37:12 going to say simply if button dot is
1:37:12 going to say simply if button dot is pressed I'm going to put a colum and if
1:37:15 pressed I'm going to put a colum and if
1:37:15 pressed I'm going to put a colum and if it's true well we do LED dot
1:37:19 it's true well we do LED dot
1:37:19 it's true well we do LED dot on if it is not true then I'm GNA go
1:37:22 on if it is not true then I'm GNA go
1:37:22 on if it is not true then I'm GNA go back here so if it's not true it can
1:37:25 back here so if it's not true it can
1:37:25 back here so if it's not true it can only be false so I'm going to put else
1:37:28 only be false so I'm going to put else
1:37:28 only be false so I'm going to put else and then LED dot off okay and pay
1:37:32 and then LED dot off okay and pay
1:37:32 and then LED dot off okay and pay attention to the indentation here the
1:37:34 attention to the indentation here the
1:37:34 attention to the indentation here the whole if is with one indentation because
1:37:38 whole if is with one indentation because
1:37:38 whole if is with one indentation because it's it side do while but then for
1:37:40 it's it side do while but then for
1:37:40 it's it side do while but then for example that instruction has one
1:37:42 example that instruction has one
1:37:43 example that instruction has one indentation of four spaces plus an extra
1:37:46 indentation of four spaces plus an extra
1:37:46 indentation of four spaces plus an extra one and now I can test my program so
1:37:49 one and now I can test my program so
1:37:49 one and now I can test my program so let's just run it okay it's running so
1:37:53 let's just run it okay it's running so
1:37:53 let's just run it okay it's running so there's not thing printed here but it's
1:37:54 there's not thing printed here but it's
1:37:54 there's not thing printed here but it's running and I can just uh press on the
1:37:57 running and I can just uh press on the
1:37:57 running and I can just uh press on the push button you see the LED is on now I
1:38:00 push button you see the LED is on now I
1:38:00 push button you see the LED is on now I release okay and you can see when it's
1:38:02 release okay and you can see when it's
1:38:02 release okay and you can see when it's pressed it's on when it's released it's
1:38:05 pressed it's on when it's released it's
1:38:05 pressed it's on when it's released it's off on off on off Etc so that's working
1:38:10 off on off on off Etc so that's working
1:38:10 off on off on off Etc so that's working and if you have written this code well
1:38:12 and if you have written this code well
1:38:12 and if you have written this code well you have solved the activity but now I'm
1:38:14 you have solved the activity but now I'm
1:38:14 you have solved the activity but now I'm going to show you something additional
1:38:16 going to show you something additional
1:38:16 going to show you something additional so actually two things let's start with
1:38:19 so actually two things let's start with
1:38:19 so actually two things let's start with the first one and the first one is about
1:38:22 the first one and the first one is about
1:38:22 the first one and the first one is about optimizing the program a bit and why do
1:38:24 optimizing the program a bit and why do
1:38:24 optimizing the program a bit and why do I care about optimizing here because I'm
1:38:26 I care about optimizing here because I'm
1:38:27 I care about optimizing here because I'm going to show you something so while the
1:38:28 going to show you something so while the
1:38:28 going to show you something so while the program is running you can go here and
1:38:33 program is running you can go here and
1:38:33 program is running you can go here and search for it's going to be the task
1:38:36 search for it's going to be the task
1:38:36 search for it's going to be the task manager
1:38:38 manager
1:38:38 manager here okay and let's wait that it
1:38:42 here okay and let's wait that it
1:38:42 here okay and let's wait that it initializes okay and you can see we have
1:38:45 initializes okay and you can see we have
1:38:45 initializes okay and you can see we have here a command Python 3 so that's
1:38:48 here a command Python 3 so that's
1:38:48 here a command Python 3 so that's basically the program that's running you
1:38:50 basically the program that's running you
1:38:50 basically the program that's running you can ignore the rest and you can see that
1:38:52 can ignore the rest and you can see that
1:38:52 can ignore the rest and you can see that this Python 3 command is is taking
1:38:54 this Python 3 command is is taking
1:38:54 this Python 3 command is is taking 25% of the CPU and what does that mean
1:38:57 25% of the CPU and what does that mean
1:38:57 25% of the CPU and what does that mean so actually on Raspberry Pi here on the
1:39:00 so actually on Raspberry Pi here on the
1:39:00 so actually on Raspberry Pi here on the Raspberry Pi 5 I have four CPUs and when
1:39:03 Raspberry Pi 5 I have four CPUs and when
1:39:03 Raspberry Pi 5 I have four CPUs and when you run a python script it's going to
1:39:05 you run a python script it's going to
1:39:05 you run a python script it's going to run using one CPU unless you have a
1:39:08 run using one CPU unless you have a
1:39:08 run using one CPU unless you have a multi- threaded application but that's
1:39:10 multi- threaded application but that's
1:39:10 multi- threaded application but that's like way more complex and for now it's
1:39:11 like way more complex and for now it's
1:39:12 like way more complex and for now it's just using one CPU so when you see 25%
1:39:15 just using one CPU so when you see 25%
1:39:15 just using one CPU so when you see 25% it means that the program is actually
1:39:17 it means that the program is actually
1:39:17 it means that the program is actually using the whole CPU so a program as
1:39:20 using the whole CPU so a program as
1:39:20 using the whole CPU so a program as simple as this is using the whole CPU
1:39:23 simple as this is using the whole CPU
1:39:23 simple as this is using the whole CPU why is that why is that because well we
1:39:25 why is that why is that because well we
1:39:25 why is that why is that because well we have an infinite Loop that just runs at
1:39:28 have an infinite Loop that just runs at
1:39:28 have an infinite Loop that just runs at full speed and if it runs at full speed
1:39:31 full speed and if it runs at full speed
1:39:31 full speed and if it runs at full speed is basically well going to run as fast
1:39:33 is basically well going to run as fast
1:39:33 is basically well going to run as fast as it can and use 100% of the resources
1:39:37 as it can and use 100% of the resources
1:39:37 as it can and use 100% of the resources of one CPU so we want to avoid that for
1:39:40 of one CPU so we want to avoid that for
1:39:40 of one CPU so we want to avoid that for well for a few reasons first uh it's
1:39:42 well for a few reasons first uh it's
1:39:42 well for a few reasons first uh it's going to make your raspberry Pike heat
1:39:44 going to make your raspberry Pike heat
1:39:44 going to make your raspberry Pike heat more so if you don't have any fan or
1:39:46 more so if you don't have any fan or
1:39:46 more so if you don't have any fan or anything to protect from the heat well
1:39:48 anything to protect from the heat well
1:39:48 anything to protect from the heat well it's going to heat quite a lot not
1:39:50 it's going to heat quite a lot not
1:39:50 it's going to heat quite a lot not necessarily a problem but well you don't
1:39:52 necessarily a problem but well you don't
1:39:52 necessarily a problem but well you don't want to have your Raspberry Pi too hot
1:39:54 want to have your Raspberry Pi too hot
1:39:54 want to have your Raspberry Pi too hot and then while you are using one full
1:39:57 and then while you are using one full
1:39:57 and then while you are using one full CPU so anything else that you run is
1:39:59 CPU so anything else that you run is
1:39:59 CPU so anything else that you run is going to be slower and if there is an
1:40:01 going to be slower and if there is an
1:40:01 going to be slower and if there is an easy way to solve that then we're going
1:40:03 easy way to solve that then we're going
1:40:03 easy way to solve that then we're going to do it okay so instead of running this
1:40:05 to do it okay so instead of running this
1:40:05 to do it okay so instead of running this full speed we don't need to run this
1:40:07 full speed we don't need to run this
1:40:07 full speed we don't need to run this full speed we could add a small delay
1:40:11 full speed we could add a small delay
1:40:11 full speed we could add a small delay actually between each iteration of the Y
1:40:14 actually between each iteration of the Y
1:40:14 actually between each iteration of the Y Loop I'm going to add here I'm going to
1:40:16 Loop I'm going to add here I'm going to
1:40:16 Loop I'm going to add here I'm going to import time and what I can do is after
1:40:19 import time and what I can do is after
1:40:19 import time and what I can do is after uh I read the button I'm going to add so
1:40:23 uh I read the button I'm going to add so
1:40:23 uh I read the button I'm going to add so I back to this invation okay after the
1:40:25 I back to this invation okay after the
1:40:25 I back to this invation okay after the if time do slep and let's actually pause
1:40:30 if time do slep and let's actually pause
1:40:30 if time do slep and let's actually pause the program but for very short times for
1:40:32 the program but for very short times for
1:40:32 the program but for very short times for example
1:40:34 example
1:40:34 example 0.01 sign so that's very very tiny
1:40:37 0.01 sign so that's very very tiny
1:40:37 0.01 sign so that's very very tiny that's basically 10 mills so you will
1:40:40 that's basically 10 mills so you will
1:40:40 that's basically 10 mills so you will not see that okay when you run the
1:40:42 not see that okay when you run the
1:40:42 not see that okay when you run the program you will not see any difference
1:40:45 program you will not see any difference
1:40:45 program you will not see any difference because we as human we well we can't see
1:40:47 because we as human we well we can't see
1:40:47 because we as human we well we can't see a 10 millisecond difference in the
1:40:49 a 10 millisecond difference in the
1:40:49 a 10 millisecond difference in the program so it's going to do the exact
1:40:51 program so it's going to do the exact
1:40:51 program so it's going to do the exact same thing but this Loop is going to be
1:40:53 same thing but this Loop is going to be
1:40:53 same thing but this Loop is going to be running at a much much slower speed
1:40:57 running at a much much slower speed
1:40:57 running at a much much slower speed which is still high enough for this
1:40:59 which is still high enough for this
1:40:59 which is still high enough for this application so now let's stop and let's
1:41:01 application so now let's stop and let's
1:41:01 application so now let's stop and let's run this again now you can well you can
1:41:04 run this again now you can well you can
1:41:04 run this again now you can well you can press the push button again this is
1:41:06 press the push button again this is
1:41:06 press the push button again this is going to be exactly the same thing but
1:41:09 going to be exactly the same thing but
1:41:09 going to be exactly the same thing but if we have a look at our task manager
1:41:13 if we have a look at our task manager
1:41:13 if we have a look at our task manager again so let's wait a few seconds for
1:41:17 again so let's wait a few seconds for
1:41:17 again so let's wait a few seconds for that initialization and Python 3 is here
1:41:21 that initialization and Python 3 is here
1:41:21 that initialization and Python 3 is here and now it's using zero so not 0% but 0
1:41:24 and now it's using zero so not 0% but 0
1:41:25 and now it's using zero so not 0% but 0 point something per. so you see we went
1:41:27 point something per. so you see we went
1:41:27 point something per. so you see we went from 100% of one CPU to something that's
1:41:32 from 100% of one CPU to something that's
1:41:32 from 100% of one CPU to something that's very very very tiny okay so this
1:41:36 very very very tiny okay so this
1:41:36 very very very tiny okay so this Improvement is actually quite important
1:41:38 Improvement is actually quite important
1:41:38 Improvement is actually quite important if you run a infinite Loop like this for
1:41:41 if you run a infinite Loop like this for
1:41:41 if you run a infinite Loop like this for a program that you run a Raspberry Pi
1:41:43 a program that you run a Raspberry Pi
1:41:43 a program that you run a Raspberry Pi it's better uh if this Loop is going to
1:41:47 it's better uh if this Loop is going to
1:41:47 it's better uh if this Loop is going to run at full speed so the full CPU speed
1:41:49 run at full speed so the full CPU speed
1:41:49 run at full speed so the full CPU speed it's better to slow it down a bit by
1:41:52 it's better to slow it down a bit by
1:41:52 it's better to slow it down a bit by adding here a Time dot slip with a small
1:41:55 adding here a Time dot slip with a small
1:41:55 adding here a Time dot slip with a small amount and basically this is 10
1:41:57 amount and basically this is 10
1:41:57 amount and basically this is 10 millisecond so it's 0.01 second that
1:42:00 millisecond so it's 0.01 second that
1:42:00 millisecond so it's 0.01 second that means that you are going to run this at
1:42:03 means that you are going to run this at
1:42:03 means that you are going to run this at about 100 times per second okay so
1:42:07 about 100 times per second okay so
1:42:07 about 100 times per second okay so that's still a lot and we are talking
1:42:08 that's still a lot and we are talking
1:42:08 that's still a lot and we are talking here about so if it's 100 times per
1:42:10 here about so if it's 100 times per
1:42:10 here about so if it's 100 times per second we also talk about a loop that
1:42:13 second we also talk about a loop that
1:42:13 second we also talk about a loop that runs at 100 Hertz so that's for the
1:42:16 runs at 100 Hertz so that's for the
1:42:16 runs at 100 Hertz so that's for the technical terms and one thing is maybe
1:42:20 technical terms and one thing is maybe
1:42:20 technical terms and one thing is maybe I'm going to just put that
1:42:23 I'm going to just put that
1:42:23 I'm going to just put that at the beginning of the loop it doesn't
1:42:25 at the beginning of the loop it doesn't
1:42:25 at the beginning of the loop it doesn't really change anything okay I just put
1:42:27 really change anything okay I just put
1:42:27 really change anything okay I just put it at the beginning so that I don't
1:42:29 it at the beginning so that I don't
1:42:29 it at the beginning so that I don't forget it later if I have more code and
1:42:31 forget it later if I have more code and
1:42:31 forget it later if I have more code and also well as I add code maybe I'm going
1:42:34 also well as I add code maybe I'm going
1:42:34 also well as I add code maybe I'm going to mess up the indentation for that so
1:42:36 to mess up the indentation for that so
1:42:36 to mess up the indentation for that so here I make sure that it's at the
1:42:38 here I make sure that it's at the
1:42:38 here I make sure that it's at the beginning of the loop and it's going to
1:42:39 beginning of the loop and it's going to
1:42:39 beginning of the loop and it's going to slow the loop so we run it at 100 times
1:42:43 slow the loop so we run it at 100 times
1:42:43 slow the loop so we run it at 100 times per second great let me stop that and
1:42:46 per second great let me stop that and
1:42:46 per second great let me stop that and now I want to show you something else so
1:42:48 now I want to show you something else so
1:42:48 now I want to show you something else so that's not related to optimization or
1:42:51 that's not related to optimization or
1:42:51 that's not related to optimization or anything it's just that we are going to
1:42:52 anything it's just that we are going to
1:42:52 anything it's just that we are going to use
1:42:53 use
1:42:53 use another functionality from the GP
1:42:55 another functionality from the GP
1:42:55 another functionality from the GP library to do actually the exact same
1:42:58 library to do actually the exact same
1:42:58 library to do actually the exact same thing okay but the code is going to be
1:43:00 thing okay but the code is going to be
1:43:00 thing okay but the code is going to be much smaller and that's the code we are
1:43:03 much smaller and that's the code we are
1:43:03 much smaller and that's the code we are going to use also for the next activity
1:43:05 going to use also for the next activity
1:43:05 going to use also for the next activity so first that was actually a very good
1:43:07 so first that was actually a very good
1:43:07 so first that was actually a very good practice for you to work on loops and
1:43:09 practice for you to work on loops and
1:43:09 practice for you to work on loops and conditions okay so that's why I kept it
1:43:11 conditions okay so that's why I kept it
1:43:11 conditions okay so that's why I kept it like this and now let's see how we can
1:43:13 like this and now let's see how we can
1:43:13 like this and now let's see how we can write this code differently so what I'm
1:43:15 write this code differently so what I'm
1:43:15 write this code differently so what I'm going to do is I'm going to comment that
1:43:19 going to do is I'm going to comment that
1:43:19 going to do is I'm going to comment that like this comment so we don't execute it
1:43:22 like this comment so we don't execute it
1:43:22 like this comment so we don't execute it and and there is in fact inside this
1:43:25 and and there is in fact inside this
1:43:25 and and there is in fact inside this button functionality what we can do is
1:43:28 button functionality what we can do is
1:43:28 button functionality what we can do is just write button so using this button
1:43:30 just write button so using this button
1:43:30 just write button so using this button here dot when press is equal to and then
1:43:36 here dot when press is equal to and then
1:43:36 here dot when press is equal to and then just give a function here so for example
1:43:40 just give a function here so for example
1:43:40 just give a function here so for example LED do on and not that we don't provide
1:43:44 LED do on and not that we don't provide
1:43:44 LED do on and not that we don't provide any parentheses okay I'm going to
1:43:47 any parentheses okay I'm going to
1:43:47 any parentheses okay I'm going to explain that just in one minute so we
1:43:49 explain that just in one minute so we
1:43:49 explain that just in one minute so we can say that when the button is pressed
1:43:51 can say that when the button is pressed
1:43:51 can say that when the button is pressed when pressed we're going to turn the X
1:43:53 when pressed we're going to turn the X
1:43:53 when pressed we're going to turn the X LED on and then we can also do button do
1:43:56 LED on and then we can also do button do
1:43:56 LED on and then we can also do button do when
1:43:58 when
1:43:58 when released LED do off and so this line is
1:44:02 released LED do off and so this line is
1:44:02 released LED do off and so this line is actually not going to stop it's just
1:44:03 actually not going to stop it's just
1:44:03 actually not going to stop it's just going to register here this this
1:44:07 going to register here this this
1:44:07 going to register here this this function and this one as well so if we
1:44:10 function and this one as well so if we
1:44:10 function and this one as well so if we just run the program like this well it's
1:44:12 just run the program like this well it's
1:44:12 just run the program like this well it's going to run and then it's going to exit
1:44:14 going to run and then it's going to exit
1:44:14 going to run and then it's going to exit so it's not going to do anything so we
1:44:16 so it's not going to do anything so we
1:44:16 so it's not going to do anything so we need to somehow pose the program we need
1:44:20 need to somehow pose the program we need
1:44:20 need to somehow pose the program we need to find a way to pose the execution of
1:44:22 to find a way to pose the execution of
1:44:22 to find a way to pose the execution of the program and for this we can do from
1:44:27 the program and for this we can do from
1:44:27 the program and for this we can do from signal so that's another Library you can
1:44:29 signal so that's another Library you can
1:44:29 signal so that's another Library you can use import pose you have the pose
1:44:32 use import pose you have the pose
1:44:32 use import pose you have the pose function from the signal library that we
1:44:35 function from the signal library that we
1:44:35 function from the signal library that we can just use at the end of our program
1:44:37 can just use at the end of our program
1:44:37 can just use at the end of our program here pose like that with parenthesis all
1:44:41 here pose like that with parenthesis all
1:44:41 here pose like that with parenthesis all right so what we do here is we
1:44:42 right so what we do here is we
1:44:42 right so what we do here is we initialize the led the button and then
1:44:44 initialize the led the button and then
1:44:44 initialize the led the button and then we say that when the button is pressed
1:44:45 we say that when the button is pressed
1:44:45 we say that when the button is pressed we're going to turn on the LED when the
1:44:47 we're going to turn on the LED when the
1:44:47 we're going to turn on the LED when the button is released we turn off the LED
1:44:49 button is released we turn off the LED
1:44:49 button is released we turn off the LED and then we pause the program and just
1:44:51 and then we pause the program and just
1:44:51 and then we pause the program and just to give you more details about about
1:44:53 to give you more details about about
1:44:53 to give you more details about about this well this is what we can call a
1:44:56 this well this is what we can call a
1:44:56 this well this is what we can call a call back function so to use a real life
1:45:00 call back function so to use a real life
1:45:00 call back function so to use a real life analogy let's say that you need some
1:45:02 analogy let's say that you need some
1:45:02 analogy let's say that you need some information from somebody and they will
1:45:05 information from somebody and they will
1:45:05 information from somebody and they will tell you okay I will call you back when
1:45:07 tell you okay I will call you back when
1:45:07 tell you okay I will call you back when I have this information so you give them
1:45:09 I have this information so you give them
1:45:09 I have this information so you give them your for example your phone number or
1:45:11 your for example your phone number or
1:45:11 your for example your phone number or your email all right so you kind of
1:45:13 your email all right so you kind of
1:45:13 your email all right so you kind of we're going to talk about registering
1:45:15 we're going to talk about registering
1:45:15 we're going to talk about registering your phone number so you register your
1:45:16 your phone number so you register your
1:45:17 your phone number so you register your phone number so that when they have this
1:45:19 phone number so that when they have this
1:45:19 phone number so that when they have this information they can call you back using
1:45:22 information they can call you back using
1:45:22 information they can call you back using this phone number okay so here there are
1:45:24 this phone number okay so here there are
1:45:24 this phone number okay so here there are two things one is that there's an event
1:45:27 two things one is that there's an event
1:45:27 two things one is that there's an event that must happen and that is external
1:45:30 that must happen and that is external
1:45:30 that must happen and that is external okay you don't really know when it's
1:45:31 okay you don't really know when it's
1:45:31 okay you don't really know when it's going to happen it might happen at some
1:45:33 going to happen it might happen at some
1:45:33 going to happen it might happen at some point and when this event is happening
1:45:36 point and when this event is happening
1:45:36 point and when this event is happening you want to be called back so you want
1:45:38 you want to be called back so you want
1:45:38 you want to be called back so you want to be notified of this and that's
1:45:40 to be notified of this and that's
1:45:40 to be notified of this and that's exactly what's Happening Here you see we
1:45:42 exactly what's Happening Here you see we
1:45:42 exactly what's Happening Here you see we have this dot when pressed so this is
1:45:46 have this dot when pressed so this is
1:45:46 have this dot when pressed so this is the external event when the button is
1:45:48 the external event when the button is
1:45:48 the external event when the button is pressed but you don't know when the
1:45:49 pressed but you don't know when the
1:45:49 pressed but you don't know when the button is going to be pressed from the
1:45:50 button is going to be pressed from the
1:45:50 button is going to be pressed from the program okay that's an external event
1:45:53 program okay that's an external event
1:45:53 program okay that's an external event and so you register a call back and the
1:45:55 and so you register a call back and the
1:45:55 and so you register a call back and the call back is led. on so when the button
1:45:58 call back is led. on so when the button
1:45:58 call back is led. on so when the button is pressed here is what to do what to
1:46:01 is pressed here is what to do what to
1:46:01 is pressed here is what to do what to call and we're going to call this
1:46:03 call and we're going to call this
1:46:03 call and we're going to call this function led. on and just note it's one
1:46:07 function led. on and just note it's one
1:46:07 function led. on and just note it's one particular thing about callbacks is that
1:46:10 particular thing about callbacks is that
1:46:10 particular thing about callbacks is that you don't provide the parenthesis
1:46:12 you don't provide the parenthesis
1:46:12 you don't provide the parenthesis because if you provide the parenthesis
1:46:14 because if you provide the parenthesis
1:46:14 because if you provide the parenthesis you are calling the function right now
1:46:16 you are calling the function right now
1:46:16 you are calling the function right now here you are registering the function so
1:46:18 here you are registering the function so
1:46:18 here you are registering the function so it can be called later so basically with
1:46:21 it can be called later so basically with
1:46:21 it can be called later so basically with this you just register those two
1:46:23 this you just register those two
1:46:23 this you just register those two functions that they can be called when
1:46:25 functions that they can be called when
1:46:26 functions that they can be called when this event or that event is happening
1:46:29 this event or that event is happening
1:46:29 this event or that event is happening and then you make sure you pose the
1:46:30 and then you make sure you pose the
1:46:30 and then you make sure you pose the program because if you don't P the
1:46:32 program because if you don't P the
1:46:32 program because if you don't P the program well it's just going to exit and
1:46:34 program well it's just going to exit and
1:46:34 program well it's just going to exit and nothing is going to happen and now you
1:46:36 nothing is going to happen and now you
1:46:36 nothing is going to happen and now you can try to run this and it's going to be
1:46:38 can try to run this and it's going to be
1:46:38 can try to run this and it's going to be the exact same behavior as what we had
1:46:40 the exact same behavior as what we had
1:46:40 the exact same behavior as what we had before all right and you can see the
1:46:42 before all right and you can see the
1:46:42 before all right and you can see the code is much smaller actually we don't
1:46:44 code is much smaller actually we don't
1:46:44 code is much smaller actually we don't even need the time Library anymore and
1:46:47 even need the time Library anymore and
1:46:47 even need the time Library anymore and if you look at if we go back to the task
1:46:49 if you look at if we go back to the task
1:46:49 if you look at if we go back to the task manager here you will see that uh so
1:46:52 manager here you will see that uh so
1:46:52 manager here you will see that uh so this is running and uh well this is not
1:46:55 this is running and uh well this is not
1:46:55 this is running and uh well this is not using much CPU as well okay so this code
1:46:58 using much CPU as well okay so this code
1:46:58 using much CPU as well okay so this code is already pretty much optimized we
1:47:00 is already pretty much optimized we
1:47:01 is already pretty much optimized we don't need to add any time dot slip
1:47:05 here hey and welcome back this is
1:47:07 here hey and welcome back this is
1:47:07 here hey and welcome back this is episode number 11 of this tutorial
1:47:10 episode number 11 of this tutorial
1:47:10 episode number 11 of this tutorial series on Raspberry Pi for complete
1:47:12 series on Raspberry Pi for complete
1:47:12 series on Raspberry Pi for complete beginners in this tutorial we are going
1:47:14 beginners in this tutorial we are going
1:47:14 beginners in this tutorial we are going to come back to the Circuit we have
1:47:15 to come back to the Circuit we have
1:47:15 to come back to the Circuit we have built in a previous episode of this
1:47:17 built in a previous episode of this
1:47:17 built in a previous episode of this series so far we have one LED and one
1:47:20 series so far we have one LED and one
1:47:20 series so far we have one LED and one push button connected to the Raspberry
1:47:22 push button connected to the Raspberry
1:47:22 push button connected to the Raspberry Pi we are going to add two more LEDs so
1:47:25 Pi we are going to add two more LEDs so
1:47:25 Pi we are going to add two more LEDs so that we can then create more complex and
1:47:27 that we can then create more complex and
1:47:27 that we can then create more complex and fun applications so here I'm back to the
1:47:29 fun applications so here I'm back to the
1:47:29 fun applications so here I'm back to the software and I have so I have a green
1:47:31 software and I have so I have a green
1:47:31 software and I have so I have a green LED and a blue LED uh it doesn't really