Skip to content

Instantly share code, notes, and snippets.

@jbott
Created July 3, 2015 05:21
Show Gist options
  • Save jbott/80d24fe69cb28c60c265 to your computer and use it in GitHub Desktop.
Save jbott/80d24fe69cb28c60c265 to your computer and use it in GitHub Desktop.
#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