what is the problem in this motor control arduino code

seeking some more solutions

If you haven't tried the perfectly workable ones suggested, why bother with others?