mirror of
https://github.com/Eigenbaukombinat/ebk_co2ampel.git
synced 2024-11-24 23:30:21 +01:00
move settings to config file
This commit is contained in:
parent
c26370f4f1
commit
8584ca11a5
3 changed files with 36 additions and 28 deletions
|
@ -48,6 +48,10 @@ Alternativ kann die Datei [unhb-co2-ampel-v0.5.bin](https://git.unhb.de/smash/eb
|
||||||
|
|
||||||
auf dem Mikrocontroller programmiert werden.
|
auf dem Mikrocontroller programmiert werden.
|
||||||
|
|
||||||
|
## Konfiguration
|
||||||
|
|
||||||
|
Wir haben die konfiguration in `include/config.h` ausgelagert.
|
||||||
|
|
||||||
## Wiring
|
## Wiring
|
||||||
|
|
||||||
bild: todo
|
bild: todo
|
||||||
|
|
30
include/config.h
Normal file
30
include/config.h
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
// Grenzwerte für die CO2 Werte für grün und gelb, alles überhalb davon bedeutet rot
|
||||||
|
#define GREEN_CO2 800
|
||||||
|
#define YELLOW_CO2 1000
|
||||||
|
|
||||||
|
// CO2 Mess-Intervall in Milisekunden
|
||||||
|
#define CO2_INTERVAL 15*1000
|
||||||
|
// Display Update-Intervall in Milisekunden
|
||||||
|
#define DISPLAY_INTERVAL 2500
|
||||||
|
// Dauer der Kalibrierungsphase in Milisekunden
|
||||||
|
#define CAL_INTERVAL 180*1000
|
||||||
|
|
||||||
|
// Boot-Mode Konstanten
|
||||||
|
#define BOOT_NORMAL 42
|
||||||
|
#define BOOT_CALIBRATE 23
|
||||||
|
#define BOOT_UNKNOWN 69
|
||||||
|
|
||||||
|
// Pins für den MH-Z19b
|
||||||
|
#define RX_PIN 16
|
||||||
|
#define TX_PIN 17
|
||||||
|
|
||||||
|
// Pins für das SD1306 OLED-Display
|
||||||
|
#define SDA_PIN 21
|
||||||
|
#define SCL_PIN 22
|
||||||
|
|
||||||
|
// Pin für den LED-Ring
|
||||||
|
#define LED_PIN 4
|
||||||
|
|
||||||
|
// Anzahl der angeschlossenen LEDs am Ring
|
||||||
|
#define NUMPIXELS 8
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#include "config.h"
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include "MHZ19.h"
|
#include "MHZ19.h"
|
||||||
#include "SSD1306Wire.h"
|
#include "SSD1306Wire.h"
|
||||||
|
@ -6,35 +7,8 @@
|
||||||
#include <Preferences.h>
|
#include <Preferences.h>
|
||||||
#include "uptime_formatter.h"
|
#include "uptime_formatter.h"
|
||||||
|
|
||||||
// Grenzwerte für die CO2 Werte für grün und gelb, alles überhalb davon bedeutet rot
|
#endif
|
||||||
#define GREEN_CO2 800
|
|
||||||
#define YELLOW_CO2 1000
|
|
||||||
|
|
||||||
// CO2 Mess-Intervall in Milisekunden
|
|
||||||
#define CO2_INTERVAL 15*1000
|
|
||||||
// Display Update-Intervall in Milisekunden
|
|
||||||
#define DISPLAY_INTERVAL 2500
|
|
||||||
// Dauer der Kalibrierungsphase in Milisekunden
|
|
||||||
#define CAL_INTERVAL 180*1000
|
|
||||||
|
|
||||||
// Boot-Mode Konstanten
|
|
||||||
#define BOOT_NORMAL 42
|
|
||||||
#define BOOT_CALIBRATE 23
|
|
||||||
#define BOOT_UNKNOWN 69
|
|
||||||
|
|
||||||
// Pins für den MH-Z19b
|
|
||||||
#define RX_PIN 16
|
|
||||||
#define TX_PIN 17
|
|
||||||
|
|
||||||
// Pins für das SD1306 OLED-Display
|
|
||||||
#define SDA_PIN 21
|
|
||||||
#define SCL_PIN 22
|
|
||||||
|
|
||||||
// Pin für den LED-Ring
|
|
||||||
#define LED_PIN 4
|
|
||||||
|
|
||||||
// Anzahl der angeschlossenen LEDs am Ring
|
|
||||||
#define NUMPIXELS 8
|
|
||||||
|
|
||||||
Preferences preferences;
|
Preferences preferences;
|
||||||
MHZ19 myMHZ19;
|
MHZ19 myMHZ19;
|
||||||
|
|
Loading…
Reference in a new issue