Skip to content

Instantly share code, notes, and snippets.

@sethcohn
sethcohn / code.py
Created August 10, 2017 23:46
Quick and dirty fire for neopixels in circuitpython
# not a great one, but it works, and it's tweakable. You'll need to add imports and tweak values
strand = neopixel.NeoPixel(NEOPIXEL, 10, 3, 1, False)
while True:
r = 226
g = 121
b = 35
#Flicker, based on our initial RGB values
for i in range (0, len(strand)):
@sethcohn
sethcohn / code.py
Last active August 9, 2017 23:49
Why is this slow? It doesn't actually write the pixel...
from board import *
import time
import neopixel
class PixelPaint:
def __init__(self, pixelobj):
self.pixelobj = pixelobj
self.n = len(self.pixelobj)
@sethcohn
sethcohn / pixeltimetrial-code.py
Created August 9, 2017 21:59
Pixel Time Trials - for testing write speeds in CircuitPython
from board import *
import time
import urandom
import neopixel
pininuse = A0 #change for your board pin
strandsize = 144
stepsize = 10
startingpixel = 5
color = (30,0,0)
@sethcohn
sethcohn / keybase.md
Created February 7, 2016 22:27
Keybase verification

Keybase proof

I hereby claim:

  • I am sethcohn on github.
  • I am sethcohn (https://keybase.io/sethcohn) on keybase.
  • I have a public key whose fingerprint is 3CCB 9507 A984 AF8C 20AB DE49 166F BCDB 8CB9 1737

To claim this, I am signing this object: