You need to take a step back to see where the problem lies. Simplify, then simplify more. Start with something simple... the blink sketch.. does that run perfectly for a long while?
next write a sketch to start and stop a motor running at a fixed speed and see if this runs ok, then try ramping speed up and down...
gradually increase complexity..
what is the purpose of the system?
next write a sketch to start and stop a motor running at a fixed speed and see if this runs ok, then try ramping speed up and down...
gradually increase complexity..
what is the purpose of the system?