Modifications

Sauter à la navigation Sauter à la recherche
Ligne 126 : Ligne 126 :     
=== QTRSensorsAnalog() - constructeur ===
 
=== QTRSensorsAnalog() - constructeur ===
{{traduction}}
  −
   
<syntaxhighlight lang="C">Constructor: QTRSensorsAnalog()</syntaxhighlight>
 
<syntaxhighlight lang="C">Constructor: QTRSensorsAnalog()</syntaxhighlight>
   −
This version of the constructor performs no initialization. If this constructor is used, the user must call init() before using the methods in this class.
+
Cette version du constructeur -destiné au senseurs de type analogique- n'effectue aucune initialisation. Si ce constructeur est utilisé, l'utilisateur doit appeler la méthode init() avant l'utilisation des autres méthodes de cette classe.
    
<syntaxhighlight lang="C">Constructor: QTRSensorsAnalog(unsigned char* analogPins, unsigned char numSensors, unsigned char numSamplesPerSensor = 4, unsigned char emitterPin = QTR_NO_EMITTER_PIN)</syntaxhighlight>
 
<syntaxhighlight lang="C">Constructor: QTRSensorsAnalog(unsigned char* analogPins, unsigned char numSensors, unsigned char numSamplesPerSensor = 4, unsigned char emitterPin = QTR_NO_EMITTER_PIN)</syntaxhighlight>
   −
This constructor just calls {{fname|init()}}, below.
+
Ce constructeur fait juste un appel à {{fname|init()}}, tel que détaillé ci-dessous.
    
<syntaxhighlight lang="C">void init(unsigned char* analogPins, unsigned char numSensors, unsigned char numSamplesPerSensor = 4, unsigned char emitterPin = QTR_NO_EMITTER_PIN)</syntaxhighlight>
 
<syntaxhighlight lang="C">void init(unsigned char* analogPins, unsigned char numSensors, unsigned char numSamplesPerSensor = 4, unsigned char emitterPin = QTR_NO_EMITTER_PIN)</syntaxhighlight>
   −
Initializes a QTR-A (analog) sensor array.
+
Initialise un ensemble de senseur QTR-A (analogique).
 
+
* '''pins''' est un tableau de broches qui contient les broches d'entrées analogiques utilisées pour chaque senseur. Par exemple, si les pins sont {0, 1, 7}, le premier senseur est l'entrée analogique 0, le deuxième senseur est l'entrée analogique 1 et le troisième senser est l'entrée analogique 7.
* The array ''pins'' should contain the Arduino analog input pin number for each sensor. For example, if pins is {0, 1, 7}, sensor 1 is on analog input 0, sensor 2 is on analog input 1, and sensor 3 is on analog input 7.
+
* '''numSensors''' indique la longueur du tableau ''analogPins'' (le nombre de senseurs QTR-A utilisés). La valeur de ''numSensors'' ne peut pas dépasser 16.
* ''numSensors'' specifies the length of the analogPins array (the number of QTR-A sensors you are using). numSensors must be no greater than 16.
+
* '''numSamplesPerSensor''' indique le nombre d'échantillonnages 10-bit à réaliser par canal/senseur lors de chaque lecture (échantillons dont la bibliothèque fait une moyenne). Le nombre total de conversion analogique-vers-digital réalisés est également au numSensors * numSamplesPerSensor.<br />accroître ce paramètre améliore la suppression du bruit mais au coût d'un temps de capture plus important (accroissement du temps d'échantillonnage total). Ce paramètre ne peut pas excéder la valeur de 64. Pololu recommande la valeur 4.
* ''numSamplesPerSensor'' indicates the number of 10-bit analog samples to average per channel (per sensor) for each reading. The total number of analog-to-digital conversions performed will be equal to numSensors times numSamplesPerSensor. Increasing this parameter increases noise suppression at the cost of sample rate. This parameter must not exceed 64. Recommended value: 4.
+
* '''emitterPin''' est la broche digitale Arduino qui permet de contrôler les LEDs infrarouges (allumées ou éteintes). Cette broches est optionnelle et elle n'existe que sur les modèles de QTR 8A et QTR 8RC des senseurs de ligne. Si une broche valide est spécifiée, alors les diodes infrarouge ne seront allumées que durant la lecture. Si la valeur {{fname|QTR_NO_EMITTER_PIN}} (255) est utilisée pour ce paramètre alors vous pouvez laisser la broches des diode Infrarouge déconnectée et les LEDs seront constamment alimentées.
* ''emitterPin'' is the Arduino digital pin that controls whether the IR LEDs are on or off. This pin is optional and only exists on the 8A and 8RC QTR sensor arrays. If a valid pin is specified, the emitters will only be turned on during a reading. If the value QTR_NO_EMITTER_PIN (255) is used, you can leave the emitter pin disconnected and the IR emitters will always be on.
      
== Note d'usage ==
 
== Note d'usage ==
 
=== Calibration ===
 
=== Calibration ===
 +
{{traduction}}
 
This library allows you to use the '''calibrate()''' method to easily calibrate your sensors for the particular conditions it will encounter. Calibrating your sensors can lead to substantially more reliable sensor readings, which in turn can help simplify your code since. As such, we recommend you build a calibration phase into your application’s initialization routine. This can be as simple as a fixed duration over which you repeated call the '''calibrate()''' method. During this calibration phase, you will need to expose each of your reflectance sensors to the lightest and darkest readings they will encounter. For example, if you have made a line follower, you will want to slide it across the line during the calibration phase so the each sensor can get a reading of how dark the line is and how light the ground is. A sample calibration routine would be:
 
This library allows you to use the '''calibrate()''' method to easily calibrate your sensors for the particular conditions it will encounter. Calibrating your sensors can lead to substantially more reliable sensor readings, which in turn can help simplify your code since. As such, we recommend you build a calibration phase into your application’s initialization routine. This can be as simple as a fixed duration over which you repeated call the '''calibrate()''' method. During this calibration phase, you will need to expose each of your reflectance sensors to the lightest and darkest readings they will encounter. For example, if you have made a line follower, you will want to slide it across the line during the calibration phase so the each sensor can get a reading of how dark the line is and how light the ground is. A sample calibration routine would be:
  
29 836

modifications

Menu de navigation