I'm trying to build a camera with the new HQ Camera module, but am running into some trouble. I don't want to have to run my little camera.py script (that just opens preview, waits, takes a photo, and closes preview) every time I want to take a picture. I'd like to solve this by adding 2 gpio buttons, #1 that toggles the camera preview on and off, and #2 that takes a picture and saves it to my designated folder. Would something like this work? Apologies for the beginner question, I get a bit ahead of my abilities on projects like this:
#1
import cam stuff
set previewon = false
:loop
check for button1 press
if{ prevon = false
[camera.preview.start]
[prevon==true]}
else{[camera.preview.stop]
[prevon==false]}
#2
import cam stuff
declare date/timestamp layout
:loop
check for button2 press
camera.capture("to destination folder" + timestamp + ".jpg")