Skip to content

Instantly share code, notes, and snippets.

# Welcome to PB-01
import board
import time
import math
import random
#import supervisor
from os import listdir
from gc import collect
import busio
@andywarburton
andywarburton / main.py
Last active August 29, 2023 11:32
PyModoro a CircuitPython Pomodoro Productivity Timer
import time
import board
from digitalio import DigitalInOut, Direction, Pull
import neopixel
# configure your timer
work_minutes = 20
rest_minutes = 5
# define colours
@andywarburton
andywarburton / yaml
Created July 26, 2023 19:44
slimmelezer
substitutions:
device_name: slimmelezer
device_description: "DIY P1 module to read your smart meter"
esphome:
name: ${device_name}
comment: "${device_description}"
platform: ESP8266
esp8266_restore_from_flash: true
board: d1_mini
import time
from galactic import GalacticUnicorn
from picographics import PicoGraphics, DISPLAY_GALACTIC_UNICORN as DISPLAY
import network
import rp2
from machine import Pin
import socket
import struct
import utime
"""Example for Pico. Blinks the built-in LED."""
import board
import digitalio
import os
import neopixel
from digitalio import DigitalInOut, Direction, Pull
from adafruit_debouncer import Debouncer
from adafruit_led_animation.animation.rainbow import Rainbow
from adafruit_led_animation.animation.rainbowchase import RainbowChase
@andywarburton
andywarburton / code.py
Created June 2, 2022 21:15
Code for Canairi Clone Project by Andy Warburton
import time
import board
import adafruit_sgp40
import pwmio
from adafruit_motor import servo
import adafruit_ahtx0
import neopixel
### you may need to customize these ###
@andywarburton
andywarburton / main.py
Last active June 4, 2022 19:30
KMK Firmware for my 40% One Handed Keyboard
print("Starting")
import board
import neopixel
from kmk.kmk_keyboard import KMKKeyboard
from kmk.keys import KC
from kmk.scanners import DiodeOrientation
from kmk.scanners import intify_coordinate as ic
from kmk.extensions.RGB import RGB
/* Copyright 2021 REPLACE_WITH_YOUR_NAME
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
import board
from adafruit_ht16k33.segments import BigSeg7x4
import time
import touchio
# setup the 7 segment display
i2c = board.I2C()
display = BigSeg7x4(i2c)
display.brightness = 0.2
#!/usr/bin/env python
# coding: Latin-1
# Load library functions we want
from inputs import get_gamepad
from explorerhat import motor
import math
import time
from blinkt import set_clear_on_exit, set_pixel, show, set_brightness