Skip to content

Instantly share code, notes, and snippets.

@sethcohn
sethcohn / code.py
Created Aug 10, 2017
Quick and dirty fire for neopixels in circuitpython
View code.py
# 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 Aug 9, 2017
Why is this slow? It doesn't actually write the pixel...
View code.py
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 Aug 9, 2017
Pixel Time Trials - for testing write speeds in CircuitPython
View pixeltimetrial-code.py
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 Feb 7, 2016
Keybase verification
View keybase.md

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: