Does the Arduino clock frequency affect analogRead()?

I keep getting the wrong voltage. It should be about 2.11 volts but it shows .42 volts. I am using the 8MHz internal clock on the atmega328 non-picopower model. What is going on?

EDIT:

Here's my code:

// Configuration:
// 5v------10k-------Sensor------GND
//               |
//            Analog

void setup()
{
  Serial.begin(9600*2);  //Start the serial connection with the computer
}

float getTemp() {
  float aread = analogRead(0) / 1024.0;           // calculate voltage
  Serial.println(aread);                                   // print voltage
  float resistance = 330.0 / (5.0 / aread - 1.0); // calculate resistance of sensor
  Serial.println(resistance);                             // print resistance
  float temp = 46 / pow(resistance, .40984);     // calculate temperature with resistance
  Serial.println(temp);                                    // print temp
  return temp;
}
 
void loop()
{
  getTemp();
  delay(1000);
}

Code ? Schematics ?

Why not just tell the compiler you're using a clock rate of 8MHz? Check out the tools->board menu and select the pro with 8MHz

@WizenedEE
That doesn't work. It just gives the same numbers.

float getTemp() {
  return temp;
}
 
void loop()
{
  getTemp();

The getTemp() function returns a value that you just throw away. Why?

@PaulS - It would be used to change the speed of a motor via PWM, but I'm just trying to get the correct temperature right now.

Hi,
are you sure the equation for calculating the resistance is correct? From the schematics in your code:

// Configuration:
// 5v------10k-------Sensor------GND
//               |
//            Analog

it should be:

float aread = 5.0 * (analogRead(0) / 1024.0) // voltage in Volts
float resistance = (10000 * aread) / (5.0 - aread); // resistance in ohm

@ea123 - I figured this out already, but thanks anyway.

By the way:

10000 / (5 / aread - 1) = 10000 * aread / (5 - aread)