Created
July 3, 2015 05:21
-
-
Save jbott/80d24fe69cb28c60c265 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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