Loop certain number of times then do action

I would be interesting in seeing your code and schematic