That will get you going, but down the road keep in mind there is a reason logic voltage and motor voltage are usually kept apart. There are several ways to accomplish isolation, one the easiest/best being 2 different batteries.
The problem is, in some configurations the motor pull can drop the voltage below what the logic can tolerate, even if just for a microsecond the results can be bad. Also motors, being mechanically/electrically connected (brushes sparking) tend to introduce 'noise' on the circuit and cause all kinds of hard to find problems.
Again, hook it up as you described, see if it works, then think a more permanent solution.
- CW2 likes this