Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4989

Camera board • Re: picamera2 capture_images_by_key.py does not work

$
0
0
I found a solution without keyboard module, but answers to previous questions are still appreciated.

With

Code:

from sys import stdinfrom tty import setrawimport termios
this is basic "keyboard event loop":

Code:

pi@raspberrypi5:~/picamera2/examples $ tail zoom.pycam(1)# because Python version <3.12tty_attrs = termios.tcgetattr(stdin.fileno())setraw(stdin.fileno())c = stdin.read(1)while c!='q' and ord(c)!=3:    c = stdin.read(1)termios.tcsetattr(stdin.fileno(), termios.TCSAFLUSH, tty_attrs)pi@raspberrypi5:~/picamera2/examples $ 

Statistics: Posted by HermannSW — Wed Jun 26, 2024 2:21 pm



Viewing all articles
Browse latest Browse all 4989

Trending Articles