Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sensor System
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Institut für Informatik
QE Research Group
FORTE
Sensor System
Commits
ea1a336b
Verified
Commit
ea1a336b
authored
2 years ago
by
Zoe Michaela Dietmar Pfister
Browse files
Options
Downloads
Patches
Plain Diff
minor changes to make the sht85 initialisation work
parent
0824b630
No related branches found
No related tags found
4 merge requests
!39
Merge Develop into Main
,
!19
development into master
,
!17
Inital Host, initial Client
,
!13
Esp cam
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
client/ESPcam/src/main.cpp
+4
-2
4 additions, 2 deletions
client/ESPcam/src/main.cpp
client/libs/sht85/Sht85.cpp
+7
-2
7 additions, 2 deletions
client/libs/sht85/Sht85.cpp
client/libs/sht85/Sht85.hpp
+10
-7
10 additions, 7 deletions
client/libs/sht85/Sht85.hpp
with
21 additions
and
11 deletions
client/ESPcam/src/main.cpp
+
4
−
2
View file @
ea1a336b
...
...
@@ -89,8 +89,8 @@ void camera_configESPCamera()
camera_config
.
pin_pclk
=
PCLK_GPIO_NUM
;
camera_config
.
pin_vsync
=
VSYNC_GPIO_NUM
;
camera_config
.
pin_href
=
HREF_GPIO_NUM
;
camera_config
.
pin_s
s
cb_sda
=
SIOD_GPIO_NUM
;
camera_config
.
pin_s
s
cb_scl
=
SIOC_GPIO_NUM
;
camera_config
.
pin_s
c
cb_sda
=
SIOD_GPIO_NUM
;
camera_config
.
pin_s
c
cb_scl
=
SIOC_GPIO_NUM
;
camera_config
.
pin_pwdn
=
PWDN_GPIO_NUM
;
camera_config
.
pin_reset
=
RESET_GPIO_NUM
;
camera_config
.
xclk_freq_hz
=
20000000
;
...
...
@@ -165,6 +165,8 @@ void camera_configESPCamera()
// COLOR BAR PATTERN (0 = Disable , 1 = Enable)
s
->
set_colorbar
(
s
,
0
);
}
//SHTSensor sht(SHTSensor::SHT85); // I2C address: 0x44
void
initMicroSDCard
()
{
...
...
This diff is collapsed.
Click to expand it.
client/libs/sht85/Sht85.cpp
+
7
−
2
View file @
ea1a336b
...
...
@@ -3,7 +3,12 @@
//
#include
"Sht85.hpp"
void
Sht85
::
setup
()
{}
void
Sht85
::
setup
()
{
this
->
sht
=
SHTSensor
(
SHTSensor
::
SHT85
);
readData
();
}
void
Sht85
::
readSHT
()
{
...
...
@@ -27,7 +32,7 @@ out_data_sht85 Sht85::readData()
// initiate the SHT85 sensor
Serial
.
println
(
""
);
if
(
sht
.
init
())
{
if
(
sht
.
init
(
Wire
))
{
Serial
.
println
(
"SHT initialization successful"
);
}
else
{
Serial
.
println
(
"SHT initialization failed"
);
...
...
This diff is collapsed.
Click to expand it.
client/libs/sht85/Sht85.hpp
+
10
−
7
View file @
ea1a336b
...
...
@@ -6,18 +6,22 @@
#define ESPCAM_SHT85_HPP
#include
"ForteSensor.hpp"
#include
"MeasurementData.hpp"
#include
"Message.hpp"
#include
"Pinout.hpp"
#include
"MeasurementData.hpp"
#include
"RTClib.h"
// adafruit/RTClib @^2.1.1
#include
"SHTSensor.h"
// sensirion/arduino-sht@^1.2.2
#include
"SPI.h"
#include
"Wire.h"
#include
"esp_log.h"
#include
"Time.hpp"
#include
"esp_log.h"
#include
<Arduino.h>
#include
<Wire.h>
// Pin definitions for I2C (SHT85, RTC)
// This is different from the pins on the ESP32-C3-DevKit boards!
#define SDA 12
#define SCL 13
struct
out_data_sht85
{
float
temperature
=
0.0
;
float
humidity
=
0.0
;
...
...
@@ -31,7 +35,7 @@ class Sht85 : public ForteSensor<out_data_sht85> {
[[
nodiscard
]]
SensorInformation
getSensorInformation
()
const
override
;
private:
SHTSensor
sht
{
SHTSensor
::
SHT85
}
;
// I2C address: 0x44
SHTSensor
sht
;
// I2C address: 0x44
out_data_sht85
data
;
const
SensorInformation
sensorInformation
{
"SHT85"
,
Protocol
::
I2C
};
void
readSHT
();
...
...
@@ -39,9 +43,8 @@ class Sht85 : public ForteSensor<out_data_sht85> {
enum
class
MeasurementType
{
TEMPERATURE
,
HUMIDITY
};
// enum to string
std
::
map
<
MeasurementType
,
const
char
*>
measurementTypeToString
=
{
{
MeasurementType
::
TEMPERATURE
,
"TEMPERATURE"
},
{
MeasurementType
::
HUMIDITY
,
"HUMIDITY"
}};
std
::
map
<
MeasurementType
,
const
char
*>
measurementTypeToString
=
{{
MeasurementType
::
TEMPERATURE
,
"TEMPERATURE"
},
{
MeasurementType
::
HUMIDITY
,
"HUMIDITY"
}};
};
#endif // ESPCAM_SHT85_HPP
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment