diff --git a/.idea/workspace.xml b/.idea/workspace.xml index deb51e1..febc2fb 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,6 +2,7 @@ + - @@ -483,7 +494,7 @@ - + @@ -491,10 +502,18 @@ + + + + + + + + - - + + diff --git a/lib/controllib.py b/lib/controllib.py index a3398df..169a406 100644 --- a/lib/controllib.py +++ b/lib/controllib.py @@ -90,6 +90,7 @@ class Joystick(): def _save_camimg(self): + self.camera.new_frame() img = self.camera.image if os.path.isfile('image.jpg'): count=0 diff --git a/lib/graphiclib.py b/lib/graphiclib.py index dbe2f31..583adbd 100644 --- a/lib/graphiclib.py +++ b/lib/graphiclib.py @@ -74,7 +74,7 @@ class PiCamera(pygame.sprite.Sprite): pygame.camera.init() camera = picamera.PiCamera() self.camsize = (size[0], int(size[0]/2)) - camera.resolution = int(self.camsize[0]/2), int(self.camsize[1]/2) + camera.resolution = self.camsize self.camera = camera self.output = picamera.array.PiRGBArray(camera, size=self.camsize) self.size = size @@ -84,7 +84,9 @@ class PiCamera(pygame.sprite.Sprite): self.rect.topleft = position def update(self, *args): - print('updating camera') + pass + + def new_frame(self): self.output.truncate(0) self.camera.capture(self.output, 'rgb', resize=self.camsize) s = pygame.transform.rotate(pygame.surfarray.make_surface(self.output.array), 270)