Jumping Analog Values

Just a heads up, I'm very new to C+ programming and electrical engineering.

So I found a program in a youtube video that changes the rate of blinking of an LED based on the value of a potentiometer. It worked. Later, when I was using servos, they suddenly started to act weird. When I went back to the program I mentioned, it didn't work either. I set up a serial monitor and printed the value of the potentiometer and found some interesting results. The value seemed to be randomized. I have no idea what to do or what's going on.

I've attached a list of the results that I got to give you an idea of what I am working with.

I would be super thankful for any help that you could provide.

RESULTS:

327
576
557
395
524
968
435
203
251
947
377
487
574
563
179
581
427
680
147

Looks like you are reading an OPEN analog pin. Check your wiring. If it is not connected to a steady voltage it will jump around like that.

That looks like a floating pin - are you sure all electrical connections are good, soldered or otherwise firmly attached?

The electrical connections seem fine. How do I maintain a jumping voltage then?

Connect your analog pin directly to Vcc, and you should read (about) 1023. Connect to GND and you should read (about) 0.

Please post circuit diagram (no Fritzing, that's mostly worthless; with all component values and actual connection - hand drawn is fine).

cwduffy01:
The electrical connections seem fine. How do I maintain a jumping voltage then?

Maintain

verb: maintain; 3rd person present: maintains; past tense: maintained; past participle: maintained; gerund or present participle: maintaining

cause or enable (a condition or situation) to continue.
"the need to maintain close links between industry and schools"
synonyms: continue, keep, keep going, keep up, keep alive, keep in existence, carry on, preserve, conserve, prolong, perpetuate, sustain, bolster (up), prop up, retain, support, bear
"the need to maintain close links between industry and schools"

So to maintain the jumping voltage reading do nothing, it is jumping fine.

wvmarle:
Connect your analog pin directly to Vcc, and you should read (about) 1023. Connect to GND and you should read (about) 0.

Please post circuit diagram (no Fritzing, that's mostly worthless; with all component values and actual connection - hand drawn is fine).

I'm not sure how to do that. (Super noob. Remember?) I've attached a photo of the circuit and copied and pasted the code in this reply if it helps.

CODE:

int pot =0;
int led=1;

void setup() {
pinMode(led, OUTPUT);
Serial.begin(9600);

}

void loop() {
int delayTimer=analogRead(pot) ;

digitalWrite(led, 1);
delay(delayTimer);

digitalWrite(led, 0);
delay(delayTimer);

Serial.println(delayTimer);

}

Okay for some reason the photo didn't attach, so here is a drive link of that image: Arduino Circuit.JPG - Google Drive

int led=1;

Don't use pin 0 or 1.
These are the RX/TX pins for the USB<>Serial comms.
Leo..

Their is a gap in the power rails on that bread board so the left side is not connected to the right side. So as people told you there is no ground on the pot and the input is floating.

Please read this:-
How to use this forum
Because your post is breaking the rules about posting code.
Image guide tells you how to post pictures
image guide

Grumpy_Mike:
Their is a gap in the power rails on that bread board so the left side is not connected to the right side. So as people told you there is no ground on the pot and the input is floating.

Please read this:-
How to use this forum
Because your post is breaking the rules about posting code.
Image guide tells you how to post pictures
image guide

Oh my god I would have never found that gap in the power rails. Thank you! Everything's working perfectly now.

And thank you for informing me about the code rule as well.