| Ligne 63 : |
Ligne 63 : |
| | const int buttonPin = 2; | | const int buttonPin = 2; |
| | | | |
| − | // Raw Ranges: | + | // Plage brutes (Raw Ranges): |
| − | // initialize to mid-range and allow calibration to | + | // Initialiser la valeur à mi-échelle et permettre à la calibration de |
| − | // find the minimum and maximum for each axis | + | // trouver le minimum et le maximum pour chaque axe. |
| | int xRawMin = 512; | | int xRawMin = 512; |
| | int xRawMax = 512; | | int xRawMax = 512; |
| Ligne 75 : |
Ligne 75 : |
| | int zRawMax = 512; | | int zRawMax = 512; |
| | | | |
| − | // Take multiple samples to reduce noise | + | // Capturer plusieurs échantillons (valeurs) pour réduire l'effet du bruit |
| | const int sampleSize = 10; | | const int sampleSize = 10; |
| | | | |
| Ligne 117 : |
Ligne 117 : |
| | Serial.print(zRaw); | | Serial.print(zRaw); |
| | | | |
| − | // Convert raw values to 'milli-Gs" | + | // Convertir les valeurs brutes en 'milli-G' |
| | long xScaled = map(xRaw, xRawMin, xRawMax, -1000, 1000); | | long xScaled = map(xRaw, xRawMin, xRawMax, -1000, 1000); |
| | long yScaled = map(yRaw, yRawMin, yRawMax, -1000, 1000); | | long yScaled = map(yRaw, yRawMin, yRawMax, -1000, 1000); |
| | long zScaled = map(zRaw, zRawMin, zRawMax, -1000, 1000); | | long zScaled = map(zRaw, zRawMin, zRawMax, -1000, 1000); |
| | | | |
| − | // re-scale to fractional Gs | + | // re-convertir en valeur fractionnelle de G |
| | float xAccel = xScaled / 1000.0; | | float xAccel = xScaled / 1000.0; |
| | float yAccel = yScaled / 1000.0; | | float yAccel = yScaled / 1000.0; |
| Ligne 140 : |
Ligne 140 : |
| | | | |
| | // | | // |
| − | // Read "sampleSize" samples and report the average | + | // Lecture de "sampleSize" échantillons et retourner la moyenne |
| | // | | // |
| | int ReadAxis(int axisPin) | | int ReadAxis(int axisPin) |