change dht pin to 2
This commit is contained in:
parent
7d04e9e8c1
commit
3239790d2a
|
@ -15,7 +15,7 @@
|
|||
|
||||
#define BOARD "ESP-32"
|
||||
#define MQPIN 34
|
||||
#define DHTPIN 4
|
||||
#define DHTPIN 2
|
||||
#define LAMPPIN 26
|
||||
#define FANPIN 25
|
||||
#define BUZZERPIN 23
|
||||
|
@ -356,10 +356,14 @@ float getKadarGas() {
|
|||
|
||||
// konversi tegangan ke persen berdasarkan rumus yang telah ditentukan
|
||||
float getPersentaseKadarGas(float voltase) {
|
||||
float m = 6.0 / (1.49 / 0.33);
|
||||
float b = -m * 0.33;
|
||||
float persentase = m * voltase + b;
|
||||
// float m = 6.0 / (1.49 / 0.33);
|
||||
// float b = -m * 0.33;
|
||||
// float persentase = m * voltase + b;
|
||||
// float hasil = constrain(persentase * 100, 0, 100);
|
||||
|
||||
float persentase = 0.0526 * voltase - 0.0174;
|
||||
float hasil = constrain(persentase * 100, 0, 100);
|
||||
|
||||
// float persentase = 0.2043 * pow(voltase, 2.0) + 0.0611 * voltase - 0.0249;
|
||||
// float hasil = constrain(persentase * 100, 0, 100);
|
||||
|
||||
|
@ -518,7 +522,7 @@ void cekKegagalan() {
|
|||
regresiKadarGas = regresiKadarGas * 100;
|
||||
float nilaiPertiga = regresiKadarGas / 3.0;
|
||||
|
||||
if (lamaJam > 12) {
|
||||
if (lamaJam > 6) {
|
||||
// jika kadar gas tidak naik secara signifikan
|
||||
// if (persentaseKadarGas > (regresiKadarGas + nilaiPertiga) || persentaseKadarGas < (regresiKadarGas - nilaiPertiga)) {
|
||||
if (persentaseKadarGas < (regresiKadarGas - nilaiPertiga)) {
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
#define BOARD "ESP-32"
|
||||
#define MQPIN 34
|
||||
#define DHTPIN 4
|
||||
#define DHTPIN 2
|
||||
#define LAMPPIN 26
|
||||
#define FANPIN 25
|
||||
#define BUZZERPIN 23
|
||||
|
|
Loading…
Reference in New Issue