Compare commits

...

3 Commits

Author SHA1 Message Date
12575174ec Merge branch 'master' of https://git.bh.ttx.sk/jaro/ESPSerialCAM 2021-01-29 08:25:54 +01:00
1c8c8951a2 fix newline 2021-01-29 08:24:31 +01:00
ab61523800 Pridanie BME280 2021-01-29 08:22:32 +01:00
2 changed files with 14 additions and 2 deletions

View File

@@ -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

View File

@@ -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);