2. Installation
Um den Sensor mit dem Arduino verwenden zu können, müssen Sie zu-
nächst die benötigte Bibliothek
Ordner und speichern Sie diesen in Ihrem Libraries Ordner. Dieser befin-
det sich meistens unter Dokumente → Arduino → Libraries.
3. Programmbeispiel
/***************************************************************************
This is a library for the BMP280 humidity, temperature & pressure sensor
Designed specifically to work with the Adafruit BMEP280 Breakout
----> http://www.adafruit.com/products/2651
These sensors use I2C or SPI to communicate, 2 or 4 pins are required
to interface.
Adafruit invests time and resources providing this open source code,
please support Adafruit andopen-source hardware by purchasing products
from Adafruit!
Written by Limor Fried & Kevin Townsend for Adafruit Industries.
BSD license, all text above must be included in any redistribution
***************************************************************************/
#include <Wire.h>
#include <SPI.h>
#include <Adafruit_BMP280.h>
#define BMP_SCK 13
#define BMP_MISO 12
#define BMP_MOSI 11
#define BMP_CS 10
Adafruit_BMP280 bmp;
//Adafruit_BMP280 bmp(BMP_CS); // hardware SPI
//Adafruit_BMP280 bmp(BMP_CS, BMP_MOSI, BMP_MISO,
void
setup() {
Serial.begin(9600);
Serial.println(F("BMP280 test"));
if
(!bmp.begin()) {
Serial.println(F("Could not find a valid BMP280 sensor, check wiring!"));
while
(1);
}
}
hier
herunterladen. Entpacken Sie den
// I2C
www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
BMP_SCK);