SOLVED: n00b problem, can't get analogRead to work

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?

My code: https://drive.google.com/file/d/0BxkZanp3mKF6dGxwVUdfcktEcFE/edit?usp=sharing

My circuit: https://drive.google.com/file/d/0BxkZanp3mKF6U0dnTXhJRnpXakk/edit?usp=sharing

Trinket pinout: Pinouts | Introducing Trinket | Adafruit Learning System

The files on the Google drive are not public, or something.
Post the schematic and the code here on the forums.

OK, here's my code:

int red = 4;
int green = 3;
int analogPin = 2;
int voltage = 0;

void setup() {
  pinMode(red, OUTPUT);
  pinMode(green, OUTPUT);
  pinMode(analogPin, INPUT);
}

void loop() {
  voltage = analogRead(analogPin);
  if (voltage <= 205) {
    blinkRed();
  }
  else if (voltage >= 232.813317) {
    blinkGreen();
  }
  else {
    digitalWrite(red, LOW);
    digitalWrite(green, LOW);
  }
}

void blinkRed() {
  digitalWrite(red, HIGH);
  delay(300);
  digitalWrite(red, LOW);
  delay(300);
}

void blinkGreen() {
  digitalWrite(green, HIGH);
  delay(300);
  digitalWrite(green, LOW);
  delay(300);
}

Try this link for the schematic: http://www.digikey.com/schemeit/#q3a

Also, I made the Google Drive files public, so those should be accessible now. Sorry about that.

if (voltage >= 232.813317)

Voltage is an integer so why are you using a floating point number?

Why can't you post things properly, that schematic never loaded after five minuets.

Finally got the schematic. Why no resistors on the LEDs?

Further Edit
You are reading analogue 2 and wiring up to analogue 1

Yeah, that's probably part of the problem. I rounded it up to 233, and it's still doing the same thing.

Does the schematic show up now?

Printer-friendly version.pdf (28.3 KB)

Grumpy_Mike:
Further Edit
You are reading analogue 2 and wiring up to analogue 1

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.