Limit Switch pressed a certain number of times

I am trying to code a motor to start for a brief amount of time after a Limit switch is pressed 5 times. I am having trouble finding the command to do so, this is the last major part of my groups code for our project.
the sensor is supposed to detect a cookie 5 times, which would make the motor turn, moving a trey to form another row, this should happen 4-5 times (thought I can just loop it at that point)

Try this, it should turn the motor when the switch is pressed 5 times

4 Likes

thank you very much, this was a life saver

No problem! I wish you luck on your cookie machine :slight_smile: