Pridanie BME280
This commit is contained in:
@@ -14,3 +14,5 @@ board = esp32cam
|
|||||||
framework = arduino
|
framework = arduino
|
||||||
monitor_port = COM[13678]
|
monitor_port = COM[13678]
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
|
lib_deps =
|
||||||
|
enviromonitor/BME280_Light@0.0.0-alpha+sha.600667f3a6
|
||||||
|
|||||||
12
src/main.cpp
12
src/main.cpp
@@ -6,6 +6,11 @@
|
|||||||
#include "soc/rtc_cntl_reg.h" // Disable brownour problems
|
#include "soc/rtc_cntl_reg.h" // Disable brownour problems
|
||||||
#include "driver/rtc_io.h"
|
#include "driver/rtc_io.h"
|
||||||
#include <EEPROM.h> // read and write from flash memory
|
#include <EEPROM.h> // read and write from flash memory
|
||||||
|
#include <Wire.h>
|
||||||
|
#include <BME280_t.h> // import BME280 template library
|
||||||
|
|
||||||
|
char bufout[10];
|
||||||
|
BME280<> BMESensor;
|
||||||
|
|
||||||
// define the number of bytes you want to access
|
// define the number of bytes you want to access
|
||||||
#define EEPROM_SIZE 1
|
#define EEPROM_SIZE 1
|
||||||
@@ -78,7 +83,8 @@ void free_image(char *aLine)
|
|||||||
|
|
||||||
void print_measurement(char *aLine)
|
void print_measurement(char *aLine)
|
||||||
{
|
{
|
||||||
Serial.printf("temperature=%.2f humidity=%.2f pressure=%.2f\n",temperatureRead(),60.2,903.45);
|
BMESensor.refresh(); // read current sensor dat
|
||||||
|
Serial.printf("temperature=%.2f humidity=%.2f pressure=%.2f\n",BMESensor.temperature,BMESensor.humidity,BMESensor.pressure / 100.0F);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,6 +178,10 @@ camera_config_t config;
|
|||||||
}
|
}
|
||||||
esp_camera_fb_return(fb);
|
esp_camera_fb_return(fb);
|
||||||
|
|
||||||
|
Wire.begin(14,15);
|
||||||
|
|
||||||
|
BMESensor.begin();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t bytesIn;
|
uint8_t bytesIn;
|
||||||
|
|||||||
Reference in New Issue
Block a user