Skip to content

Instantly share code, notes, and snippets.

@bennuttall
Last active August 29, 2015 14:22
Show Gist options
  • Save bennuttall/1c324951792c5a6f91dc to your computer and use it in GitHub Desktop.
Save bennuttall/1c324951792c5a6f91dc to your computer and use it in GitHub Desktop.
astro-cam.py
from picamera import PiCamera
from picamera.array import PiRGBArray
from astro_pi import AstroPi
ap = AstroPi()
while True:
with PiCamera() as camera:
camera.resolution = (64, 64)
with PiRGBArray(camera, size=(8, 8)) as stream:
camera.capture(stream, format='rgb', resize=(8, 8))
image = stream.array
pixels = [
pixel
for row in image
for pixel in row
]
ap.set_pixels(pixels)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment