You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
284 B
16 lines
284 B
4 years ago
|
import io
|
||
|
import time
|
||
|
from picamera import PiCamera
|
||
|
|
||
|
camera = PiCamera()
|
||
|
camera.resolution = (640, 480)
|
||
|
camera.rotation = 0
|
||
|
|
||
|
time.sleep(2)
|
||
|
|
||
|
image = io.BytesIO()
|
||
|
camera.capture(image, 'jpeg')
|
||
|
image.seek(0)
|
||
|
|
||
|
with open('image.jpg', 'wb') as image_file:
|
||
|
image_file.write(image.read())
|