2

I'm trying to perform a simple analogRead() and print out the result, as below:

void getVoltMeter() {

  readValue = analogRead(A2);
  readByte = readValue/4; 
  Serial.println(readValue);
  Serial.println(readByte);

}

But the output is:

023
255

The voltage input is 5V, so I would expect it to read:

1023
255

Why is the first digit being cut off?

VE7JRO
  • 2,515
  • 19
  • 27
  • 29
janizer
  • 49
  • 7

0 Answers0