I'm a relatively new programmer, working on an Adafruit Trinket board with Arduino IDE. I've written a program to read voltage (0-5V) from input pin 2, and cause a certain LED to blink depending on the voltage level. If the voltage is less than 1V, a red LED should blink; if it is greater than about 1.14, a green one should blink; otherwise, nothing should happen. It seems like the analogRead function is not working; I have checked the voltage source and confirmed that the voltage is in fact getting to the board. When I run the program, the red LED constantly blinks, no matter what the input voltage is. Because it blinks, I know the program is looping like it should; it's just not reading the voltage. Unfortunately, the Trinket board does not support the serial monitor function; if it did, that would certainly make this easier. Can anyone see anything obvious that I did wrong?
Oh, that did it. I thought since the pin was labeled "#2" on the board, that meant it was pin 2. Thank you very much for your help; the setup works perfectly now.