( ! ) Deprecated: Function create_function() is deprecated in /srv/http/blogs.mypals.org/pi/bl-kernel/helpers/text.class.php on line 209
Call Stack
#TimeMemoryFunctionLocation
10.0022405400{main}( ).../index.php:0
20.18921404776require( '/srv/http/blogs.mypals.org/pi/bl-kernel/boot/site.php' ).../index.php:39
30.32221636800include( '/srv/http/blogs.mypals.org/pi/bl-kernel/boot/rules/70.posts.php' ).../site.php:10
40.33181638376buildPostsForPage( $pageNumber = 0, $amount = '5', $removeUnpublished = TRUE, $tagKey = ??? ).../70.posts.php:65
50.33181638800buildPost( $key = 'raspberry-pi-gpio-programming-part-2' ).../functions.php:103
60.34891652080Text::pre2htmlentities( $string = 'The code for this project may be found in [Github](https://github.com/alfmel/rpi_leds/tree/part2). To check out the code, run the following commands:\n\r\n```\r\ngit clone https://github.com/alfmel/rpi_leds.git\r\ncd rpi_leds\r\ngit checkout part2\r\n```\r\n\r\nIn [Part 1](https://blogs.mypals.org/pi/post/Raspberry-Pi-GPIO-Programming-Part-1) I learned how to turn an LED on and off. Not something really exciting. For this next part I want to hook up several LEDs and turn them on and off in a sequence, and if possible, more than one sequence. Because I\'ll be working with object-oriented code and trying to explain its merits, this will be a long post.\r\n\r\nTaking what I learned in Part 1, it wouldn\'t be very difficult to turn on multiple LEDs. I would need a way to define the sequence (like an array) and a loop to iterate over the sequence. Since it would be easy to define LEDs that need to be turned on during the sequence, it would also be nice to know which pins are associated with LEDs.\r\n\r\nSince the turning of LEDs on and off requires timers, I will create a class that will handle the timer and sequence loop. That\'s right, I will be writing *Object-Oriented Python Code* (no need to be scared). In order to run asynchronously (that is, I can start the sequence in one part of the program, go do something else, and turn it off later) the class will also have to handle the creation of its own thread.\r\n\r\nDon\'t worry, writing object-oriented, multi-threaded Python code may sound intimidating at first, but it\'s not too bad. Also, the class is completely reusable. That means you can use the class and not have to worry about threading. That\'s why we write classes: to create modular pieces of code we can reuse while reducing unintended side-effects.\r\n\r\n## Wiring\r\nThe [Explorer pHAT Kit](https://shop.pimoroni.com/products/pi-zero-project-kits) came with several LEDs of several colors. I decided to grab an LED of each color and hook them up to the Pi Zero. There are four different colors, so I\'ll need ...' ).../functions.php:54

( ! ) Deprecated: Function create_function() is deprecated in /srv/http/blogs.mypals.org/pi/bl-kernel/helpers/text.class.php on line 209
Call Stack
#TimeMemoryFunctionLocation
10.0022405400{main}( ).../index.php:0
20.18921404776require( '/srv/http/blogs.mypals.org/pi/bl-kernel/boot/site.php' ).../index.php:39
30.32221636800include( '/srv/http/blogs.mypals.org/pi/bl-kernel/boot/rules/70.posts.php' ).../site.php:10
40.33181638376buildPostsForPage( $pageNumber = 0, $amount = '5', $removeUnpublished = TRUE, $tagKey = ??? ).../70.posts.php:65
50.43241679912buildPost( $key = 'improving-x-performance' ).../functions.php:103
60.43821682648Text::pre2htmlentities( $string = 'I was reading the [Arch Linux Raspberry Pi](https://wiki.archlinux.org/index.php/Raspberry_Pi) page today and found a section about the [X.org driver]((https://wiki.archlinux.org/index.php/Raspberry_Pi#X.org_driver). It states:\n\r\n> The X.org driver for Raspberry Pi can be installed with the xf86-video-fbdev or xf86-video-fbturbo-git package.\r\n\r\nSo I decided to remove the `xf86-video-fbdev` package and installed the `xf86-video-fbturbo-git` package instead. I then hooked up my Raspberry Pi Zero to a monitor to test the performance of the [fbturbo driver](https://github.com/ssvb/xf86-video-fbturbo). Sure enough, the driver delivers improved performance. Moving windows is still a choppy operation, but the window you are moving now stays in sync with the mouse. Previously you would move a window and its movement was so delayed you never knew where it was going to be placed. At this point I can declare LXDE on Arch Linux as usable.\r\n\r\n## Fixing Screen Resolution Problem\r\nSince Arch Linux is built for several ARM architectures, there is a [known issue](https://archlinuxarm.org/forum/viewtopic.php?t=2878) about the initial screen resolution. I connect my Raspberry Pi Zero to a 1920x1080 monitor with an HDMI input. Unfortunately, the screen resolution, both in text and X modes, was only 1824 x 984 and did not fill the whole screen. The reason is the default overscan setting which ensures the image will fit in a TV if necessary. As stated in the forum post, adding the following line to `/boot/config.txt` solved the problem:\r\n\r\n```\r\ndisable_overscan=1\r\n```\r\n\r\nA reboot later and the screen resolution is now 1920x1080 and fills the whole screen. (Yes, that\'s all you have to do: edit the file as root and reboot.)' ).../functions.php:54

( ! ) Deprecated: Function create_function() is deprecated in /srv/http/blogs.mypals.org/pi/bl-kernel/helpers/text.class.php on line 209
Call Stack
#TimeMemoryFunctionLocation
10.0022405400{main}( ).../index.php:0
20.18921404776require( '/srv/http/blogs.mypals.org/pi/bl-kernel/boot/site.php' ).../index.php:39
30.32221636800include( '/srv/http/blogs.mypals.org/pi/bl-kernel/boot/rules/70.posts.php' ).../site.php:10
40.33181638376buildPostsForPage( $pageNumber = 0, $amount = '5', $removeUnpublished = TRUE, $tagKey = ??? ).../70.posts.php:65
50.44031687256buildPost( $key = 'Raspberry-Pi-GPIO-Programming-Part-1' ).../functions.php:103
60.44091691272Text::pre2htmlentities( $string = 'The code for this project may be found on [Github](https://github.com/alfmel/rpi_leds/tree/part1). To check out the code, run the following commands:\n\r\n```\r\ngit clone https://github.com/alfmel/rpi_leds.git\r\ncd rpi_leds\r\ngit checkout part1\r\n```\r\n\r\n**Disclaimer: I am teaching myself how to program the Raspberry Pi, often following the examples of others. I am not an expert beyond what I put here.**\r\n\r\nLet\'s begin the GPIO journey by turning on an LED. The code for this project won\'t be too different from what I did [back when I installed the GPIO library](https://blogs.mypals.org/pi/admin/edit-post/Installing-Python-RPi-Libraries-in-Arch-Linux). Here I will focus on writing a clean and simple and script.\r\n\r\nI called my script turn_on_led.py. You can find the latest version on [Github](https://github.com/alfmel/rpi_leds/blob/part1/turn_on_led.py).\r\n\r\n```python\r\n#!/usr/bin/env python\r\n\r\nimport RPi.GPIO as GPIO\r\nimport time\r\n\r\n# Use Raspberry Pi pin labels\r\nGPIO.setmode(GPIO.BCM)\r\n\r\n# OR use Raspberry Pi board pin numbers\r\n# GPIO.setmode(GPIO.BOARD)\r\n\r\n# Choose the pin number you want to use\r\npinNumber = 21\r\n\r\ntry:\r\n # Set up GPIO pin as outout\r\n GPIO.setup(pinNumber, GPIO.OUT)\r\n\r\n # Turn on the LED\r\n print("Turning on LED...")\r\n GPIO.output(pinNumber, GPIO.HIGH)\r\n\r\n # Sleep for 10 seconds\r\n time.sleep(10)\r\n\r\n # Turn off LED\r\n print("Turning off LED...")\r\n GPIO.output(pinNumber, GPIO.LOW)\r\nexcept KeyboardInterrupt:\r\n print("Keyboard interrupt... exiting.")\r\n\r\nGPIO.cleanup()\r\n```\r\n\r\nThe script is fairly simple: initialize GPIO, assign the pin number I plan to use (in this case, GPIO pin 21), set the pin for output, set the output high (remember, this 3.3V), wait 10 seconds, and then set it low again. Finally, we clean up GPIO. If we don\'t clean up all previous settings stay in place which may mean we leave the LED on.\r\n\r\nOn the hardware side, we need to wire up an LED. I chose GPIO pi...' ).../functions.php:54

( ! ) Deprecated: Function create_function() is deprecated in /srv/http/blogs.mypals.org/pi/bl-kernel/helpers/text.class.php on line 209
Call Stack
#TimeMemoryFunctionLocation
10.0022405400{main}( ).../index.php:0
20.18921404776require( '/srv/http/blogs.mypals.org/pi/bl-kernel/boot/site.php' ).../index.php:39
30.32221636800include( '/srv/http/blogs.mypals.org/pi/bl-kernel/boot/rules/70.posts.php' ).../site.php:10
40.33181638376buildPostsForPage( $pageNumber = 0, $amount = '5', $removeUnpublished = TRUE, $tagKey = ??? ).../70.posts.php:65
50.44381701864buildPost( $key = 'Soldering-the-GPIO-Pin-Headers-on-the-Raspberry-Pi-Zero' ).../functions.php:103
60.44441704600Text::pre2htmlentities( $string = 'One of the features of the Raspberry Pi Zero is that the GPIO port is empty. This helps keep the price down and provides a bit more versatility. Luckily my [Pimoroni Project Kit](https://shop.pimoroni.com/products/pi-zero-project-kits) came with the pin header strip I could solder on.\n\r\nSince I don\'t play with electronics all that much I don\'t have fancy equipment. So the first difficulty in soldering the pins was making sure everything was lined up properly. That meant sticking a static foam pad I had under the raspberry pi so that the pins would end up straight. Once I had everything positioned just right, I soldered two pins at opposite ends to hold everything in place. After that, it didn\'t matter if the board moved.\r\n\r\nSoldering took a bit of time, but it all went well. I performed a visual inspection of the joints with a magnifying class (my eyesight is not what it used to be) and used my multimeter to make sure none of the pins where short-circuiting. (A short circuit could easily fry the board, or so the Internet says).\r\n\r\n![Image description](0608162044.jpg)\r\n![Image description](0608162045.jpg)\r\nI now had one problem: all the cables that came with the [Pimoroni Project Kit](https://shop.pimoroni.com/products/pi-zero-project-kits) were maie-to-male. If I wanted to just hook up something from the breadboard to a pin, I would need a female-to-male cable. After some googling and eBaying, I found a [set of 20 cables](http://www.ebay.com/itm/262467432939) for only $2.00 with shipping!\r\n\r\n![Image description](0608162046.jpg)\r\nNow I am ready to start playing.\r\n' ).../functions.php:54

( ! ) Deprecated: Function create_function() is deprecated in /srv/http/blogs.mypals.org/pi/bl-kernel/helpers/text.class.php on line 209
Call Stack
#TimeMemoryFunctionLocation
10.0022405400{main}( ).../index.php:0
20.18921404776require( '/srv/http/blogs.mypals.org/pi/bl-kernel/boot/site.php' ).../index.php:39
30.32221636800include( '/srv/http/blogs.mypals.org/pi/bl-kernel/boot/rules/70.posts.php' ).../site.php:10
40.33181638376buildPostsForPage( $pageNumber = 0, $amount = '5', $removeUnpublished = TRUE, $tagKey = ??? ).../70.posts.php:65
50.44601709720buildPost( $key = 'Software-Updates-on-an-SD-Card' ).../functions.php:103
60.45371711432Text::pre2htmlentities( $string = 'Overall the Raspberry Pi Zero does not feel slow when using the command line. Sometimes you see a bit of delays but overall it is pretty responsive.\n\r\nOne notable exception is updating the system (or installing a large number of new packages). Even though downloading is as good as any other [Arch Linux](https://www.archlinux.org/) system I own, the installation of the packages tends to stall quite a bit (especially when updating the man page index). That is mostly due to the SD card since they don\'t offer the best I/O. I have the same problem whenever I install Linux on a flash drive. Updating is incredibly slow due to the limited I/O of these cheap flash devices.' ).../functions.php:54

( ! ) Deprecated: Function create_function() is deprecated in /srv/http/blogs.mypals.org/pi/bl-kernel/helpers/text.class.php on line 209
Call Stack
#TimeMemoryFunctionLocation
10.0022405400{main}( ).../index.php:0
20.18921404776require( '/srv/http/blogs.mypals.org/pi/bl-kernel/boot/site.php' ).../index.php:39
30.45451714784include( '/srv/http/blogs.mypals.org/pi/bl-kernel/boot/rules/71.pages.php' ).../site.php:11
40.45451714784buildAllPages( ).../71.pages.php:68
50.45451715280buildPage( $key = 'about' ).../functions.php:201
60.45521716864Text::pre2htmlentities( $string = 'I am a software engineer. During my college years I played around with electronics and control systems. By the time I graduated, the Internet became a thing and I found a career as a backend developer for web appliactions.\n\r\nWith the advent of the Raspberry Pi and similar hardware, it is now easier than ever to bridge the gap between software and all sorts of hardware. Join me in my discovery of this new world as I play around with the Raspberry Pi, Odroid and other small computing platforms.' ).../functions.php:156

( ! ) Deprecated: Function create_function() is deprecated in /srv/http/blogs.mypals.org/pi/bl-kernel/helpers/text.class.php on line 209
Call Stack
#TimeMemoryFunctionLocation
10.0022405400{main}( ).../index.php:0
20.18921404776require( '/srv/http/blogs.mypals.org/pi/bl-kernel/boot/site.php' ).../index.php:39
30.45451714784include( '/srv/http/blogs.mypals.org/pi/bl-kernel/boot/rules/71.pages.php' ).../site.php:11
40.45451714784buildAllPages( ).../71.pages.php:68
50.45561723072buildPage( $key = 'Welcome-to-my-Raspberry-Pi-Blog' ).../functions.php:201
60.45641724656Text::pre2htmlentities( $string = 'I have started playing with a Raspberry Pi Zero yesterday. And since so many people have blogged about their adventures with the Raspberry Pi I figured I would do the same. I hope I provide a slightly different content, however for several reasons:\n\r\n* I am a software engineer, so I will favor writing reusable modules rather than simple scripts.\r\n* I use [Arch Linux](https://www.archlinux.org/), so I\'ll be trying to use it as much as possible.\r\n* I hope to write in a way that new and experience users alike will find useful.\r\n\r\nSo join me in my adventures with the Raspberry Pi!' ).../functions.php:156
Al's Adventures with Pi

I am a software engineer who wants to bridge the gap between the virtual and the physical via the Raspberry Pi and other small computing platforms.

Raspberry Pi GPIO Programming Part 2: LED Sequences


The code for this project may be found in Github. To check out the code, run the following commands:

git clone https://github.com/alfmel/rpi_leds.git
cd rpi_leds
git checkout part2

In Part 1 I learned how to turn an LED on and off. Not something really exciting. For this next part I want to hook up several LEDs and turn them on and off in a sequence, and if possible, more than one sequence. Because I'll be working with object-oriented code and trying to explain its merits, this will be a long post.

