Skip to content

Instantly share code, notes, and snippets.

@ARDev1161
ARDev1161 / quality_air.ino
Last active December 25, 2025 03:47
Lilygo T-QT Pro + ENS160 + AHT21
/*
LilyGO T-QT Pro (ESP32-S3FN4R2) + GC9107 128x128 (TFT_eSPI)
ENS160 + AHT21 on I2C
UI:
- Black background, cyan text normally
- If "BAD" (poor): black bg, RED text
- If "DANGER" (harmful): once per second for 420ms bg turns ORANGE and the *cause* is shown in RED
Buttons (T-QT Pro):
@ARDev1161
ARDev1161 / ws2812_tp223_7Effects.ino
Created December 23, 2025 00:24
New Year LED garland controller based on Seeed XIAO SAMD21. Drives an 86-pixel WS2812 strip and uses a TP223 capacitive touch button for intuitive control: effect switching, brightness adjustment, and power toggle
#include <Adafruit_NeoPixel.h>
// ----------------- HW -----------------
static constexpr uint16_t LED_COUNT = 86;
static constexpr uint8_t LED_PIN = 10; // XIAO D6 -> DIN WS2812
// TP223: VCC->3.3V, GND->GND, OUT->BTN_PIN
static constexpr uint8_t BTN_PIN = 9; // XIAO D1 <- OUT TP223
// ----------------- Power/brightness -----------------
@ARDev1161
ARDev1161 / growbox.ino
Created November 24, 2025 17:04
Light schedule on NodeMCU-32s
#include <WiFi.h>
#include <WebServer.h>
#include <time.h>
#include <Preferences.h>
const int ledPin = 2; // Pin connected to the onboard LED
// Relay settings
const int relayPin = 27; // Pin connected to the relay
bool relayState = false;
@ARDev1161
ARDev1161 / 90-sennheiser-gsa70.rules
Created October 8, 2025 21:35
UDev rule for initializing audio interfaces for Sennheiser GSP 670 dongle on connect
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="1395", ATTR{idProduct}=="0300", \
RUN+="/usr/bin/bash -c 'modprobe -r snd_usb_audio; sleep 1; modprobe snd_usb_audio'"
@ARDev1161
ARDev1161 / printer.cfg
Last active October 8, 2025 21:36
Creality K1C BTT SFS v2.0 config
[filament_switch_sensor filament_sensor]
pause_on_runout: true
switch_pin: ^PC15 # !PC15 original K1C config
runout_gcode:
{% if printer.extruder.can_extrude|lower == 'true' %}
G91
G0 E30 F600
G90
{% endif %}
@ARDev1161
ARDev1161 / run_ros2_docker.sh
Created July 18, 2025 01:48
Running ROS2 Jazzy with Gazebo under Docker with connecting to existed workspace
#!/usr/bin/env bash
set -e
# Simple logger
log() {
echo -e "\e[1;32m[INFO]\e[0m $*"
}
# 1. Ensure Docker is installed
if ! command -v docker &> /dev/null; then
@ARDev1161
ARDev1161 / spnav_install.sh
Created July 11, 2025 23:40
Ubuntu spacenavd installer
#!/usr/bin/env bash
set -euo pipefail
# ─────────── Configurable variables ───────────
PREFIX="/usr/local" # Change to /usr, /opt/spacenav, etc.
MAKE_JOBS="$(nproc)" # Parallel build jobs
# ──────────────────────────────────────────────
echo -e "\n=== 1. Installing build dependencies ==="
sudo apt-get update
@ARDev1161
ARDev1161 / config.txt
Last active March 8, 2023 00:32
Boot config for Zanya
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16