Browse Source

enable pir sensor pullup and fix dht library

master
interfisch 2 years ago
parent
commit
5f2e49f7a2
  1. 2
      platformio.ini
  2. 5
      src/main.cpp

2
platformio.ini

@ -18,6 +18,6 @@ monitor_speed = 115200 @@ -18,6 +18,6 @@ monitor_speed = 115200
lib_deps =
DHT sensor library@1.3.10
adafruit/DHT sensor library@1.3.10
BH1750@1.1.4
Homie@3.0.0

5
src/main.cpp

@ -3,7 +3,8 @@ @@ -3,7 +3,8 @@
#include "Arduino.h"
#include "DHT.h"
#include <Adafruit_Sensor.h> //required for dht library
#include <DHT.h>
#include <Wire.h>
#include <BH1750.h>
@ -54,7 +55,7 @@ void setup() { @@ -54,7 +55,7 @@ void setup() {
Serial.println();
Serial.println("Welcome");
pinMode(PIRPIN, INPUT);
pinMode(PIRPIN, INPUT_PULLUP);
Serial.println("initializing dht");
dht.begin(); // dht pins: 1=power, 2=data, 3=NC, 4=GND. 10k from data to power needed

Loading…
Cancel
Save