added PINs to header.h

This commit is contained in:
Timo Volkmann 2020-06-28 20:45:06 +02:00
parent 82dfd49210
commit a2af5ef149
5 changed files with 30 additions and 9 deletions

View File

@ -12,8 +12,11 @@
platform = espressif32
board = az-delivery-devkit-v4
framework = arduino
monitor_speed = 115200
lib_deps =
439 #ID of Lightsensor library BH1750
19 #DHT sensor library
31 #Adafruit Unified Sensor
; AutoConnect@^1.1.7
; PubSubClient@^2.8

View File

@ -11,8 +11,6 @@ int readIndex = 0; // the index of the current reading
int total = 0; // the running total
int average = 0; // the average
int inputPin = 12;
void setupCapacitiveSoilMoistureSensor() {
for (int thisReading = 0; thisReading < numReadings; thisReading++) {
readings[thisReading] = 0;
@ -23,7 +21,7 @@ int loopCapacitiveSoilMoistureSensor() {
// subtract the last reading:
total = total - readings[readIndex];
// read from the sensor:
readings[readIndex] = analogRead(inputPin);
readings[readIndex] = analogRead(PIN_MS);
// add the reading to the total:
total = total + readings[readIndex];
// advance to the next position in the array:

View File

@ -12,8 +12,28 @@
#include <DHT.h>
#include <DHT_U.h>
// BH1750 LIGHT METER
// #define PIN_BH1750_SDA
// #define PIN_BH1750_SCL
// DHT11
#define PIN_DHT11 14
// MQ-135
#define PIN_MQ135_A 12
#define PIN_MQ135_D 13
// MOISTURE SENSOR
#define PIN_MS 27
// Ventil
#define PIN_VENTIL 26
// LED
#define PIN_LED_R 2
#define PIN_LED_G 0
#define PIN_LED_B 4
extern int meineVariable;
// moisture
extern void setupCapacitiveSoilMoistureSensor();

View File

@ -5,7 +5,7 @@
#include <header.h>
void setup() {
Serial.begin(9600);
Serial.begin(115200);
setupCapacitiveSoilMoistureSensor();
setupLightSensor();
setupTemperatureSensor();

View File

@ -1,6 +1,6 @@
#include <header.h>
#define DHTPIN 4
#define DHTPIN PIN_DHT11
#define DHTTYPE DHT11
@ -8,7 +8,7 @@
DHT_Unified dht(DHTPIN, DHTTYPE);
void setupTemperatureSensor() {
Serial.begin(9600);
// Serial.begin(9600);
dht.begin();
Serial.println(F("DHT11 Unified Sensor Ready"));
sensor_t sensor;