user9850: I made simple code for a robotic arm, but the servos don't seem to be reacting at all. I made debug code before all the if statements, and those aren't working. I made sure my wiring was good and it is.
#include <Servo.h> 

Servo release1;
Servo release2;
Servo updown;


int pos = 64;    // variable to store the servo position 
int pos2 = 85;
int val = 0;
int val2 = 0;
int val3 = 0;

void setup() 
{ 
    release1.attach(8);
    release2.attach(9);  // attaches the servo on pin 9 to the servo object 
    updown.attach(10);
    release1.write(pos2);
    release2.write(pos2);
    updown.write(pos);
} 

void loop() 
{ 
    val = digitalRead(4);  
    val2 = digitalRead(5); 
    val3 = digitalRead(6);
    pos++;
    pos2++; 
    if(val = LOW){
        pos = pos + 15;
    }
    if(val2 = LOW)
    {
        pos = pos - 15;
    }
    if(val3 = LOW)
    {
        pos2 = 180;
    }
    if(val3 = HIGH){
        pos2 = 0;
    }
    release1.write(pos2);
    release2.write(pos2);
    updown.write(pos);
} 

I'm using this code and it still wont work.
/* Sweep
 by BARRAGAN <http://barraganstudio.com> 
 This example code is in the public domain.

 modified 8 Nov 2013
 by Scott Fitzgerald
 http://arduino.cc/en/Tutorial/Sweep
*/ 

#include <Servo.h> 

Servo myservo;  // create servo object to control a servo 
                // twelve servo objects can be created on most boards

int pos = 0;    // variable to store the servo position 

void setup() 
{ 
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object 
} 

void loop() 
{ 
  for(pos = 0; pos <= 180; pos += 1) // goes from 0 degrees to 180 degrees 
  {                                  // in steps of 1 degree 
    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
    delay(15);                       // waits 15ms for the servo to reach the position 
  } 
  for(pos = 180; pos>=0; pos-=1)     // goes from 180 degrees to 0 degrees 
  {                                
    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
    delay(15);                       // waits 15ms for the servo to reach the position 
  } 
} 


user10794: I made debug code before all the if statements, and those aren't working.
if(val2 = LOW)
{
  pos = pos - 15;
}
if(val3 = LOW)
{
  pos2 = 180;
}
if(val3 = HIGH){
  pos2 = 0;
}

That's because they are coded wrongly. Doing val2 = LOW assigns LOW to val2 and then tests it (which means it will fail the test). They should read:
if(val2 == LOW)
{
  pos = pos - 15;
}
if(val3 == LOW)
{
  pos2 = 180;
}
if(val3 == HIGH){
  pos2 = 0;
}


9850: <p>I made simple code for a robotic arm, but the servos don't seem to be reacting at all. I made debug code before all the if statements, and those aren't working. I made sure my wiring was good and it is.</p>

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

Servo release1;
Servo release2;
Servo updown;


int pos = 64;    // variable to store the servo position 
int pos2 = 85;
int val = 0;
int val2 = 0;
int val3 = 0;

void setup() 
{ 
    release1.attach(8);
    release2.attach(9);  // attaches the servo on pin 9 to the servo object 
    updown.attach(10);
    release1.write(pos2);
    release2.write(pos2);
    updown.write(pos);
} 

void loop() 
{ 
    val = digitalRead(4);  
    val2 = digitalRead(5); 
    val3 = digitalRead(6);
    pos++;
    pos2++; 
    if(val = LOW){
        pos = pos + 15;
    }
    if(val2 = LOW)
    {
        pos = pos - 15;
    }
    if(val3 = LOW)
    {
        pos2 = 180;
    }
    if(val3 = HIGH){
        pos2 = 0;
    }
    release1.write(pos2);
    release2.write(pos2);
    updown.write(pos);
} 
</code></pre>

<p>I'm using this code and it still wont work.</p>

<pre><code>/* Sweep
 by BARRAGAN &lt;http://barraganstudio.com&gt; 
 This example code is in the public domain.

 modified 8 Nov 2013
 by Scott Fitzgerald
 http://arduino.cc/en/Tutorial/Sweep
*/ 

#include &lt;Servo.h&gt; 

Servo myservo;  // create servo object to control a servo 
                // twelve servo objects can be created on most boards

int pos = 0;    // variable to store the servo position 

void setup() 
{ 
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object 
} 

void loop() 
{ 
  for(pos = 0; pos &lt;= 180; pos += 1) // goes from 0 degrees to 180 degrees 
  {                                  // in steps of 1 degree 
    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
    delay(15);                       // waits 15ms for the servo to reach the position 
  } 
  for(pos = 180; pos&gt;=0; pos-=1)     // goes from 180 degrees to 0 degrees 
  {                                
    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
    delay(15);                       // waits 15ms for the servo to reach the position 
  } 
} 
</code></pre>
 10794: <p>I made debug code before all the if statements, and those aren't working.</p>

<pre><code>if(val2 = LOW)
{
  pos = pos - 15;
}
if(val3 = LOW)
{
  pos2 = 180;
}
if(val3 = HIGH){
  pos2 = 0;
}
</code></pre>

<p>That's because they are coded wrongly. Doing <code>val2 = LOW</code> <strong>assigns</strong> LOW to val2 and then tests it (which means it will fail the test). They should read:</p>

<pre><code>if(val2 == LOW)
{
  pos = pos - 15;
}
if(val3 == LOW)
{
  pos2 = 180;
}
if(val3 == HIGH){
  pos2 = 0;
}
</code></pre>
