# long walk off a short pier!!!

Thanks,

Here is the code I am using

int ledPin = 13;
int inputVoltagePin = 0;

void setup(){
pinMode(ledPin, OUTPUT); // sets the digital pin as output
Serial.begin(9600);
}

void loop(){
int valueVolts=voltage/102;
int valueHundrethsOfMilliVolts=((voltage % 102)*10)/102;
// send formated value to serial com port
Serial.print(valueVolts);
Serial.print(’.’);
Serial.print(valueHundrethsOfMilliVolts);
Serial.println(‘V’);
// flash volts
for(int i=0;i<valueVolts;i++){
digitalWrite(ledPin,HIGH);
delay(500);
digitalWrite(ledPin,LOW);
delay(500);
}
delay(1000);
// flash hundreths of millivolts
for(int i=0;i<valueHundrethsOfMilliVolts;i++){
digitalWrite(ledPin,HIGH);
delay(100);
digitalWrite(ledPin,LOW);
delay(500);
}
delay(5000);
}

However, if I hook up a 1.5V or 9V battery instead of using arduino's output, the serial monitor shows random reading's from 0.2V to 10.0V???

Did you connect the grounds (0V) together?

reading 2 shows 10.0V 5 seconds later

On second thoughts, have you checked your arithmetic?

An analogRead can't return a value greater than 1023.

Did you connect the grounds (0V) together?

Nope…but after I did, everything worked fine. Thanks!

On second thoughts, have you checked your arithmetic?
An analogRead can’t return a value greater than 1023.

I’m such a newbie at this stuff that I am not sure what you mean. I know that there is a limit of some kind on what the analogRead can return and 1023 sounds familiar. I definitely saw 10.0 come up several times though.