--- /dev/null
+// These constants won't change. They're used to give names
+// to the pins used:
+// const int analogInPin = A8; // Analog input pin that the potentiometer is attached to
+
+const int numPins = 9;
+const int analogInPins[] = {A0, A1, A2, A3, A6, A7, A8, A9, A10};
+const float scaling[] = {4.267, 4.267, 4.267, 4.267, 4.267, 4.267, 4.267, 4.267, 4.267};
+/*
+const int numPins = 1;
+const int analogInPins[] = {A8};
+const float scaling[] = {4.267};
+*/
+int sensorValues[numPins]; // 0 - 1023
+float sensorVoltages[numPins]; // actual voltage on analog in pins
+float scaledSensorVoltages[numPins]; // corrected (scaled) voltages before voltage divider
+
+void setup() {
+ // initialize serial communications at 9600 bps:
+ Serial.begin(9600);
+ analogReference(INTERNAL);
+ }
+
+void loop() {
+ // read the analog in value:
+ for (int i = 0; i < numPins; i++) {
+ sensorValues[i] = analogRead(analogInPins[i]);
+ sensorVoltages[i] = sensorValues[i] * 2.56 / 1023.;
+ scaledSensorVoltages[i] = scaling[i] * sensorVoltages[i];
+ //Serial.print(sensorValues[i]);
+ //Serial.print(" ");
+ //Serial.print(sensorVoltages[i], 4);
+ //Serial.print(" ");
+ Serial.print(scaledSensorVoltages[i], 3);
+ Serial.print(" ");
+ }
+ Serial.println();
+
+ // wait 2 milliseconds before the next loop
+ // for the analog-to-digital converter to settle
+ // after the last reading:
+ delay(250);
+}