Welcome to DFRobot: www.DFRobot.com.cn 36 / 49
1 x FireBeetle Board-ESP32
Enter code
Open Arduino IDE. You would better enter the code manually than open Course-> Item-5 to be
familiar with it.
Sample code:
#include <DFRobot_BME280.h>
#define SEA_LEVEL_PRESSURE 1013.25f
#define BME_CS D2
DFRobot_BME280 bme(BME_CS); //SPI
float temp, pa, hum, alt;
void setup() {
Serial.begin(115200);
// I2c default address is 0x77, if the need to change please modify bme.begin(Addr)
if (!bme.begin()) {
Serial.println("No sensor device found, check line or address!");
while (1);
}
Serial.println("-- BME280 DEMO --");
}
void loop() {
temp = bme.temperatureValue();
pa = bme.pressureValue();