Modifications

Sauter à la navigation Sauter à la recherche
Ligne 20 : Ligne 20 :  
<syntaxhighlight lang="C">void read(unsigned int *sensorValues, unsigned char readMode = QTR_EMITTERS_ON)</syntaxhighlight>
 
<syntaxhighlight lang="C">void read(unsigned int *sensorValues, unsigned char readMode = QTR_EMITTERS_ON)</syntaxhighlight>
   −
Reads the raw sensor values into an array. There '''MUST''' be space for as many values as there were sensors specified in the constructor. The values returned are a measure of the reflectance in units that depend on the type of sensor being used, with higher values corresponding to lower reflectance (a black surface or a void). QTR-xA sensors will return a raw value between 0 and 1023. QTR-xRC sensors will return a raw value between 0 and the timeout argument (in units of microseconds) provided in the constructor (which defaults to 2000).
+
Lit les valeurs brutes des senseurs dans un tableau (''array''). Le tableau '''DOIT''' avoir la taille correspondant aux valeurs des senseurs spécifiés dans le constructeur. Les valeurs retournées sont une mesure de la réflectance (facteur de réflexion) en unités qui dépend du type de senseur utilisé. Une valeur plus élevée indique une réflectance inférieure (une surface noire ou le vide). Les senseurs QTR-xA retournera une valeur brute entre 0 et 1023. Les senseurs QTR-xRC retournera une valeur entre 0 et un argument ''timeout'' (exprimé en microsecondes, indiqué dans le constructeur avec 2000 par défaut).
 +
 
 +
{{traduction}}
    
The functions that read values from the sensors all take an argument readMode, which specifies the kind of read that will be performed. Several options are defined: <font color="red">QTR_EMITTERS_OFF</font> specifies that the reading should be made without turning on the infrared (IR) emitters, in which case the reading represents ambient light levels near the sensor; <font color="red">QTR_EMITTERS_ON</font> specifies that the emitters should be turned on for the reading, which results in a measure of reflectance; and <font color="red">QTR_EMITTERS_ON_AND_OFF</font> specifies that a reading should be made in both the on and off states. The values returned when the <font color="red">QTR_EMITTERS_ON_AND_OFF</font> option is used are given by '''on + max – off''', where on is the reading with the emitters on, off is the reading with the emitters off, and '''max''' is the maximum sensor reading. This option can reduce the amount of interference from uneven ambient lighting. Note that emitter control will only work if you specify a valid emitter pin in the constructor.
 
The functions that read values from the sensors all take an argument readMode, which specifies the kind of read that will be performed. Several options are defined: <font color="red">QTR_EMITTERS_OFF</font> specifies that the reading should be made without turning on the infrared (IR) emitters, in which case the reading represents ambient light levels near the sensor; <font color="red">QTR_EMITTERS_ON</font> specifies that the emitters should be turned on for the reading, which results in a measure of reflectance; and <font color="red">QTR_EMITTERS_ON_AND_OFF</font> specifies that a reading should be made in both the on and off states. The values returned when the <font color="red">QTR_EMITTERS_ON_AND_OFF</font> option is used are given by '''on + max – off''', where on is the reading with the emitters on, off is the reading with the emitters off, and '''max''' is the maximum sensor reading. This option can reduce the amount of interference from uneven ambient lighting. Note that emitter control will only work if you specify a valid emitter pin in the constructor.
29 917

modifications

Menu de navigation