I'm doing a program that does the detection of color and object formats with a camera, when the format and the color are set, the program controls the GPIOS in which I connected a relay module. The problem I am having is that when I use the time.sleep command to keep the relay module turned on, it causes the entire program to freeze.
Here's the snippet I'm trying to solve:
if len(approx) == 4:
gpio.output(40 , 0)
time.sleep(10)
gpio.output(40, 1)
time.sleep(5)
cv2.putText(frame, "QUADRADO", (x, y), font, 1, (0, 255, 255) )
I'm using opencv and the whole control is done by a Raspberry Pi 3 B +.
Thanks for the attention, friends.