I'm using an L298N driver (powered by a 12V, 1.5A adapter) on a MEGA Sensor Shield (powered by a USB cable). Everything works fine and I can control the direction and the speed of the DC motor, however when I activate anything else on the shield - the motor will not spin unless I set the PWM to its highest frequency.

Please note that I am using Max/MSP to controls the motors, so when I say activate - I mean setting up the PinMode of pin 17 to "Servo". If I set up the Servo first and then the DC motor pins - it will again start spinning only at maximum PWM, there's no signal reaching the driver otherwise.

Am I missing something in my setup? I would use Arduino Mega on its own, however I need to use over 25 Servo motors together with the L298N driver, which makes the sensor shield inevitable.

enter image description here


It seems that the issue is with the fact that PWM is only supported on pins 2-13, so I shouldn't have connected it to pin 46.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.