Modifications

Sauter à la navigation Sauter à la recherche
253 octets ajoutés ,  20 avril 2013 à 13:05
aucun résumé de modification
Ligne 3 : Ligne 3 :  
{{traduction}}
 
{{traduction}}
   −
{{bloc-etroit|text=To use this sensor and calculate the altitude and barometric pressure, there's a lot of very hairy and unpleasant math. You can check out the math in the datasheet but really, its not intuitive or educational - its just how the sensor works. So we took care of all the icky math and wrapped it up into a nice Arduino library. You can [http://learn.adafruit.com/bmp085/downloads download the library from github]
+
{{bloc-etroit|text=Il faut utiliser beaucoup d'épouvantables opérations mathématiques déplaisantes pour utiliser ce senseur et calculer l'altitude ainsi que la pression barométrique. Vous pouvez consulter la fiche technique mais à vrai dire, ce n'est pas très intuitif ni très pédagogique - c'est juste la façon dont le senseur fonctionne.  
 +
 
 +
Pour prendre en charge toute cette complexité mathématique, AdaFruit dispose d'une librairie Arduino. Vous pouvez [http://learn.adafruit.com/bmp085/downloads télécharger cette librairie sur le Github d'AdaFruit]
    
Pour installer la librairie:
 
Pour installer la librairie:
* To download the library click the DOWNLOADS button in the top right corner.
+
* Cliquez sur le bouton '''DOWNLOADS''' en haut à droite.
* rename the uncompressed folder '''Adafruit_BMP085'''. Check that the '''Adafruit_BMP085''' folder contains Adafruit_BMP085.cpp and '''Adafruit_BMP085.h'''
+
* Renommez le répertoire décompressé en '''Adafruit_BMP085'''.  
* Place the BMP085 library folder yourarduinosketchfolder/libraries/ folder. You may need to create the libraries subfolder if its your first library.  
+
* Vérifiez que le répertoire Adafruit_BMP085 contienne bien les fichiers '''Adafruit_BMP085.cpp''' et '''Adafruit_BMP085.h'''
* Restart the IDE.
+
* Placez la librairie BMP085 dans le répertoire '''répetoire_des_sketch_arduino/libraries/'''.<br />Vous pourriez avoir besoin de créer un sous répertoire ''libraries'' si c'est votre première librairie.  
 +
* Redémarrez votre environnement Arduino IDE.
   −
Now you can run this first example sketch.
+
Maintenant, vous pouvez compiler et télécharger ce premier sketch d'exemple.
 
}}
 
}}
   −
  <nowiki>   #include "Wire.h"
+
  <nowiki>#include "Wire.h"
    #include "Adafruit_BMP085.h"
+
#include "Adafruit_BMP085.h"
    Adafruit_BMP085 bmp;
+
 
    void setup() {
+
Adafruit_BMP085 bmp;
 +
 
 +
void setup() {
 
     Serial.begin(9600);
 
     Serial.begin(9600);
 
     bmp.begin();
 
     bmp.begin();
    }
+
}
    void loop() {
+
 
 +
void loop() {
 
     Serial.print("Temperature = ");
 
     Serial.print("Temperature = ");
 
     Serial.print(bmp.readTemperature());
 
     Serial.print(bmp.readTemperature());
Ligne 30 : Ligne 36 :  
     Serial.println();
 
     Serial.println();
 
     delay(500);
 
     delay(500);
    }</nowiki>
+
}</nowiki>
    
Then open up the serial monitor at 9600 baud. The sketch will continuously print out the temperature in '''°C''' and pressure in '''Pa''' (Pascals). You can test that the sensor is measuring variations in temperature and pressure by placing your fingertip over the open port hole in the top of the sensor. The temperature and pressure will increase as you can see here:  
 
Then open up the serial monitor at 9600 baud. The sketch will continuously print out the temperature in '''°C''' and pressure in '''Pa''' (Pascals). You can test that the sensor is measuring variations in temperature and pressure by placing your fingertip over the open port hole in the top of the sensor. The temperature and pressure will increase as you can see here:  
29 918

modifications

Menu de navigation