Before going through the code, i would suggest u to check the hardware circuitry. Like: did u connect the same ground both for the arduino n ur actuator(motor)? Did u use external power support (with motor driver or something like that) for the motor? Debug the whole thing with simple led or v/i meter. Good luck.
Sorry, I dont understand what you said. I know that there is a problem in my circuit. But what is the fault in using the same ground point in a bread board? Without external power supply, how can a motor run?
He means to say that if you are using an H-bridge to control the motors have you tried making sure they both(arduino and H-bridge) have same ground.
However I don’t think that’s big of a problem can you please upload some pics of individual parts say different and clear pics for pcb, breadboard connection etc.