Skip to content

Instantly share code, notes, and snippets.

@XtendedGreg
XtendedGreg / Simple Quadrature Reader for Raspberry Pi Pico.md
Created July 8, 2024 00:37
Simple Quadrature Reader for Raspberry Pi Pico

Simple Quadrature Reader for Raspberry Pi Pico

As featured in the XtendedGreg YouTube Live Stream: https://youtube.com/live/jklc2Aq9-1E Simple Quadrature Reader for Raspberry Pi Pico

Introduction

This Gist has the code that we used to get the direction and speed of the quadrature output of a motor encoder. Quadrature is a simple two sensor mechanism that relies upon the order of offset to make that determination. This is a simplified example that counts the number of rotations and increments the counter or decrements the counter depending upon which direction it is rotating. Every second, it will print the number of cycles since the last time it was read to the console.

The Code

The majority of this code was taken from Peter Hinch's Micropython Samples: https://github.com/peterhinch/micropython-samples/blob/master/encoders/encoder_rp2.py

@XtendedGreg
XtendedGreg / Alpine Linux on Raspberry Pi Basics: Using I2C Sensors.md
Last active April 1, 2024 05:58
Alpine Linux on Raspberry Pi Basics: Using I2C Sensors

Alpine Linux on Raspberry Pi Basics: Using I2C Sensors

As featured in the XtendedGreg YouTube Live Stream: https://youtube.com/live/L9yt2NOktGs Alpine Linux on Raspberry Pi Basics: Using I2C Sensors

Introduction

This Gist is a procedure on how to enable I2C functionality on Alpine Linux running on a Raspberry Pi. I2C is a high speed communications interface that allows interacting with sensors and periferals efficiently. In this example, we will be connecting an SHT31-D temperature and humidity sensor to create a basic logger using Python. Follow these steps and you will be well on your way to integrating it into your next project!

Setup Procedure

  1. Enable I2C bus in usercfg.txt file on the root of the boot drive
  • From the console remount the boot drive for read/write
@XtendedGreg
XtendedGreg / Linux Netcat (nc) and Creating a Simple Web Server.md
Last active February 26, 2024 08:44
Introduction to Linux Netcat (nc) and Creating a Simple Web Server

Introduction to Linux Netcat (nc) and Creating a Simple Web Server

As seen on XtendedGreg Youtube Live Stream: https://youtube.com/live/ldWFKRFOY-0

Introduction

Netcat (nc) is a powerful networking utility available on Linux systems that allows for reading from and writing to network connections using TCP or UDP. In this guide, we'll demonstrate some of its basic functions and create a simple web server using Netcat.

Prerequisites

  • A Linux-based system with Netcat installed. You can install it using your package manager (e.g., apk, apt, yum, dnf).
@XtendedGreg
XtendedGreg / Creating Alpine Linux Packages.md
Created February 18, 2024 12:31
Creating Alpine Linux Packages

Creating Alpine Linux Packages

  • This Gist covers the commands and methods needed to create APK files and a local repository on Alpine Linux for your own software packages.
  • The focus of this guide is toward interpereted language software packages that do not require compiling, and is a simplified overview of what is needed to build a package.
  • Written by: XtendedGreg and featured on the live stream https://youtube.com/live/Q0XAnXgCxIw

Setup Development Environment and Build Package

Step 1: Install Dependancies

apk add alpine-sdk sudo abuild-rootbld doas
@XtendedGreg
XtendedGreg / Creating a Captive Portal on a Raspberry Pi Access Point running on Alpine Linux.md
Last active September 18, 2024 17:57
Creating a Captive Portal on a Raspberry Pi Access Point running on Alpine Linux

Creating a Captive Portal on a Raspberry Pi Access Point running on Alpine Linux

By: XtendedGreg as seen on https://youtube.com/live/vCRdlZjwhsE

Introduction

These commands will compile and install NoDogSplash, configure it as a captive portal, and start it as a service on Alpine Linux. This is useful for guest or customer networks where you would like to maintain access to the internet for temporary users, but do not want it to be exploited.

Equipment Needed

Step 1: Clone and Compile NoDogSplash

@XtendedGreg
XtendedGreg / Raspberry Pi Access Point on Alpine Linux.md
Last active February 8, 2024 06:26
Creating an Access Point on Raspberry Pi running Alpine Linux

Creating an Access Point on Raspberry Pi running Alpine Linux

By: XtendedGreg as seen on https://youtube.com/live/Uagq3oZrk6k

Introduction

Creating an access point with Alpine Linux on a Raspberry Pi can be an excellent project, as it allows you to extend your network or even create a new wireless network in a location where only wired internet is available. Below is a procedure to help you set up your Raspberry Pi as an access point using Alpine Linux. This guide assumes you have basic knowledge of Linux commands and networking.

Equipment Needed

  • Raspberry Pi (any model with Wi-Fi capability, e.g., Raspberry Pi 3/4/5)
  • MicroSD card (8 GB or more recommended)
  • Power supply for Raspberry Pi