code for two motors

It will probably run, but it won't do what you intended.
Why don't you try it?
You're the one with the hardware.