Modifications

Sauter à la navigation Sauter à la recherche
143 octets ajoutés ,  20 mai 2015 à 18:31
Ligne 79 : Ligne 79 :  
Ensuite, une instance de la classe MCP9808 est créé avec l'instruction{{fname|1=sensor = MCP9808.MCP9808()}}.   
 
Ensuite, une instance de la classe MCP9808 est créé avec l'instruction{{fname|1=sensor = MCP9808.MCP9808()}}.   
   −
Notice that if nothing is passed in to the initializer function the library will pick a default I2C device address (0x18) and bus number. If you need to specify the I2C address or bus number you can do so by specifying them as optional parameters in the MCP9808 initializer.
+
Notez que si aucun argument est passé à la fonction d'initialisation, la bibliothèque utilise l'adresse I2C par défaut (0x18) et le numéro de bus par défaut. Si vous avez besoin de spécifier une autre adresse (ou autre numéro de bus) vous pouvez le faire en passant des valeurs pour les paramètres optionnels.
    
  <nowiki># Initialize communication with the sensor.
 
  <nowiki># Initialize communication with the sensor.
 
sensor.begin()</nowiki>
 
sensor.begin()</nowiki>
   −
After creating the MCP9808 class instance the '''begin()''' function is called to initialize communication with the device.   
+
Après la création de l'instance de la classe MCP9808, la fonction {{fname|begin()}} est appelée pour initialiser la communication avec le périphérique/senseur.   
    
  <nowiki># Loop printing measurements every second.
 
  <nowiki># Loop printing measurements every second.
Ligne 93 : Ligne 93 :  
     time.sleep(1.0)</nowiki>
 
     time.sleep(1.0)</nowiki>
   −
Finally the example enters a loop where it reads the sensor's temperature and prints it out every second. The important thing to see is the temperature measurement function '''readTempC()'''The '''readTempC()''' function will read the sensor temperature and return its value in Celsius.
+
Pour finir, l'exemple entre dans une boucle infinie qui lit la température du senseur, affiche la valeur puis attend une seconde. La chose important à voir est la mesure de la température à l'aide de la fonction {{fname|readTempC()}}La fonction {{fname|readTempC()}} la lire la température du senseur et retourne sa valeur en degré Celsius.
    
That's all there is to use the MCP9808 Python library!  If you run into issues or wish to contribute, [https://github.com/adafruit/Adafruit_Python_MCP9808 vous pouvez également suivre les évolutions de la bibliothèque sur la page Github].
 
That's all there is to use the MCP9808 Python library!  If you run into issues or wish to contribute, [https://github.com/adafruit/Adafruit_Python_MCP9808 vous pouvez également suivre les évolutions de la bibliothèque sur la page Github].
    
{{Rasp-Hack-MCP9808-TRAILER}}
 
{{Rasp-Hack-MCP9808-TRAILER}}
29 918

modifications

Menu de navigation