Closed ReadieS closed 5 years ago
So I am thinking I have been too focused on on gpiozero. after a bit of digging a research after finding this post I think I need to be using a while loop and polling the gpio pins for a low signal when it is connected to earth in-order to change recording states and add and remove overlays.
I'm thinking the error with my above code has something to do with me calling the function twice, once to start and once to stop. I had put in the overlay1=0
to avoid an undeclared variable but i think this should have hinted to me that code wasn't calling on the correct thing. I still dont totally understand it. Like I said its my first time using Python (not sure I can really say "coding in" as most of it is copied and pasted from examples!)
I'm going to go ahead and close the issue and stick it down to my ineptness at python. Thanks,
Please forgive me if this is a totally NOOB Question. This is my first attempt at python coding and I have tried asking for help in other groups but no one has come back to me. I have been attempting to create a fairly simple script that I will load on boot of a Pi, I will open a preview window without any input and it will stay there until the pi is turned off. I then want a button which will start and stop video recording for which I have used gpiozero. This all works fine but then I started trying to use a pil overlay to show when the video is recording. my code loads the overlay perfectly but when I try to remove the overlay it throws the error:
I have tried researching this on my own but being a learner to python I haven't found anything to help me interpret it clearly.
I would be very grateful if someone could give me a pointer in the right direction.
Thanks