Skip to content

Instantly share code, notes, and snippets.

View toxicantidote's full-sized avatar
🫠

toxicantidote

🫠
View GitHub Profile
@toxicantidote
toxicantidote / aht20_softwire_example.ino
Created June 7, 2026 10:48
Arduino ESP32 AHT20 SoftWire example with two sensors
/*
Example code to read two I2C AHT20 sensors connected to different pins
and print their temperature to the serial terminal using the SoftWire
software I2C library.
Based on ChatGPT generated code, but modified to allow two sensors.
Tested with ESP32-C3 board and two AHT20 breakouts from AliExpress.
*/
@toxicantidote
toxicantidote / User_Setup.h
Last active April 14, 2026 07:29
(Arduino) Loading an animated GIF from an SD card to display on CYD using TFT_eSPI
/*
Rui Santos & Sara Santos - Random Nerd Tutorials
Install the "TFT_eSPI" lbirary by Bodmer to interface with the TFT Display - https://github.com/Bodmer/TFT_eSPI
*** IMPORTANT: User_Setup.h available on the internet will probably NOT work with the examples available at Random Nerd Tutorials ***
*** YOU MUST USE THIS User_Setup.h FILE, CHECK FOR THE LATEST VERSION IN THE LINK BELOW IN ORDER TO USE THE EXAMPLES FROM RANDOM NERD TUTORIALS ***
https://RandomNerdTutorials.com/cyd/
https://RandomNerdTutorials.com/esp32-tft/
FULL INSTRUCTIONS AVAILABLE ON HOW CONFIGURE THE LIBRARY: https://RandomNerdTutorials.com/cyd/ or https://RandomNerdTutorials.com/esp32-tft/
*/
@toxicantidote
toxicantidote / lancache.py
Last active January 23, 2026 02:23
Uses LANcache DNS lists to create a DNSmasq compatible config file to redirect DNS queries to an existing LANcache server
## LANcache server IP
cache_ip = '192.168.118.5'
## DNSmasq output file (don't overwrite main config)
output_file = '/etc/dnsmasq.lancache'
###
import requests
import os
import datetime
@toxicantidote
toxicantidote / macro_pad.ino
Created August 7, 2024 11:10
Media key macro pad
#include "HID-Project.h"
#define PIN_BTN_PREV 11
#define PIN_BTN_PAUSE A1
#define PIN_BTN_NEXT A0
#define PIN_BTN_VOL_DOWN A2
#define PIN_BTN_VOL_MUTE 10
#define PIN_BTN_VOL_UP 9
@toxicantidote
toxicantidote / fridge_fault_bridge.ino
Last active August 5, 2024 11:54
Compressor interfacing for new fridge controller
#include <avr/wdt.h>
// how long to wait after a UART command before considering the link dead and
// resetting self (ms)
#define KEEPALIVE_WAIT 10000
// pins where things are connected
#define PIN_INTERRUPT 2
#define PIN_LED_R 11
@toxicantidote
toxicantidote / fridge_gui.py
Last active August 5, 2024 12:17
Fridge GUI/control
import board
from micropython import const as S
## Screen parameters
LCD_WIDTH = S(130)
LCD_HEIGHT = S(64)
LCD_ROTATION = S(0)
## Button thresholds
THRESHOLD_BLUE = S(8000)
@toxicantidote
toxicantidote / picow_st7735s.py
Created July 13, 2023 23:53
ST7735S display test - CircuitPython (Pico W) - NOT WORKING
# 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.
"""
import board
import terminalio
@toxicantidote
toxicantidote / esp32_st7735s.py
Created July 13, 2023 23:38
ST7735S display test - CircuitPython (ESP32)
# 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.
"""
import board
import terminalio
@toxicantidote
toxicantidote / Nayax sales reporting.py
Created June 28, 2022 08:18
Nayax sales reporting
## standard libraries
import re
import time
import queue
import threading
import json
from tkinter import *
from tkinter import ttk, font, messagebox, filedialog
import datetime
import os
@toxicantidote
toxicantidote / wifi_select.ino
Last active May 22, 2023 01:08
ESP32 Wi-Fi search and connect to saved
#include <WiFi.h>
#include <Preferences.h>
#include <esp_task_wdt.h>
#define CMDPROMPT "ESP32> "
#define TIMEOUT 10000
// cmd line vars
char cmdBuffer[32];
int cmdBufferPosition = 0;