Skip to main content
added 221 characters in body
Source Link
Kevin
  • 21
  • 4

I am trying to control MG996R using code for a typical servo (SG90)
I

I used an external power supply, 5V,2A
I connected the servo signal line to Arduino slot 7, servo positive to external power supply positive, servo ground to external power supply ground, while leaving the Arduino power supply and ground unconnected.

I tried the below code.
it works for SG90, while MG996R is not moving at all.


#include <Servo.h>  
Servo myservo;


void setup()
{ 
  myservo.attach(7);  //pin 7 is the one control servo
 
} 

void loop() 
{  

  for (int pos=0; pos<=60; pos++)
  {
    myservo.write(pos);
    delay(15);
  }

}

Is it because the different servos need different code?

I am trying to control MG996R using code for a typical servo (SG90)
I used an external power supply, 5V,2A
I tried the below code.
it works for SG90, while MG996R is not moving at all.


#include <Servo.h>  
Servo myservo;


void setup()
{ 
  myservo.attach(7);  //pin 7 is the one control servo
 
} 

void loop() 
{  

  for (int pos=0; pos<=60; pos++)
  {
    myservo.write(pos);
    delay(15);
  }

}

Is it because the different servos need different code?

I am trying to control MG996R using code for a typical servo (SG90)

I used an external power supply, 5V,2A
I connected the servo signal line to Arduino slot 7, servo positive to external power supply positive, servo ground to external power supply ground, while leaving the Arduino power supply and ground unconnected.

I tried the below code.
it works for SG90, while MG996R is not moving at all.


#include <Servo.h>  
Servo myservo;


void setup()
{ 
  myservo.attach(7);  //pin 7 is the one control servo
 
} 

void loop() 
{  

  for (int pos=0; pos<=60; pos++)
  {
    myservo.write(pos);
    delay(15);
  }

}

Is it because the different servos need different code?

edited body
Source Link
Kevin
  • 21
  • 4

I am trying to control MG996R using code for a typical servo (SG90)
I used an external power supply, 5V,2A
I tried the below code.
it works for SG90, while MG996R is not moving at all.


#include <Servo.h>  
Servo myservo;


void setup()
{ 
  myservo.attach(7);  //pin 97 is the one control servo
 
} 

void loop() 
{  

  for (int pos=0; pos<=60; pos++)
  {
    myservo.write(pos);
    delay(15);
  }

}

Is it because the different servos need different code?

I am trying to control MG996R using code for a typical servo (SG90)
I used an external power supply, 5V,2A
I tried the below code.
it works for SG90, while MG996R is not moving at all.


#include <Servo.h>  
Servo myservo;


void setup()
{ 
  myservo.attach(7);  //pin 9 is the one control servo
 
} 

void loop() 
{  

  for (int pos=0; pos<=60; pos++)
  {
    myservo.write(pos);
    delay(15);
  }

}

Is it because the different servos need different code?

I am trying to control MG996R using code for a typical servo (SG90)
I used an external power supply, 5V,2A
I tried the below code.
it works for SG90, while MG996R is not moving at all.


#include <Servo.h>  
Servo myservo;


void setup()
{ 
  myservo.attach(7);  //pin 7 is the one control servo
 
} 

void loop() 
{  

  for (int pos=0; pos<=60; pos++)
  {
    myservo.write(pos);
    delay(15);
  }

}

Is it because the different servos need different code?

Formatted code sections to make it easier to read. Fixed grammar.
Source Link
sa_leinad
  • 3.2k
  • 2
  • 24
  • 53

I am trying to control MG996R using code for a typical servo (SG90) 
I used an external power supply, 5V,2A 
I tried the below code. 
it works for SG90, while MG996R is not moving at all.


#include <Servo.h>  
Servo myservo;


void setup()
{ 
  myservo.attach(7);  //pin 9 is the one control servo
 
} 

void loop() 
{  

for (int pos=0;pos<=60;pos++)
{
  myservo.write(pos);
  delay(15);
}

}


#include <Servo.h>  
Servo myservo;


void setup()
{ 
  myservo.attach(7);  //pin 9 is the one control servo
 
} 

void loop() 
{  

  for (int pos=0; pos<=60; pos++)
  {
    myservo.write(pos);
    delay(15);
  }

}

Is it is because the different servoservos need different code?

I am trying to control MG996R using code for a typical servo (SG90) I used an external power supply, 5V,2A I tried the below code. it works for SG90, while MG996R is not moving at all.


#include <Servo.h>  
Servo myservo;


void setup()
{ 
  myservo.attach(7);  //pin 9 is the one control servo
 
} 

void loop() 
{  

for (int pos=0;pos<=60;pos++)
{
  myservo.write(pos);
  delay(15);
}

}

it is because different servo need different code?

I am trying to control MG996R using code for a typical servo (SG90) 
I used an external power supply, 5V,2A 
I tried the below code. 
it works for SG90, while MG996R is not moving at all.


#include <Servo.h>  
Servo myservo;


void setup()
{ 
  myservo.attach(7);  //pin 9 is the one control servo
 
} 

void loop() 
{  

  for (int pos=0; pos<=60; pos++)
  {
    myservo.write(pos);
    delay(15);
  }

}

Is it because the different servos need different code?

Source Link
Kevin
  • 21
  • 4
Loading