Skip to content

Instantly share code, notes, and snippets.

@Neradoc
Neradoc / animation_cometschase.py
Created December 6, 2022 22:35
My Library Neopixel BLE Controller. Animate LEDs like a waterfall, change color from the Buefruit app, light up when prosimity sensor triggers.
from math import ceil
from adafruit_led_animation.animation import Animation
from adafruit_led_animation.color import BLACK, calculate_intensity
class CometsChase(Animation):
"""
Chase pixels in one direction in a single color, like a theater marquee sign.
But with comets.
import asyncio
import click
import discotool
import os
import shutil
import subprocess
current_boards = []
def read_board_id(board):
@Neradoc
Neradoc / ElementTree.py
Created August 31, 2022 05:44
Circuitpython XML example, port of micropython-lib.
# This file is part of the standard library of Pycopy project, minimalist
# and lightweight Python implementation.
#
# https://github.com/pfalcon/pycopy
# https://github.com/pfalcon/pycopy-lib
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2020 Paul Sokolovsky
#
@Neradoc
Neradoc / animation_cometschase.py
Created August 17, 2022 23:00
Animation of comets chasing each other.
from math import ceil
from adafruit_led_animation.animation import Animation
from adafruit_led_animation.color import BLACK, calculate_intensity
class CometsChase(Animation):
"""
Chase pixels in one direction in a single color, like a theater marquee sign.
But with comets.
# SPDX-FileCopyrightText: 2020 Kattni Rembor for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_led_animation.group`
================================================================================
Animation group helper for CircuitPython helper library for LED animations..
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 1 column, instead of 2. in line 2.
2022-08-09;Hello this is the first line.
2015-10-21;This is back to the future day.
2042-01-01;Let's add a third line, for the demo.
@Neradoc
Neradoc / arrows.bmp
Created May 15, 2022 03:13 — forked from joeycastillo/arrows.bmp
Bike commuter computer with the Adafruit CLUE
@Neradoc
Neradoc / code_clock.py
Created May 2, 2022 20:53
Simple NTP clock for any generic board with built-in display and wifi
import board
import time
import uiclock_lib as uiclock
# timezone offset in seconds (fomr UTC)
TZ_OFFSET = 3600 * 2
current_time = None
def update_time(text_label):
@Neradoc
Neradoc / maker_pico_base.py
Last active June 2, 2022 20:27
Helper library with pin aliases for Cytron's Maker Pi Pico (Base)
from board import *
# on-board default SPI for SD card
SCK = GP10
MOSI = GP11
MISO = GP12
SD_CS = GP15
# alternate SD card pins names
SD_CMD = GP11
SD_DAT0 = GP12
SD_DAT1 = GP13
@Neradoc
Neradoc / write_file_to_eeprom.py
Last active January 24, 2022 01:36
Write a file to an EEPROM (that uses a single byte address) AT24C01A-AT24C16A
import board
import time
ADDRESS = 0x54
FILE_NAME = "eeprom_edit.bin"
####################################################################
# read the file
####################################################################