MY servos don't work

Hello there. I want to do a arduino robot arm and I do everything in this video : How to make Micro Servo Robotic arm arduino based simple DIY - YouTube
My connection is: File sharing and storage made simple (but I can’t understand how to connect battery)
My program is: But it doesn’t work. Idk what to do pls help me :)))))))))))))))((
#include <Servo.h>
Servo myservo1;
Servo myservo2;
Servo myservo3;
Servo myservo4;
int potpin1 = 1;
int potpin2 = 2;
int potpin3 = 3;
int potpin4 = 4;
int val1;
int val2;
int val3;
int val4;
void setup()
{
myservo1.attach(6);
myservo2.attach(9);
myservo3.attach(10);
myservo4.attach(11);
Serial.begin(9600);
}
void loop() {
** {**
val1 = analogRead(potpin1);
val1 = map(val1, 0, 512, 0, 180);
myservo1.write(val1);
Serial.println(val1);
val2 = analogRead(potpin2);
val2 = map(val2, 0, 512, 0, 180);
myservo2.write(val2);
val3 = analogRead(potpin3);
val3 = map(val3, 0, 512, 0, 180);
myservo3.write(val3);
val4 = analogRead(potpin4);
val4 = map(val4, 0, 512, 0, 180);
myservo4.write(val4);

delay(5);
}
}
But it doesn’t work. PLS help me :))))))))))))))))

agakarlar: But it doesn't work. PLS help me :))))))))))))))))

Stop being ridiculous and give some detail as to what exactly is going wrong.

Shot in the dark: the 9V killed your servos since they probably aren't rated for 9V.

As well as over-voltage to the servos, the button wiring is bit gimpy (search the forum on how to connect switches & buttons with pull-up).

The real clincher may be that there is no supply input shown to the Arduino itself (use Battery 9V to VIN) Last point is that the battery will last about 1 min at best with multiple servos drawing current.

((Please don't insult everyone here with Fritzing diagrams))

Idk what to do pls help me :)))))))))))))))((

PLS help me :))))))))))))))))

So, can't be bothered to type simple words like "I don't know" and "please", or reading the posing guidelines, but can find the bold control (but not the code tags), the smilies and then lean on auto-repeat keys. Or learn about arrays.

Hi, Is this related to this?

https://forum.arduino.cc/index.php?topic=487635.msg3327472#msg3327472

Also please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code. It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png NOT the fritzy diagram you have linked too.

Can you post a picture of your project so we can see your component layout.

Thanks.. Tom.. :)

My best guess is that you want your potpins on A1 .. A4 instead of on 1 .. 4.

Jobi-Wan: My best guess is that you want your potpins on A1 .. A4 instead of on 1 .. 4.

No difference, unless they're wired to 1 to 4(digital pins)

AWOL: No difference, unless they're wired to 1 to 4(digital pins)

Right..

In analogRead(uint8_t pin) it says:

if (pin >= 14) pin -= 14; // allow for channel or pin numbers

...did not know that. Thanks.