"Hello
I am really giving up on this soon. I hate coding, i just like the hardware
I am trying to get the I2c function active on my ESP32 but NOTHING seems to work. I have checked several libraries and sketches but none of them explains how to read temp + humidity and then sending this to a virtual pin in blynk.
The project all-in-all should be something like this:
Read temp + hum on SHT21 (SDA-PIN21, SCL-PIN22)
Read motionsensor
4xrelay card
1 = 12vdc Fans, activated either by button (done) or if temp>22C
2 = 12vdc Fans toilet, activated by button if crisis occurs
= DONE
3 = 12vdc LED strip inside ceilning, activated by button = DONE
4 = 12vdc LED strip outside, activated by button = DONE
Next step:
If Motionsensor = activated, then start a videorecording and save to SD Card for approx 5 minutes.
Now my code is really f***ed up since i have tried so many things, so please help me sort this out
Hardware:
ESP32 Devkit 1
SHT21 sensor
Smartphone = Huawei P30 Pro, ālatest versionā
Blynk Server
Blynk library version = I have no idea.
Camera = not bought yet
SD Card reader
Wifidetails and blynk auth is replaced with *****
=========================================
#define SEALEVELPRESSURE_HPA (1013.25)
#define BLYNK_PRINT Serial
#include <SimpleTimer.h>
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include <Wire.h>
#include "SHT21.h"
SHT21 SHT21;
void sendSensor()
{
float h = SHT21_H.readHumidity();
float t = SHT21_H.readTemperature();
Blynk.virtualWrite(V5, h);
Blynk.virtualWrite(V6, t);
}
void setup()
{
SHT21.begin();
Serial.begin(9600);
// You should get Auth Token in the Blynk App.
char auth[] = "*********";//Enter your Auth token here
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "*****"; //SSID
char pass[] = "*****";//Password
//Blynk.begin(auth, ssid, pass);
Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 8080);
}
void loop()
{
Blynk.run(); // Initiates Blynk
}