Modifications

Sauter à la navigation Sauter à la recherche
261 octets ajoutés ,  26 mai 2013 à 21:03
aucun résumé de modification
Ligne 1 : Ligne 1 :  
{{TSL2561-NAV}}
 
{{TSL2561-NAV}}
 +
 +
== Installer les librairies ==
    
{{bloc-etroit|text=Pour utiliser ce senseur, il faut mettre en oeuvre beaucoup de fonctions mathématiques pour calculer les Lux. Il faut avouer que cela n'est pas franchement marrant. [http://mchobby.be/PrestaShop/TSL2561.pdf Vous pouvez prendre connaissance de ces transformations mathématiques dans la fiche technique] mais ce n'est ni vraiment intuitif, ni très éducatif - c'est juste la façon dont le senseur fonctionne. AdaFruit a donc écrit une librairie Arduino pour prendre soin de toute cette complexité à notre place.
 
{{bloc-etroit|text=Pour utiliser ce senseur, il faut mettre en oeuvre beaucoup de fonctions mathématiques pour calculer les Lux. Il faut avouer que cela n'est pas franchement marrant. [http://mchobby.be/PrestaShop/TSL2561.pdf Vous pouvez prendre connaissance de ces transformations mathématiques dans la fiche technique] mais ce n'est ni vraiment intuitif, ni très éducatif - c'est juste la façon dont le senseur fonctionne. AdaFruit a donc écrit une librairie Arduino pour prendre soin de toute cette complexité à notre place.
Ligne 10 : Ligne 12 :  
Redémarrez l'IDE Arduino
 
Redémarrez l'IDE Arduino
   −
Now you can run the '''File->Examples->Adafruit_TSL2561->sensorapi''' example program which will read and calculate the lux readings for you.
+
== Les exemples ==
 +
 
 +
Vous pouvez maintenant exécuter le programme d'exemple '''File->Examples->Adafruit_TSL2561->sensorapi''' qui lit et calcule le nombre de Lux pour vous.
   −
Open up the serial monitor at 9600 baud to see the measurements. Use a lamp or your hand to illuminate/shade the sensor to see the values change.
+
Ouvrez le moniteur série à 9600 baud pour voir les mesures. Utilisez une lampe (ou votre main) pour illuminer (ou ombrager) le senseur et voir la valeur changer.
    
[[Fichier:tsl2561-utiliser-01.png]]
 
[[Fichier:tsl2561-utiliser-01.png]]
   −
The library is fairly simple to use. The first line of code in the example is the 'constructor' where you can supply the '''I2C ADDR''' (in case you want to change it), and a unique ID to attach to this sensor (you can just leave this to the default value of 12345 for now). By modifying the I2C address we can have up to three TSL2561 sensors connected on the same board:
+
La librairie est vraiment très simple à utiliser. La première ligne du code d'exemple c'est le constructeur ('''constructor''') où il est possible d'indiquer l'adresse I2C '''I2C ADDR''' (dans le cas où vous voudriez la modifier), et un identificateur unique (ID) à attacher au senseur (vous pouvez laisser la valeur par défaut de 12345 pour le moment). Il est possible de brancher jusqu'à 3 senseur TSL2561 sur un même carte en modifiant l'adresse I2C:
   −
  <nowiki>// The address will be different depending on whether you leave
+
  <nowiki>// L'adresse sera différent selon que vous laissez
// the ADDR pin float (addr 0x39), or tie it to ground or vcc. In those cases
+
// la broche ADDR flottante (addr 0x39), ou raccordée sur la
// use TSL2561_ADDR_LOW (0x29) or TSL2561_ADDR_HIGH (0x49) respectively
+
// masse ou vcc. Dans ces cas, utilisez respectivement
 +
// TSL2561_ADDR_LOW (0x29) ou TSL2561_ADDR_HIGH (0x49) respectively
 
Adafruit_TSL2561 tsl = Adafruit_TSL2561(TSL2561_ADDR_FLOAT, 12345);</nowiki>
 
Adafruit_TSL2561 tsl = Adafruit_TSL2561(TSL2561_ADDR_FLOAT, 12345);</nowiki>
   −
Next up, you will want to configure the sensor with the '''gain''' and '''integration time'''.
+
Ensuite, vous aurez besoin de configurer le senseur avec '''gain''' et '''integration time''' (temps d'intégration).
   −
You can have either a gain of 0 (no extra gain, good in low light situations) or a gain of 16 which will boost the light considerably in dim situations.
+
Vous pouvez avoir soit un gain de 0 (pas de gain supplémentaire, excellent pour les situations de faible illumination) ou un gain de 16 which will boost the light considerably in dim situations.
    
You can also change the integration time, which is how long it will collect light data for. The longer the integration time, the more precision the sensor has when collecting light samples.
 
You can also change the integration time, which is how long it will collect light data for. The longer the integration time, the more precision the sensor has when collecting light samples.
30 072

modifications

Menu de navigation