Hi,
I have Arduino Uno, lcd 16x2 with i2c and a piezo sensor. I'm trying to write a code that will display a short animation of a sleeping face until the sensor is triggered there times which will then move on to a waking up animation.
My approach was to write an if function that will count how many times piezo sensor was triggered (condition was that the threshold must be higher than 30) and then while loop with the condition of reaching the count number of three. Inside the whole loop, I've placed an infinite for loop with the animation.
Tried chat gpt but it was only giving me the code that would repeat the animation each time the sensor was triggered..
It's probably super easy for you but I just can't see the solution.
May i ask for your assistance?
Kind regards,
Daniel