Hi,
You can post the code in this thread. read this post first Forum Tips and Tricks
so you can learn how to post code in the forum correctly.
I don’t want to complicate things but adding a new mobile app adds a level of complexity that doesn’t need to be there. You could use the tinker app, the ITTT red button or Blynk.
Have you seend this project? https://particle.hackster.io/adi1690/particle-photon-motor-control-c1fa6d
It deals with motor control maybe you could use part of this project to get you motor running?