Is it at all possible to run a neo or neo550 paired with a sparkmax with an arduino? I’ve read about the PWM ports on the sparkmax but am unsure about how they would be wired to the arduino. So far I understand that I would have to power the sparkmax externally with 12V and enough current. I am just unsure about how to actually tell the motor controller to spin the motor and how it would be wired.
edit: For power, we use a little 12v automotive circuit panel with circuit breakers to connect to 1-2 controllers for testing. We use a airplane servo controller to generate PWM to the spark maxes.
I see, could you elaborate a bit more on what you mean by “angle” vs “speed”? Would just running an analogWrite({PWM_PIN}, {0-255}) in a loop not work to spin the motor? Would it just send the motor to a certain angle like a servo?
What you’re looking for is the Servo.write() function. The note on continuous-rotation servos also applies to PWMPulse Width Modulation motor controllers:
On a continuous rotation servo, this will set the speed of the servo (with 0 being full-speed in one direction, 180 being full speed in the other, and a value near 90 being no movement).
I’ve found that the Knob example is a good place to start with when working with motor controllers and Arduino.
Ive actually been doing work with this recently. I havent done it with sparkmaxes, but rather the original sparks with CIM motors, it should be a similar process. In terms of wiring, I’m using PWM control. I’m getting the signal, 5v power, and ground from the arduino. The Arduino must have a shared ground connection to the main FRC circuit for this to work. From there I am just using the arduino servo library, 180 is motor full speed forward, 90 is stopped, and 0 is full speed reverse. Let me know if you have any questions.