Here is the p5.js mouse issue for touch devices from the link I provided
Please be advised: per the p5 reference page, that some browsers have default behavior for mousePressed() functions. “Browsers may have different default behaviors attached to various mouse events. To prevent any default behavior for this event, add return false to the end of the method.” JUST DO IT!
Note when you remove this line
Counting won’t be stable