Taking what I learned in Part 1, it wouldn't be very difficult to turn on multiple LEDs. I would need a way to define the sequence (like an array) and a loop to iterate over the sequence. Since it would be easy to define LEDs that need to be turned on during the sequence, it would also be nice to know which pins are associated with LEDs.

Since the turning of LEDs on and off requires timers, I will create a class that will handle the timer and sequence loop. That's right, I will be writing Object-Oriented Python Code (no need to be scared). In order to run asynchronously (that is, I can start the sequence in one part of the program, go do something else, and turn it off later) the class will also have to handle the creation of its own thread.

Don't worry, writing object-oriented, multi-threaded Python code may sound intimidating at first, but it's not too bad. Also, the class is completely reusable. That means you can use the class and not have to worry about threading. That's why we write classes: to create modular pieces of code we can reuse while reducing unintended side-effects.

Wiring

The Explorer pHAT Kit came with several LEDs of several colors. I decided to grab an LED of each color and hook them up to the Pi Zero. There are four different colors, so I'll need four GPIO pins and a ground pin. Looking at the pin layout, physical pins 32, 34, 36, 38 and 40 are the perfect candidates. All of them are GPIO pins (with the exception of pin 34 which is ground) and they are all right next to each other. And with the multi-color wires, I can color coordinate!

Image description

Code

Now, let me explain the code. Let me start by showing you led_sequences.py. This is the executable part of one of the scripts I've written to run the LED sequences. This script creates several sequences, and runs them one by one. You can move from one sequence to another by hitting Enter

Defining the LEDs in Use

Lines 12-15 define the pins I'll be using. Notice that I am defining variables with the pin numbers. The variable names are simply the colors of the LEDs. If I were defining more than one red LED, I would have to name my variables red1, red2, etc. I could also call my variables led1, led2, etc. but then I would have to think which one is which. By naming the variables the color of the LED, it will be really easy to write a sequence.

Defining the Sequence Time Delay

In line 9 I define a variable that has the delay between parts of the sequence. The delay is specified in seconds. Here the delay is set to 0.25, meaning 250ms or 1/4 of a second.

Defining a sequence

Before I define a sequence I need to create an array that will define the LEDs that will belong to a sequence. In this case, I add all my LEDs (line 32).

Defining the sequence requires a simple list of LED pin numbers that should be turned on at a given time. For example defining [red, blue, red] will turn on red, blue, then red again. The sequence would then repeat. The list can accept either a single pin, a list of pins to turn on several LEDs on at once, or an empty list to signify that no LEDs should be on. On led_sequences.py lines 18-26 I define several sequences, each with a name. (I used the OrderedDict class to ensure the order of the sequences stayed in the order I defined them).

How the Sequence Class Works

Before I describe the class, I want to remind you, the reader, why we use classes in programming. Classes are programming structures that contain both functionality and state. They are self-contained. For the Sequence class, the state consists of:

  • A reference to the GPIO module. (Requiring dependent modules in this way is called Dependency Injection. It allows us to replace the implementation of GPIO at runtime, which means the code can be more easily tested.)
  • The sequence time delay
  • The LEDs in use
  • The LED sequence

Internally the class also keeps track of the thread that will turn the LEDs on and off. But because it is internal (private in Object-Oriented Programming talk), the consumer of the class doesn't have to worry about it. The class hides (encapsulates) this complexity. In other words, you, as the consumer of the class, don't have to worry about how the class works. You just worry about being able to talk to it.

Now let's look at the Sequence class. The class has the following public methods (what you use to communicate with the class):

  • set_delay(delay) Set the duration of each element of the sequence in seconds
  • set_pins(pins) Set the pins that will be used during the sequence, passing the pin numbers as an array
  • set_sequence(sequence) Set the LED sequence
  • start() Once everything is in place, this will start the sequence
  • stop() Stops the running sequence

Testing the pi.sequence Class

