I need to control a stepper motor by using the Particle Photon and the Adafruit Motorshield V2, and am having a lot of trouble getting it to work. I am fully aware of this post here, Adafruit Motor Shield V2 Library [PORTED] . However, this post is written with the Spark Core in mind, not the Photon. Having said this, I have tried everything to get it to work. I have configured the spark and shield exactly as shown in this video, https://www.youtube.com/watch?v=629VVNp0Z5Y . The code I am using is the Adafruit-Motorshield-Example.cpp file from the Adafruit-Motorshield-V2 library in the web IDE, as was recommended in the other post.
Having done all this, I cannot get the motor to spin at all. I have the same motor as shown in the video, and I am sure that it works, because I was using it with Arduino just last week.
If someone could please help me figure out how to get this motor running I would be extremely grateful. I am very new to all this kind of stuff so please forgive me if I ask any dumb questions in response. Please help, I really need this to work! Thanks!
@kennethlimcp, Is this not identical to what is currently in the web IDE? It says that nothing has been updated in over a year, and it mentions nothing about being compatible with the photon… Also how exactly do I go about using CLI to compile it? Can I not just copy paste the code from here into the existing web IDE code?
Ok great, thanks! But just to be clear, isn’t the stuff on github the same stuff from the IDE? Like I said above, it hasn’t been updated in a year and does not say anything about being compatible with photon?
Sorry, I don’t think I understand what you mean … The library appears to work fine for the core, but I can’t get it working with my photon. I thought that the photon and core were nearly identical devices? Is there any reason that the code would work for the core but not the photon?
Hi, @mastap94, did you manage to get it working with the Photon? The library seems to be crashing the core, so I thought I’d give it a try with a photon. Thanks!
Hi @mastap94, I have exactly the same problem as you describe with the Adafruit Motorshield v.2 and Photon, did you ever solve this ? If you did could you please give me a hint on how you did it.
It would be more helpful to actually state what your problem is than just saying it’s the same, because this is highky unlikely after this long and the updated version being put onto Particle Build meanwhile.
I’ve just built the adafruit-motorshield-example without any problem.
I have hooked up the Adafruit Motor shield v2.3 to my Photon as described in a previous thread:
Shield A4 and A5 to D0(SDA) and D1(SCL) on the Photon.
Vin and Gnd from Photon to Vin and Gnd on the Shield. I have a separate power supply (battery) 7,4V connected to motor power and a small DC motor connected to M1. I also set the Shield to 3V logic.
I added the Adafruit Motor shield V2 lib to my code and have successfully compiled including the test code as below, but I do not get any action from the M1/motor.
I am quite new to this so probably a rookie mistake, or??