esp 32 yavaslıgı
03.09.2019 - 12:14
herkese selamlar
aşagıdaki kodu esp 32 ye yukledigimde komutları yerine getirmesi ortalama 40 sn ye suruyor oysa esp8266 12 e de maksimum 3 saniyede yerine getiriyor esp 32 yi daha hızlı hale getirmenin bir yolu varmı acaba
kodlamayı ardunyo ide si ile yapıyorum
#include <WiFi.h>
#include <IOXhop_FirebaseESP32.h>
#define FIREBASE_HOST "https://xx.firebaseio.com"
#define FIREBASE_AUTH "xx"
#define WIFI_SSID "xx"
#define WIFI_PASSWORD "xx"
String elk = "";
String gaz = "";
String su= "";
String kombi= "";
String dlp= "";
String gns= "";
String rzgr= "";
String hdr= "";
String depo= "";
String kombiaku= "";
int elksbkrole =36;
int gazsbkrole =35;
int susbkrole =34;
int elkrole=23;
void setup() {
Serial.begin(115200);
delay(1000);
pinMode(elksbkrole, INPUT);
pinMode(gazsbkrole, INPUT);
pinMode(susbkrole, INPUT);
pinMode(23, OUTPUT);
pinMode(22, OUTPUT);
pinMode(1, OUTPUT);
pinMode(3, OUTPUT);
pinMode(21, OUTPUT);
pinMode(19, OUTPUT);
pinMode(18, OUTPUT);
pinMode(5, OUTPUT);
pinMode(17, OUTPUT);
pinMode(16, OUTPUT);
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
Serial.print("Connecting to ");
Serial.print(WIFI_SSID);
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
}
Serial.println();
Serial.print("Connected to ");
Serial.println(WIFI_SSID);
Serial.print("IP Address is : ");
Serial.println(WiFi.localIP());
Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
}
void loop() {
if (digitalRead(elksbkrole) == LOW){
Firebase.setString("sebeke/elksbk","0");
}
if (digitalRead(elksbkrole) == HIGH){
Firebase.setString("sebeke/elksbk","1");
}
if (digitalRead(gazsbkrole) == LOW){
Firebase.setString("sebeke/gazsbk","0");
}
if (digitalRead(gazsbkrole) == HIGH){
Firebase.setString("sebeke/gazsbk","1");
}
if (digitalRead(susbkrole) == LOW){
Firebase.setString("sebeke/susbk","0");
}
if (digitalRead(susbkrole) == HIGH){
Firebase.setString("sebeke/susbk","1");
}
elk = Firebase.getString("mbl/enerji/elk");
if (elk == "1") {
digitalWrite(23, HIGH);
Firebase.setString("esp/enerji/elk","1");
}
else if (elk == "0") {
digitalWrite(23, LOW);
Firebase.setString("esp/enerji/elk","0");
}
gaz = Firebase.getString("mbl/enerji/gaz");
if (gaz == "1") {
digitalWrite(22, HIGH);
Firebase.setString("esp/enerji/gaz","1");
}
else if (gaz == "0") {
digitalWrite(22, LOW);
Firebase.setString("esp/enerji/gaz","0");
}
su = Firebase.getString("mbl/enerji/su");
if (su == "1") {
digitalWrite(1, HIGH);
Firebase.setString("esp/enerji/su","1");
}
else if (su == "0") {
digitalWrite(1, LOW);
Firebase.setString("esp/enerji/su","0");
}
kombi = Firebase.getString("mbl/enerji/kombi");
if (kombi == "1") {
digitalWrite(3, HIGH);
Firebase.setString("esp/enerji/kombi","1");
}
else if (kombi == "0") {
digitalWrite(3, LOW);
Firebase.setString("esp/enerji/kombi","0");
}
dlp = Firebase.getString("mbl/enerji/dlp");
if (dlp == "1") {
digitalWrite(21, HIGH);
Firebase.setString("esp/enerji/dlp","1");
}
else if (dlp == "0") {
digitalWrite(21, LOW);
Firebase.setString("esp/enerji/dlp","0");
}
gns = Firebase.getString("mbl/enerji/gns");
if (gns == "1") {
digitalWrite(19, HIGH);
Firebase.setString("esp/enerji/gns","1");
}
else if (gns == "0") {
digitalWrite(19, LOW);
Firebase.setString("esp/enerji/gns","0");
}
rzgr = Firebase.getString("mbl/enerji/rzgr");
if (rzgr == "1") {
digitalWrite(18, HIGH);
Firebase.setString("esp/enerji/rzgr","1");
}
else if (rzgr == "0") {
digitalWrite(18, LOW);
Firebase.setString("esp/enerji/rzgr","0");
}
hdr = Firebase.getString("mbl/enerji/hdr");
if (hdr == "1") {
digitalWrite(5, HIGH);
Firebase.setString("esp/enerji/hdr","1");
}
else if (hdr == "0") {
digitalWrite(5, LOW);
Firebase.setString("esp/enerji/hdr","0");
}
depo = Firebase.getString("mbl/enerji/depo");
if (depo == "1") {
digitalWrite(17, HIGH);
Firebase.setString("esp/enerji/depo","1");
}
else if (depo == "0") {
digitalWrite(17, LOW);
Firebase.setString("esp/enerji/depo","0");
}
kombiaku = Firebase.getString("mbl/enerji/kombiaku");
if (kombiaku == "1") {
digitalWrite(16, HIGH);
Serial.println("kombi aku açık");
Firebase.setString("esp/enerji/kombiaku","1");
}
else if (kombiaku == "0") {
digitalWrite(16, LOW);
Serial.println("kombi aku kapalı");
Firebase.setString("esp/enerji/kombiaku","0");
}
}
80
Görüntülenme
0 Beğeni