Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
co2ampel
ampel-firmware
Commits
e7139c91
Commit
e7139c91
authored
Mar 22, 2022
by
Eric Duminil
Browse files
Finally!
parent
828696f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
ampel-firmware/co2_sensor.cpp
View file @
e7139c91
...
...
@@ -4,7 +4,6 @@
#include
"ntp.h"
#include
"led_effects.h"
#include
"sensor_console.h"
#include
<Wire.h>
#include
"src/lib/S8_UART/s8_uart.h"
...
...
@@ -18,7 +17,15 @@ namespace config {
const
bool
debug_sensor_states
=
false
;
// If true, log state transitions over serial console
}
#if defined(ESP8266)
// ???
#endif
#if defined(ESP32)
// For ESP32 : RX on GPIO17, TX on GPIO16
# define S8_UART_PORT 2
namespace
sensor
{
HardwareSerial
S8_serial
(
S8_UART_PORT
);
S8_UART
*
sensor_S8
;
S8_sensor
s8
;
uint16_t
co2
=
0
;
...
...
@@ -57,13 +64,6 @@ namespace sensor {
void
setAutoCalibration
(
int32_t
autoCalibration
);
void
initialize
()
{
#if defined(ESP8266)
Wire
.
begin
(
12
,
14
);
// ESP8266 - D6, D5;
#endif
#if defined(ESP32)
// For ESP32 : RX on GPIO17, TX on GPIO16
# define S8_UART_PORT 2
HardwareSerial
S8_serial
(
S8_UART_PORT
);
S8_serial
.
begin
(
S8_BAUDRATE
);
sensor_S8
=
new
S8_UART
(
S8_serial
);
#endif
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment