Skip to content

Instantly share code, notes, and snippets.

View neildavis's full-sized avatar

Neil Davis neildavis

View GitHub Profile
@neildavis
neildavis / gist:b42e2beb065a31e5b7953901853f7f45
Created August 1, 2023 12:25
ILI9341 CircuitPython RP2040
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
"""
This test will initialize the display using displayio and draw a solid green
background, a smaller purple rectangle, and some yellow text. All drawing is done
using native displayio modules.
Pinouts are for the 2.4" TFT FeatherWing or Breakout with a Feather M4 or M0.
"""
@neildavis
neildavis / gist:10c5ab23c10e43a3b17de2b407530002
Last active April 24, 2023 17:06
Building Raspberry Pi OS schroots
# Install sbuild tools
DEBIAN_FRONTEND=noninteractive apt update && apt install -y sbuild debhelper ubuntu-dev-tools piuparts binfmt-support qemu-user-static
# Setup config files for sbuild
cat << EOF | tee -a ~/.mk_sbuild.rc
SCHROOT_CONF_SUFFIX="source-root-users=root,sbuild,admin
source-root-groups=root,sbuild,admin
preserve-environment=true"
# you will want to undo the below for stable releases, read `man mk-sbuild` for details
@neildavis
neildavis / pitemps.sh
Created March 5, 2023 15:52
Raspberry Pi CPU/GPU temps script
#!/usr/bin/env bash
cpu_temp=$(cat /sys/class/thermal/thermal_zone0/temp)
cpu_temp_fp=$(dc <<< "1 k ${cpu_temp} 1000 / p")
echo "GPU $(vcgencmd measure_temp)"
echo "CPU temp=${cpu_temp_fp}'C"