Last active
August 29, 2015 14:22
-
-
Save bennuttall/1c324951792c5a6f91dc to your computer and use it in GitHub Desktop.
astro-cam.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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