Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#define READ_COUNT 5
float volts[READ_COUNT];
void setup()
{
Serial.begin(9600);
}
void loop()
{
for (int i = 0; i < READ_COUNT; i++) {
volts[i] = analogRead(i) / 1024.0 * 5.0;
}
Serial.print("V ");
for (int i = 0; i < READ_COUNT; i++) {
Serial.print(volts[i]);
if ((i + 1) != READ_COUNT)
Serial.print(":");
}
Serial.println();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.