'Arduino read i2c Sensor data(BME680)
I am trying to read the temperature from a bme680(Datasheet: https://cdn-shop.adafruit.com/product-files/3660/BME680.pdf), just with i2c and the Arduino wire library. I am reading already something, so the sensor should be recognized. What I am reading with my code:enter image description here Now my problem is, that I don't know how to only read the temperature. I would be honored if somebody could give me a hint or help me.
#include "Wire.h"
#define SENSOR 0x76
#define SOFTRESET 0xE0
String c;
void setup() {
Serial.begin(115200);
delay(1000);
Serial.println("Start");
//Wire.setClock(400000); // I2C-Bus Init
Wire.begin();
Wire.beginTransmission(SENSOR); // Softreset (Kommando)
Wire.write(SOFTRESET);
Wire.endTransmission();
delay(15);
}
void loop() {
delay(1000);
Wire.requestFrom(SENSOR,1); // Temperatur auslesen
while(Wire.available()) // umspeichern
{
c = Wire.read();
Serial.print(c);
}
Serial.printf("\n");
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
