Modifications

Sauter à la navigation Sauter à la recherche
Ligne 24 : Ligne 24 :  
{{traduction}}
 
{{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.
+
Toutes les fonction qui lisent des valeurs prennent un argument {{fname|readMode}} en paramètre. Celui-ci spécifie le type de lecture qui est effectué. Plusieurs options sont possibles:
 +
* <font color="red">QTR_EMITTERS_OFF</font> indique que la lecture doit être effectuée sans allumer les LEDs infrarouge (IR), ce qui permet d'évaluer le niveau de lumière ambiante près du senseur;  
 +
* <font color="red">QTR_EMITTERS_ON</font> indique que les diodes émettrices doivent être activées durant la lecture, ce qui permet de lire la réflectance;  
 +
* <font color="red">QTR_EMITTERS_ON_AND_OFF</font> indique que la lecture doit être réaliser avec les deux états (allumé et éteint). La résultat retourné par l'option <font color="red">QTR_EMITTERS_ON_AND_OFF</font> correspond à '''allumé + max – éteint''', où "allumé" correspond à une lecture avec les LEDs IR allumée, "éteint" correspond à la lecture avec les LED IR éteinte et "max" la valeur maximale lue par le senseur.<br />Cette option permet de réduire la quantité d'interférence provenant des variations de lumière ambiante.  
 +
 
 +
{{ambox|text=A noter que le contrôle des LEDs émettrices ne fonctionnera que si vous avez spécifié une broche valide pour le contrôle des LEDs IR dans l'appel du constructeur.}}
    
{{underline|Exemple d'utilisation:}}
 
{{underline|Exemple d'utilisation:}}
29 917

modifications

Menu de navigation