Compare commits
3 Commits
78f5edbd8e
...
12575174ec
| Author | SHA1 | Date | |
|---|---|---|---|
| 12575174ec | |||
| 1c8c8951a2 | |||
| ab61523800 |
@@ -14,3 +14,5 @@ board = esp32cam
|
||||
framework = arduino
|
||||
monitor_port = COM[13678]
|
||||
monitor_speed = 115200
|
||||
lib_deps =
|
||||
enviromonitor/BME280_Light@0.0.0-alpha+sha.600667f3a6
|
||||
|
||||
14
src/main.cpp
14
src/main.cpp
@@ -6,6 +6,11 @@
|
||||
#include "soc/rtc_cntl_reg.h" // Disable brownour problems
|
||||
#include "driver/rtc_io.h"
|
||||
#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 EEPROM_SIZE 1
|
||||
@@ -78,7 +83,8 @@ void free_image(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;
|
||||
}
|
||||
|
||||
@@ -172,6 +178,10 @@ camera_config_t config;
|
||||
}
|
||||
esp_camera_fb_return(fb);
|
||||
|
||||
Wire.begin(14,15);
|
||||
|
||||
BMESensor.begin();
|
||||
|
||||
}
|
||||
|
||||
uint8_t bytesIn;
|
||||
@@ -184,8 +194,8 @@ void loop() {
|
||||
if (b != -1) {
|
||||
switch (b) {
|
||||
case '\n':
|
||||
if (bytesIn && aLine[bytesIn-1] == '\0') break;
|
||||
case '\r':
|
||||
if (b == '\n' && bytesIn && aLine[bytesIn-1] == '\0') break;
|
||||
Serial.println();
|
||||
aLine[bytesIn] = '\0';
|
||||
execute(aLine);
|
||||
|
||||
Reference in New Issue
Block a user