You might consider adding some decoupling capacitors to your circuit. Motors often generate interference that can affect the running of the code.
See this:-
De-coupling tutorial
Especially the Pi configuration filters at the end of this.
You might consider adding some decoupling capacitors to your circuit. Motors often generate interference that can affect the running of the code.
See this:-
De-coupling tutorial
Especially the Pi configuration filters at the end of this.