Update nano_c_mk1.ino

This commit is contained in:
Eric Yu 2023-01-31 02:18:13 -08:00 committed by GitHub
parent 426e54507a
commit e7825fbca4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 8 deletions

View File

@ -19,9 +19,12 @@ 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
for (i = 0; i < ADS_MAX; i++) {
adcReadings[i] = adc.readADC_SingleEnded(i) * VOLTAGE_RANGE / CONST_I2C;
}
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
Serial.print(adcReadings[i]);
if (i != ADS_MAX - 1) {
Serial.print(", ");
}