user18552: I recently bought an Arduino MEGA2560 and a SainSmart InstaBots Robot Controller Shield for Arduino MEGA2560 R3 Robot Arm Control.
I understand how to control a servo in the method described in Sweep. However, I want to control six servos using the shield area circled in red below. Could anyone provide the code to setup and control servos from the area circled in red?
Please help me I am a beginner in robotics and I need this for a project.


user13432: 
However, I want to control six servos using the shield area circled in red below. Could anyone provide the code to setup and control servos from the area circled in red?

With the limited amount of info you have provided about the shield this will have to be a wild guess. I am assuming that the pins are S(ignal), V(cc) and G(nd) for pins 8-13. On an Arduino Mega these can be used for PWM and therefore Servo control. 
Include the Servo library, attach the pin and set the angle. 
#include <Servo.h>

Servo servo[6];   

void setup() 
{
  ...
  for (int i = 0; i < 6; i++)
    servo[i].attach(8 + i);
  ...
}

void loop() 
{
   ...
   servo[i].write(pos);
   ...
}

Cheers!
NB: Do not forget to provide the correct power supply. If USB Port is left, then the upper pin is positive and the lower pin negative.

user56395: Sainsmart STILL refuses to supply documentation for this board.Supposedly, it can control 6 servos and two motors, up to 4 Amps, with digital encoder inputs. There is NO documentation on the hardware or the software for the mega to drive this.

18552: <p>I recently bought an Arduino MEGA2560 and a <a href="http://www.sainsmart.com/sainsmart-instabots-robot-controller-shield-for-arduino-mega2560-r3-robot-arm-control.html" rel="nofollow noreferrer">SainSmart InstaBots Robot Controller Shield for Arduino MEGA2560 R3 Robot Arm Control</a>.</p>

<p>I understand how to control a servo in the method described in <a href="https://www.arduino.cc/en/Tutorial/Sweep" rel="nofollow noreferrer">Sweep</a>. However, I want to control six servos using the shield area circled in red below. Could anyone provide the code to setup and control servos from the area circled in red?</p>

<p>Please help me I am a beginner in robotics and I need this for a project.</p>

<p><a href="https://i.stack.imgur.com/iVWnv.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iVWnv.jpg" alt="enter image description here"></a></p>
 13432: <blockquote>
  <p>However, I want to control six servos using the shield area circled in red below. Could anyone provide the code to setup and control servos from the area circled in red?</p>
</blockquote>

<p>With the limited amount of info you have provided about the shield this will have to be a wild guess. I am assuming that the pins are S(ignal), V(cc) and G(nd) for pins 8-13. On an Arduino Mega these can be used for PWM and therefore Servo control. </p>

<p>Include the Servo library, attach the pin and set the angle. </p>

<pre><code>#include &lt;Servo.h&gt;

Servo servo[6];   

void setup() 
{
  ...
  for (int i = 0; i &lt; 6; i++)
    servo[i].attach(8 + i);
  ...
}

void loop() 
{
   ...
   servo[i].write(pos);
   ...
}
</code></pre>

<p>Cheers!</p>

<p>NB: Do not forget to provide the correct power supply. If USB Port is left, then the upper pin is positive and the lower pin negative.</p>
 56395: <p>Sainsmart STILL refuses to supply documentation for this board.Supposedly, it can control 6 servos and two motors, up to 4 Amps, with digital encoder inputs. There is NO documentation on the hardware or the software for the mega to drive this.</p>
