How to control 4 motors on Navio+

Hi, i’ve connected as described ESC and motors and stuff, and run the servo script you shared. Now it run only one motor. I looked inside the code and it looks like you have only pin 27.

I didn’t find any documentation about what pins i need to use and how do they relate to the pins on navio+ board. May any one explain me? Or share the code of controlling four motors?



Could you please elaborate a bit.

Have you launched this code? If that’s the one, then the behavior you’re observing is expected. Because this code does indeed drives only one motor/servo.

Otherwise, we need to get a little more info.

  • What docs have you been following?
  • What ESCs do you use?
  • Are you sure that you power up everything right?

Anyway you should look into this entry which describes how you set up servos and ESCs.

PIN27 has barely anything to do with the issue. It needs to be pulled high to enable PCA9685 (a chip we use for PWM output). Don’t draw attention to it now.

Hi! Yes i used this code. But now i want to control 4 motors. How to do that?
I set up the hardware exactly as on the guide you’ve sent. I used AfroESC 30A, i connected them to 1,2,3,4 on servo and i pulled of 3 middle wares as explained. So the question is more on software part. Please give me example of controlling 4 motors instead of 1. Like using more then one GPIO.



The comment at the top of the Servo.cpp file describes how that could be done.

For example you could use something like this

Checking this!

Ok! Now I understand, I had some fundamental mistakes in understanding how this stuff works, now i understand much better, thank you!