diff --git a/nano_c_mk1/nano_c_mk1.ino b/nano_c_mk1/nano_c_mk1.ino index 2794fa6..19a254c 100644 --- a/nano_c_mk1/nano_c_mk1.ino +++ b/nano_c_mk1/nano_c_mk1.ino @@ -19,14 +19,17 @@ void setup() { void loop() { // TODO: The current reading is too slow for even the arduino's own ide's grapher cannot parse the data in time if (millis() - currTime >= WAIT_TIME) { // non-blocking time delay - Serial.print("["); - for (i = 0; i < ADS_MAX; i++) { - Serial.print(adc.readADC_SingleEnded(i) * VOLTAGE_RANGE / CONST_I2C); // a raw to voltage conversion based from the library's method - if (i != ADS_MAX - 1) { - Serial.print(", "); + for (i = 0; i < ADS_MAX; i++) { + adcReadings[i] = adc.readADC_SingleEnded(i) * VOLTAGE_RANGE / CONST_I2C; } - } - Serial.println("]"); - currTime = millis(); + Serial.print("["); + for (i = 0; i < ADS_MAX; i++) { + Serial.print(adcReadings[i]); + if (i != ADS_MAX - 1) { + Serial.print(", "); + } + } + Serial.println("]"); + currTime = millis(); } }