user81651: 
#include <Servo.h>

#define potpin A0
int savebutton=2;
int button1=3;
int button2=4;
int button3=5;

Servo servo1;
Servo servo2;
Servo servo3;

int servo1ipos=90; 
int servo2ipos=90;
int servo3ipos=90;

int val=0;


void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(savebutton,INPUT);
  pinMode(button1,INPUT);
  pinMode(button2,INPUT);
  pinMode(button3,INPUT);

  servo1.attach(6);
  servo2.attach(7);
  servo3.attach(8);
  servo1.write(servo1ipos);
  servo2.write(servo2ipos);
  servo3.write(servo3ipos);

}

void loop() {
  // put your main code here, to run repeatedly:
  servocontrol();

}

int servocontrol(){
  if(digitalRead(button1)==LOW){
    potvalue();
    Serial.println(val);
    servo1.write(val);
    delay(200);
  }
}
int potvalue(){
    val=analogRead(potpin);
}

Basicly I only read 1023 value instead of potentiometer value I couldnt figure it out need help.
Update:
I came up solution by connecting 5V into Arduino's VCC pin.

user81651: I came up solution by connecting 5V into Arduino's VCC pin.

81651: <p><a href="https://i.stack.imgur.com/ge799.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ge799.png" alt="proteus schematic" /></a></p>
<pre><code>#include &lt;Servo.h&gt;

#define potpin A0
int savebutton=2;
int button1=3;
int button2=4;
int button3=5;

Servo servo1;
Servo servo2;
Servo servo3;

int servo1ipos=90; 
int servo2ipos=90;
int servo3ipos=90;

int val=0;


void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(savebutton,INPUT);
  pinMode(button1,INPUT);
  pinMode(button2,INPUT);
  pinMode(button3,INPUT);

  servo1.attach(6);
  servo2.attach(7);
  servo3.attach(8);
  servo1.write(servo1ipos);
  servo2.write(servo2ipos);
  servo3.write(servo3ipos);

}

void loop() {
  // put your main code here, to run repeatedly:
  servocontrol();

}

int servocontrol(){
  if(digitalRead(button1)==LOW){
    potvalue();
    Serial.println(val);
    servo1.write(val);
    delay(200);
  }
}
int potvalue(){
    val=analogRead(potpin);
}
</code></pre>
<p>Basicly I only read 1023 value instead of potentiometer value I couldnt figure it out need help.</p>
<p>Update:
I came up solution by connecting 5V into Arduino's VCC pin.</p>
 81651: <p>I came up solution by connecting 5V into Arduino's VCC pin.</p>
