Modifications

Sauter à la navigation Sauter à la recherche
Ligne 180 : Ligne 180 :  
}</syntaxhighlight>
 
}</syntaxhighlight>
   −
=== Lire les senseurs ===
+
=== Lectures avec les senseurs ===
This library gives you a number of different ways to read the sensors.
+
Cette bibliothèque offre différentes approches pour lire les senseurs:
 
+
# Vous pouvez obtenir les valeurs brutes des senseurs en utilisant la méthode '''read()''', qui reçoit un argument optionnel qui vous permet d'effectuer une lecture  avec les diodes émettrices éteintes (note: l'extinction des diodes émettrices est uniquement possible pour les senseurs QTR-8x).
# You can request raw sensor values using the '''read()''' method, which takes an optional argument that lets you perform the read with the IR emitters turned off (note that turning the emitters off is only supported by the QTR-8x reflectance sensor arrays).
+
# Vous pouvez obtenir les valeurs calibrées en utilisant la méthode '''readCalibrated()''', qui dispose également d'un argument optionnel vous permetant de faire une lecture avec les LED IR éteintes. Les valeurs calibrées ont toujours une valeur située entre 0 à 1000, 0 étant considérée comme la plus réfléchissante (ex: la plus blanche) que la surface la plus réfléchissante rencontrée durant la phase de calibration -ET- 1000 étant la surtface la moins réfléchissante (ex: plus noir) que la surface la moins réfléchissante rencontrée durant la phase de calibration.
# You can request calibrated sensor values using the '''readCalibrated()''' method, which also takes an optional argument that lets you perform the read with the IR emitters turned off. Calibrated sensor values will always range from 0 to 1000, with 0 being as or more reflective (i.e. whiter) than the most reflective surface encountered during calibration, and 1000 being as or less reflective (i.e. blacker) than the least reflective surface encountered during calibration.
   
# For line-detection applications, you can request the line location using the '''readLine()''' method, which takes as optional parameters a boolean that indicates whether the line is white on a black background or black on a white background, and a boolean that indicates whether the IR emitters should be on or off during the measurement. '''readLine()''' provides calibrated values for each sensor and returns an integer that tells you where it thinks the line is. If you are using N sensors, a returned value of 0 means it thinks the line is on or to the outside of sensor 0, and a returned value of 1000 * (N-1) means it thinks the line is on or to the outside of sensor N-1. As you slide your sensors across the line, the line position will change monotonically from 0 to 1000 * (N-1), or vice versa. This line-position value can be used for closed-loop PID control.
 
# For line-detection applications, you can request the line location using the '''readLine()''' method, which takes as optional parameters a boolean that indicates whether the line is white on a black background or black on a white background, and a boolean that indicates whether the IR emitters should be on or off during the measurement. '''readLine()''' provides calibrated values for each sensor and returns an integer that tells you where it thinks the line is. If you are using N sensors, a returned value of 0 means it thinks the line is on or to the outside of sensor 0, and a returned value of 1000 * (N-1) means it thinks the line is on or to the outside of sensor N-1. As you slide your sensors across the line, the line position will change monotonically from 0 to 1000 * (N-1), or vice versa. This line-position value can be used for closed-loop PID control.
  
29 917

modifications

Menu de navigation