int potValeur = 0; //variable ou on stock la valeur du potentiomètre const int potPin = A0; float tension = 0; //variable où on stock le voltage, la tension unsigned long tempsMicros; unsigned long tempsPrecedent =0; const long intervalMicros =2000; //temps unsigned long tempsDepart = 0; void setup() { Serial.begin(115200); Serial.println();// initialisation de la communication serial Serial.println("OK"); delay(1000); Serial.println("Début Acquisition, ne pas bouger"); tempsDepart = micros(); } void loop() { tempsMicros = micros(); if (tempsMicros - tempsPrecedent >= intervalMicros) { tempsPrecedent = tempsMicros; potValeur = analogRead(potPin); tension = potValeur * (5.00 / 1023.00); Serial.print(tempsMicros - tempsDepart); // temps relatif en µs Serial.print(","); Serial.print(potValeur); Serial.print(","); Serial.println(tension); } }