26 lines
539 B
Arduino
26 lines
539 B
Arduino
|
#define WAIT_TIME 1000UL
|
||
|
|
||
|
int pins[] = {A0, A1, A2, A3, A4, A5};
|
||
|
int i;
|
||
|
unsigned long currTime; // non-blocking timer
|
||
|
|
||
|
void setup() {
|
||
|
Serial.begin(9600);
|
||
|
currTime = millis();
|
||
|
}
|
||
|
|
||
|
void loop() {
|
||
|
if (millis() - currTime >= WAIT_TIME) { // non-blocking time delay
|
||
|
// Serial.println();
|
||
|
Serial.print("[");
|
||
|
for (i = 0; i < sizeof(pins)/2; i++) {
|
||
|
Serial.print(analogRead(pins[i]));
|
||
|
if (i != sizeof(pins)/2 - 1) {
|
||
|
Serial.print(", ");
|
||
|
}
|
||
|
}
|
||
|
Serial.println("]");
|
||
|
currTime = millis();
|
||
|
}
|
||
|
|
||
|
}
|