Let's Make Robots!

Problem with arduino code

how to i make this two diferent codes work a¡in the same skecth but with afecting the other. When i tried combining them together, it started working slow, as if one is working after the other. Here is the two code combined

#define trigPin 6 

#define echoPin 7



int speakerPin = 8; 

Servo gripperPin; 

Servo wristPin; 

Servo armPin; 

Servo shoulderPin; 

Servo basePin; 



int potpin = 0; 

int potpin1 =1;

int potpin2 =2;

pot with 6 pin

can i use a stereo pot as a mono pot to controll a servomotor