Interfacing an LED

Refer to Figure 6.18 for connection details:

Figure 6.18

As shown in Figure 6.18:

  • The positive terminal (the longer leg) of LED is connected to GPIO 17 (pin 11) of Raspberry Pi
  • The negative terminal (the shorter leg) of LED is connected to GND (pin 09) of Raspberry Pi

Since we have already installed the camera module in Raspberry Pi, let's enable it in Raspberry Pi configurations before we write the code.

If you have connected your pi with the monitor using HDMI or VGA, then you can log into it and go to Menu | Preference | Raspberry Pi Configuration, as shown in Figure 6.19:

Figure 6.19

Under Raspberry Pi Configuration, go to the Interfaces tab and enable the Camera, as shown in Figure 6.20:

Figure 6.20

If you do not have a separate monitor to connect to Raspberry Pi, with the help of headless setup (refer to Chapter 2, Know Your Raspberry Pi, for details about headless setup), you can then connect to Raspberry Pi using PuTTy, as shown in Figure 6.21:

Figure 6.21

Once logged in using the username and password, run the raspi-config in Terminalwhich will open up the configuration window as shown in Figure 6.22. Select the Enable Camera option and then click on Finish. This will enable the camera and now we are good to go and write our code:

Figure 6.22
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.1.239