The constructor (the method or function called when the class is instantiated into an object) requires the GPIO reference I discussed earlier. This allows us to pass a test double or a mock library that can help us with testing. Test doubles have the same functions and methods that the real class has, but they work differently. One advantage of using mock functions is that we can validate (or assert) they were called properly.

In lines 8-13 of test_sequence.py I define a mock GPIO class that I will pass during testing. Then, in the individual tests, I assert that the methods are called with the proper values, in this case, making sure the right LED pins are turned on and off (see lines 35-46.

To run the tests, simply execute the following command from the command line in the project's parent directory:

python -m unittest discover

Putting It All Together

Now that I've explained how the code works, it's time to make it all work.

  1. On line 30 of led_sequences.py I instantiate the class (into an object), passing the real GPIO module.
  2. On line 31 I set the delay I defined in line 9.
  3. On line 32 I set the LED pins I'll be using
  4. On line 36 I iterate (loop) through the sequences I defined in lines 18-25.
  5. On line 37 I set the current sequence
  6. On line 38 I start the sequence
  7. On line 39 I display the name of the current sequence and wait for the user to hit Enter.
  8. When the user hits Enter line 40 executes and the sequence stops. If there are still more sequences in the loop, I move on to the next one and run the next sequence. If there are no more sequences, the program exits.

The result can be seen below. (The sequence appears choppy because of the frame rate reduction of the animated GIF.)

led_sequences.py

Running More Than One Sequence

Because I used a class to run the sequence, I should be able to run multiple sequences at once simply by creating separate instances (or copies) of the class. (Each instance of a class is called an object, by the way, and each instance will have its own state, without conflicting with any other instances). led_double_sequences.py does exactly that. On lines 8 and 9 I define two different delays. On line 18 I create one sequence with two of the LEDs, and on line 19 I define a second sequence with the other two LEDs. On lines 24-27 I set up one instance of the Sequence class (sequence_a) and in lines 29-32 I set up the second instance with different values (sequence_b). Then on lines 36-37 I start both sequences. Because each instance of the Sequence class creates its own thread, they can run at the same time. (Again, the rate reduction in the animated GIF doesn't quite show it perfectly.)

led_sequences.py

Conclusion

And there you have it! Thanks to Object-Oriented Programming principles, it is now easy for me to create a light sequence with different LEDs hooked up to different GPIO pins and have them run independently of what my program might be doing.

Improving X Performance


I was reading the Arch Linux Raspberry Pi page today and found a section about the [X.org driver]((https://wiki.archlinux.org/index.php/Raspberry_Pi#X.org_driver). It states:

The X.org driver for Raspberry Pi can be installed with the xf86-video-fbdev or xf86-video-fbturbo-git package.

So I decided to remove the xf86-video-fbdev package and installed the xf86-video-fbturbo-git package instead. I then hooked up my Raspberry Pi Zero to a monitor to test the performance of the fbturbo driver. Sure enough, the driver delivers improved performance. Moving windows is still a choppy operation, but the window you are moving now stays in sync with the mouse. Previously you would move a window and its movement was so delayed you never knew where it was going to be placed. At this point I can declare LXDE on Arch Linux as usable.

Fixing Screen Resolution Problem

Since Arch Linux is built for several ARM architectures, there is a known issue about the initial screen resolution. I connect my Raspberry Pi Zero to a 1920x1080 monitor with an HDMI input. Unfortunately, the screen resolution, both in text and X modes, was only 1824 x 984 and did not fill the whole screen. The reason is the default overscan setting which ensures the image will fit in a TV if necessary. As stated in the forum post, adding the following line to /boot/config.txt solved the problem:

disable_overscan=1

A reboot later and the screen resolution is now 1920x1080 and fills the whole screen. (Yes, that's all you have to do: edit the file as root and reboot.)

Raspberry Pi GPIO Programming Part 1: Turning on an LED


The code for this project may be found on Github. To check out the code, run the following commands:

git clone https://github.com/alfmel/rpi_leds.git
cd rpi_leds
git checkout part1

Disclaimer: I am teaching myself how to program the Raspberry Pi, often following the examples of others. I am not an expert beyond what I put here.

Let's begin the GPIO journey by turning on an LED. The code for this project won't be too different from what I did back when I installed the GPIO library. Here I will focus on writing a clean and simple and script.

I called my script turn_on_led.py. You can find the latest version on Github.

#!/usr/bin/env python

import RPi.GPIO as GPIO
import time

# Use Raspberry Pi pin labels
GPIO.setmode(GPIO.BCM)

# OR use Raspberry Pi board pin numbers
# GPIO.setmode(GPIO.BOARD)

# Choose the pin number you want to use
pinNumber = 21

try:
    # Set up GPIO pin as outout
    GPIO.setup(pinNumber, GPIO.OUT)

    # Turn on the LED
    print("Turning on LED...")
    GPIO.output(pinNumber, GPIO.HIGH)

    # Sleep for 10 seconds
    time.sleep(10)

    # Turn off LED
    print("Turning off LED...")
    GPIO.output(pinNumber, GPIO.LOW)
except KeyboardInterrupt:
    print("Keyboard interrupt... exiting.")

GPIO.cleanup()

The script is fairly simple: initialize GPIO, assign the pin number I plan to use (in this case, GPIO pin 21), set the pin for output, set the output high (remember, this 3.3V), wait 10 seconds, and then set it low again. Finally, we clean up GPIO. If we don't clean up all previous settings stay in place which may mean we leave the LED on.

On the hardware side, we need to wire up an LED. I chose GPIO pin 21 (physical pin 40) because there is a ground pin at physical pin 39. They are also at the very bottom so they are easy to locate. At first I ran a resitor through the circuit, but the LED wasn't very bright. So I just wired it up directly. The LED is bright and my Pi Zero did not fry.

Wiring is pretty simple with the help of the breadboard included in the kit and the male-to-female cables:

Image description Running the script (sudo ./turn_on_led.py or sudo python turn_on_led.py) turns on the LED, as we would expect:

Image description There you have it! A simple script for turning on an LED on a Rasbperry Pi via a GPIO pin.

Soldering the GPIO Pin Headers on the Raspberry Pi Zero


One of the features of the Raspberry Pi Zero is that the GPIO port is empty. This helps keep the price down and provides a bit more versatility. Luckily my Pimoroni Project Kit came with the pin header strip I could solder on.

Since I don't play with electronics all that much I don't have fancy equipment. So the first difficulty in soldering the pins was making sure everything was lined up properly. That meant sticking a static foam pad I had under the raspberry pi so that the pins would end up straight. Once I had everything positioned just right, I soldered two pins at opposite ends to hold everything in place. After that, it didn't matter if the board moved.

Soldering took a bit of time, but it all went well. I performed a visual inspection of the joints with a magnifying class (my eyesight is not what it used to be) and used my multimeter to make sure none of the pins where short-circuiting. (A short circuit could easily fry the board, or so the Internet says).

Image description Image description I now had one problem: all the cables that came with the Pimoroni Project Kit were maie-to-male. If I wanted to just hook up something from the breadboard to a pin, I would need a female-to-male cable. After some googling and eBaying, I found a set of 20 cables for only $2.00 with shipping!

Image description Now I am ready to start playing.

Tags

Software Updates on an SD Card


Overall the Raspberry Pi Zero does not feel slow when using the command line. Sometimes you see a bit of delays but overall it is pretty responsive.

One notable exception is updating the system (or installing a large number of new packages). Even though downloading is as good as any other Arch Linux system I own, the installation of the packages tends to stall quite a bit (especially when updating the man page index). That is mostly due to the SD card since they don't offer the best I/O. I have the same problem whenever I install Linux on a flash drive. Updating is incredibly slow due to the limited I/O of these cheap flash devices.

Tags Arch Linux