Skip to content

Instantly share code, notes, and snippets.

@emdeex
emdeex / rainbowCycleMods
Created March 5, 2020 02:41
Playing with rainbowCycle mods for different effects
#!/usr/bin/env python3
import time
from neopixel import *
import argparse
# LED strip configuration:
LED_COUNT = 150 # Number of LED pixels.
LED_PIN = 18 # GPIO pin connected to the pixels (18 uses PWM!).
LED_FREQ_HZ = 800000 # LED signal frequency in hertz (usually 800khz)
@emdeex
emdeex / js_linux.py
Last active October 12, 2021 16:49 — forked from rdb/js_linux.py
Access joysticks/game controllers from Python in Linux via the joystick driver. See https://www.panda3d.org/forums/viewtopic.php?f=8&t=16767
# Released by rdb under the Unlicense (unlicense.org)
# Based on information from:
# https://www.kernel.org/doc/Documentation/input/joystick-api.txt
import os, struct, array
from fcntl import ioctl
# Iterate over the joystick devices.
print('Available devices:')