<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Raspberry-Pi on Lloyd Rochester's Geek Blog</title><link>https://lloydroc.github.io/tags/raspberry-pi/</link><description>Recent content in Raspberry-Pi on Lloyd Rochester's Geek Blog</description><generator>Hugo</generator><language>en</language><copyright>Copyright © 2025, Lloyd Rochester.</copyright><lastBuildDate>Mon, 10 May 2021 00:00:00 +0000</lastBuildDate><atom:link href="https://lloydroc.github.io/tags/raspberry-pi/index.xml" rel="self" type="application/rss+xml"/><item><title>GPIO Input with libgpiod</title><link>https://lloydroc.github.io/post/hardware/libgpiod-input-rpi/</link><pubDate>Mon, 10 May 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/libgpiod-input-rpi/</guid><description>&lt;h1 id="hahahugoshortcode63s0hbhb">GPIO Input with libgpiod&lt;/h1>
&lt;p>We can use the &lt;code>libgpiod&lt;/code> library to configure a GPIO line as input and read it&amp;rsquo;s value. We&amp;rsquo;ll create a switch circuit so we can test the value is a logic high or low. More info on &lt;code>libgpiod&lt;/code> can be found in my &lt;a href="https://lloydroc.github.io/post/hardware/libgpiod-intro-rpi/">libgpiod intro&lt;/a> for installation and usage.&lt;/p>
&lt;p>Here is a previous post to &lt;a href="https://lloydroc.github.io/post/hardware/libgpiod-blink-led-rpi/">blink an LED&lt;/a> using libgpiod.&lt;/p>
&lt;h1 id="input-circuit">Input Circuit&lt;/h1>
&lt;p>Into our Raspberry Pi we&amp;rsquo;ll use GPIO 4 and configure this pin as an input. We&amp;rsquo;re going to add some resistors to control the current into this circuit. When the switch is in one direction you can see current will essentially not flow.&lt;/p></description></item><item><title>Blinking an LED with libgpiod</title><link>https://lloydroc.github.io/post/hardware/libgpiod-blink-led-rpi/</link><pubDate>Mon, 03 May 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/libgpiod-blink-led-rpi/</guid><description>&lt;h1 id="hahahugoshortcode60s0hbhb">Blinking an LED with libgpiod&lt;/h1>
&lt;p>In the previous post we &lt;a href="https://lloydroc.github.io/post/hardware/libgpiod-intro-rpi/">introduced&lt;/a> &lt;code>libgpiod&lt;/code>. In this post we&amp;rsquo;ll use the command line tools to blink an LED. Finally, we&amp;rsquo;ll write some C code to blink the LED using the &lt;code>libgpiod&lt;/code> library.&lt;/p>
&lt;h1 id="table-of-contents">Table of Contents&lt;/h1>
&lt;nav id="TableOfContents">
 &lt;ul>
 &lt;li>&lt;a href="#led-driver-circuit">LED Driver Circuit&lt;/a>&lt;/li>
 &lt;/ul>

 &lt;ul>
 &lt;li>&lt;a href="#building-and-running">Building and Running&lt;/a>&lt;/li>
 &lt;/ul>
&lt;/nav>
&lt;h2 id="led-driver-circuit">LED Driver Circuit&lt;/h2>
&lt;p>Skip this section if you already have a good circuit to drive an LED. A simple NPN Transistor is a cheap and robust LED drive that only requires two resistors.&lt;/p></description></item><item><title>Raspberry Pi SPI Explained</title><link>https://lloydroc.github.io/post/hardware/raspberry-pi-spi/</link><pubDate>Wed, 21 Apr 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/raspberry-pi-spi/</guid><description>&lt;h1 id="hahahugoshortcode67s0hbhb">Raspberry Pi SPI Explained&lt;/h1>
&lt;p>This post attempts to provide some finer details when using SPI on Raspberry Pi as it pertains to using the Chip Select pins and multiple SPI Interfaces. Note, I will not use &lt;code>MOSI&lt;/code> and &lt;code>MISO&lt;/code> to ditch the old master/slave nomenclature and use &lt;code>SPO&lt;/code> and &lt;code>SPI&lt;/code> instead.&lt;/p>
&lt;p>Here is a quick diagram which will be explained in the following sections.&lt;/p>
&lt;p>&lt;img src="https://lloydroc.github.io/assets/svg/rpi-spi.svg" alt="Raspberry Pi SPI">&lt;/p>
&lt;h1 id="the-basics-of-spi-on-the-raspberry-pi">The Basics of SPI on the Raspberry Pi&lt;/h1>
&lt;p>If you use &lt;code>raspi-config&lt;/code> you can enable SPI.&lt;/p></description></item><item><title>Audio Clip Capture by Threshold</title><link>https://lloydroc.github.io/post/hardware/audio-clip/</link><pubDate>Sat, 10 Apr 2021 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/audio-clip/</guid><description>&lt;h1 id="hahahugoshortcode55s0hbhb">Audio Clip Capture by Threshold&lt;/h1>
&lt;p>Updated December 28th 2022&lt;/p>
&lt;p>&lt;img src="https://lloydroc.github.io/assets/png/audio-threshold-recording.png" alt="Raspberry Pi E32 Lora Receive">&lt;/p>
&lt;p>Here is a command line tool to capture audio clips based on two thresholds. Keep the tool running and it will write a number of audio files with audio that is loud enough for long enough. How loud and how long are the thresholds that are inputs to the program. For example we may want to record audio clips that only exceed 3 seconds. The loudness level is meant to keep us from recording noise.&lt;/p></description></item><item><title>LSM9DS1 Command Line Tool for Raspberry Pi</title><link>https://lloydroc.github.io/post/hardware/lsm9ds1-rpi/</link><pubDate>Wed, 03 Jun 2020 00:00:00 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/lsm9ds1-rpi/</guid><description>&lt;h1 id="hahahugoshortcode66s0hbhb">LSM9DS1 Command Line Tool for Raspberry Pi&lt;/h1>
&lt;p>I recently created a &lt;a href="https://github.com/lloydroc/rpi_lsm9ds1">LSM9DS1 Command Line Tool&lt;/a> for the Raspberry Pi. This tool was used to capture Accelerometer and Gyroscope data. I did an experiment to see what the readings look like, how the sensor behaves and the noise levels. This experiment is far from perfect but gives good insight and understanding.&lt;/p>
&lt;h1 id="sensor-setup">Sensor Setup&lt;/h1>
&lt;p>The LSM9DS1 was taped to the tread of a \( 16&amp;quot; \)stroller tire. The location was directly on top of the tread so the wheel had to be spun up in the air. The wheel was parallel to the ground as the stroller was on it&amp;rsquo;s side. The axis of the Accelerometer had Z facing outward, X facing along the rotation of the wheel, and Y facing perpendicular to the rotation of the wheel.&lt;/p></description></item><item><title>UART Between Raspberry Pi and Arduino</title><link>https://lloydroc.github.io/post/hardware/uart-rpi-and-arduino/</link><pubDate>Wed, 18 Mar 2020 14:02:54 +0000</pubDate><guid>https://lloydroc.github.io/post/hardware/uart-rpi-and-arduino/</guid><description>&lt;p>Using a 2-wire serial connection we can communicate from a Raspberry Pi (RPi) to an Arduino. For the Raspberry Pi we&amp;rsquo;ll use the built in UART accessed through a &lt;code>tty&lt;/code>, and the Arduino we&amp;rsquo;ll use the &lt;a href="https://www.arduino.cc/reference/en/language/functions/communication/serial/">Serial&lt;/a> Communication Library.&lt;/p>
&lt;h1 id="what-this-example-does">What this Example Does?&lt;/h1>
&lt;p>This example will use a RPi and Arduino to send a fixed message from the RPi to the Arduino. The Arduino will then echo what it receives back the RPi. The hardware used was a RPi B+ and the Arduino Due. The code is all in C/C++.&lt;/p></description></item></channel></rss>