DC motor driver compatible with Photon 2

I'm working on a prototype using a Photon 2 that requires an actuator moved by a DC motor. All of the info I find on compatible libraries, control boards, and DC motors is out of date. Any current suggestions for this use case?

A controller that connects via I2C, SPI, or UART should work the same across all Particle devices.

A servo (PWM controlled) will work on all devices using Servo class.

The most common place you'll run into trouble is if the controller requires a precise high-speed pulse train for control and its done by bit-banging, as the GPIO is slower on the P2/Photon 2 and could be an issue in some cases. This can also affect quadrature decoding in software if needed.

1 Like

Thank you for your response!

For my prototype, I would like to use I2C with Adafruit's DC Motor + Stepper FeatherWing Add-on For All Feather Boards. They recommend the Adafruit_Motor_Shield_V2_Library, which is not compatible with the Photon 2 according to the Particle docs.

Can you recommend a strategy for interfacing with this controller?

The library should work. The code fails the build test in the docs because the paths in the example are wrong. If you change the first few lines to this, it will compile on the P2/Photon 2 with Device OS 5.8.0. I didn't test it on a device with the shield, but it should work.

#include "application.h"
#include "Adafruit-MotorShield-V2.h"
#include "Adafruit_PWMServoDriver.h"