官术网_书友最值得收藏!

Electrical output of our program

In the previous section, we wrote a program to make an LED blink. Let's look at the electrical connection to observe the output of our program. We will connect a resistor between the GPIO pin and the anode of the LED. We will connect the cathode to the ground pin of the Raspberry Pi.

Engage thrusters

We will connect the LED and the resistor to the GPIO pin and the ground pin, as shown in this image:

Engage thrusters

LED blinking circuit

Note

If we are not careful with the handling of the Raspberry Pi GPIO pins, it may either temporarily reset the Raspberry Pi or sometimes even permanently damage the GPIO pin. There are several tutorials in basic electronics available over the Web. It is important that you familiarize yourself with the basics of electronics.

Once we connect the circuit as shown in the preceding image, we will be able to execute the program and conclude our experiment.

We can execute the program by running the module, as shown in the following screenshot:

Engage thrusters

Executing the Python example

Objective complete – mini debriefing

That's it! We have wet our feet by saying Hello World by blinking an LED! On our way to bigger and better things, let's stop and examine the Pi Crust for a moment.

Introduction to the Pi Crust – a prototyping platform for the Raspberry Pi

Now that our Hello World example is done, we will leave you with one more thing. Throughout this book, we will review some add-on hardware to access the GPIO peripherals on the Raspberry Pi. In this project, we will discuss the Pi Crust board for the Raspberry Pi.

The Pi Crust board was designed by Joe Walnes. It is a board that is stackable on the Raspberry Pi and eliminates the need for a breadboard to prototype circuits.

Introduction to the Pi Crust – a prototyping platform for the Raspberry Pi

A Pi Crust board

The Pi Crust is an open source add-on hardware and costs approximately $14 to build one ourselves. The design can be downloaded free of cost from http://picru.st.

So, it is up to you to decide whether you want to simply buy one, build one, or as we are prone to encourage, improve upon it and open source it for others to benefit!

The main advantage behind Pi Crust is that it is aids prototyping. It allows easy access to the I2C interface, SPI interface, UART port, and the GPIO pins. The following figure shows BlinkM—an I2C-driven RGB LED mounted on top of the Pi Crust.

Introduction to the Pi Crust – a prototyping platform for the Raspberry Pi

Pi Crust stacked on top of the Raspberry Pi

主站蜘蛛池模板: 洪泽县| 抚顺县| 新民市| 海淀区| 东至县| 杭锦旗| 香港| 洪湖市| 伊吾县| 新安县| 田林县| 习水县| 南城县| 南陵县| 娄烦县| 谷城县| 建德市| 肇东市| 怀安县| 云霄县| 台南市| 肥东县| 绥滨县| 收藏| 遵化市| 永兴县| 枝江市| 得荣县| 丰都县| 平和县| 安吉县| 海晏县| 齐河县| 九龙坡区| 海南省| 宁海县| 唐海县| 常州市| 丰台区| 义乌市| 阿克陶县|