Skip to content

Instantly share code, notes, and snippets.

@wyojustin
Created April 23, 2017 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wyojustin/cb001beb1ff00eac04ffc57cf55efed2 to your computer and use it in GitHub Desktop.
Save wyojustin/cb001beb1ff00eac04ffc57cf55efed2 to your computer and use it in GitHub Desktop.
from pixel_maps import ultim8x8, ultim8x24, ultim8x72, ultim24x24, ultim16x56
from bibliopixel.drivers.serial_driver import DriverSerial, LEDTYPE
from bibliopixel import LEDMatrix, log
from BiblioPixelAnimations.matrix.ScreenGrab import ScreenGrab
log.setLogLevel(log.DEBUG)
# pixel_map = ultim8x8 ### ULTiM8x8
# pixel_map = ultim8x24 ### ULTiM8x24
# pixel_map = ultim24x24 ### ULTiM24x24
# pixel_map = ultim8x72 ### ULTiM8x72
pixel_map = ultim16x56 ### ULTiM16x56
width = len(pixel_map.map[0])
height = len(pixel_map.map)
n_pixel = width * height
driver = DriverSerial(LEDTYPE.GENERIC, n_pixel, hardwareID="16C0:0483", dev="/dev/ttyACM0")
led = LEDMatrix(driver, width=width, height=height, coordMap=pixel_map.map)
led.setMasterBrightness(4) ## low brightness for safe running off of USB
try:
scale = 8
xoff = 200
yoff = 300
anim = ScreenGrab(led, bbox=(xoff, xoff, xoff + width * scale, yoff + height * scale), mirror=False)
anim.run(amt=1, fps=15)
except:
led.all_off()
led.update()
raise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment