Skip to content
Permalink
Browse files

Fix for small dark die APA102s

  • Loading branch information
Gadgetoid committed Aug 24, 2016
1 parent 61e8ee0 commit 829aac0106bb08b6d10bba5c3ad001b468622c39
Showing with 10 additions and 3 deletions.
  1. +10 −3 library/blinkt.py
@@ -35,8 +35,15 @@ def clear():

def write_byte(byte):
for x in range(8):
bit = (byte & (1 << (7-x))) > 0
GPIO.output(DAT, bit)
GPIO.output(DAT, byte & 0b10000000)
GPIO.output(CLK, 1)
byte <<= 1
GPIO.output(CLK, 0)

# Emit exactly enough clock pulses to latch the small dark die APA102s which are weird
def _latch():
GPIO.output(DAT, 0)
for x in range(36):
GPIO.output(CLK, 1)
GPIO.output(CLK, 0)

@@ -51,7 +58,7 @@ def show():
write_byte(g)
write_byte(r)

write_byte(0xff)
_latch()

def set_pixel(x, r, g, b, brightness=None):
if brightness is None:

1 comment on commit 829aac0

@jasongong8888

This comment has been minimized.

Copy link

@jasongong8888 jasongong8888 commented on 829aac0 Sep 3, 2018

why didn't you try APA107 RGB LED? I know APA107 have 26-28KHZ PWM....

Please sign in to comment.