Closed classicryder closed 5 years ago
Hi
I have solved this issue
Thanks
Great! Closing the issue for now.
Hi,
so my method is to have another shell script running all the time to check the text file and whenever the text file is changed, the GPIO is toggled, but using that approach causes my raspberry pi to freeze/reboot after 2-3 hours of run.. so im thinking, is there any way to "inject" a simulated saved sound pattern while sopare is running to toggle the gpio? like by pushing a button connected to the GPIO pin?
A workaround is never the best solution. Try to fix the root cause.
Hi,
Im trying to toggle the led output based on the output of a text file (True or False), so whenever sopare detect 2 consecutive claps, it will open the text file, read it, save the true/false value in a variable called "state", then negate it and send it to the GPIO to toggle the led, then write the latest value to the text file so that it can be used for the next cycle.
I have tried to mod the code so it becomes like this:
But the strange thing is, it only works on the first cycle of the sound pattern recog, please refer to the screenshot attached
please help
Thanks Alvin