Skip to content

Commit

Permalink
Merge branch 'refs/heads/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLastGimbus committed Sep 19, 2024
2 parents 5d95a2c + 9e6c7d3 commit f33a711
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ Flask==2.3.3
Flask-Limiter==3.4.0
Flask-Cors==4.0.0
gpiozero==1.6.2
picamera==1.13
picamera2==0.3.21
rq==1.15.1
10 changes: 6 additions & 4 deletions tasks/roll_and_take_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import gpiozero
import io
import subprocess
from picamera import PiCamera
from picamera2 import Picamera2
from time import sleep

led = gpiozero.LED(4)
Expand All @@ -22,9 +22,11 @@ def roll_and_take_image():

led.on()
with io.BytesIO() as stream:
with PiCamera() as camera:
camera.resolution = (720, 480)
camera.capture(stream, 'jpeg')
camera = Picamera2()
camera.configure(camera.create_still_configuration(main={"size": (720, 480)}))
camera.start()
camera.capture_file(stream, format='jpeg')
camera.close()
bytes = stream.getvalue()
led.off()
return bytes

0 comments on commit f33a711

Please sign in to comment.