So I have been dealing with an annoying aspect of my project. I am building an RGB color picker that uses three potentiometers to control the amount of red, green, and blue in an RGB LED. The issue is that the R and the G potentiometer work just fine. The G potentiometer, however, turns the amount of green all the way up to 255 if it is turned more than halfway through, otherwise there is no color. I've tried switching the analog pin, I've tried putting it on a different board, I've tried new potentiometers, and nothing has worked. I could really appreciate some help on this. Attached below is a link to a video demonstration of what I am talking about if you are confused. The green potentiometer is hooked up to analog pin 1. The code is also attached but I doubt there are any issues with that.
Although it's probably not the cause of your problem, it's advisable to use the Ax (A0 etc) numbers.
analogRead is clever enough and will use the analog pins if you pass 0, 1, 2. pinMode does not know that you're referring to the analog pins and with your setup code will happily set the digital pins 0, 1 and 2 to input.