Konstantin
Вот так это выглядит:
Sergey
А где обработчик кнопки?
Sergey
Есть подозрение что оно за 5 секунд успевает вызваться несколько тыщ раз )
B
Всем привет. У кого-то был опыт с платой esp32-sim800. Что-то подключил к пк, а cp2101 не определился
Shhsudhehgs
Это котора с симкой?
B
Там просто стоит usb-typec
B
И будет ли он работать с usb2. 0 я хз.
Shhsudhehgs
По идее должен
Shhsudhehgs
Вряд ли проблема в этом
B
Ок, тогда погуглю)
Sergey
И будет ли он работать с usb2. 0 я хз.
100500% будет. внешность разъема тут не при чем
Konstantin
А где обработчик кнопки?
Без прерываний: int UpBtnLastState=0; int DownBtnLastState=0; void BtnListenerUpdate(){ int UpBtnNowState=digitalRead(UP_BUTTON); int DownBtnNowState=digitalRead(DOWN_BUTTON); if(UpBtnLastState<UpBtnNowState)wzzOn(); if(UpBtnLastState>UpBtnNowState)wzzOff(); if(DownBtnLastState<DownBtnNowState){ wzzOn(); } if(DownBtnLastState>DownBtnNowState)wzzOff(); UpBtnLastState=UpBtnNowState; DownBtnLastState=DownBtnNowState; } Просто эта функция в цикле вызывается
FakeChimera_420
hi, i need a help with esp and dht11
FakeChimera_420
I can't send data on the site
hi, i need a help with esp and dht11
Ask questions! we cannot figure out how to help you.
FakeChimera_420
#include <ESP8266WebServer.h> #include <DHT.h> #include "page.h" #define DHTPIN 2 #define DHTTYPE DHT11 DHT dht(DHTPIN, DHTTYPE); const char* ssid = "espwifi"; const char* password = "12345678"; ESP8266WebServer server(80); float t; float h; void setup() { Serial.begin(115200); WiFi.begin(ssid, password); Serial.println(""); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.print("Connected to "); Serial.println(ssid); Serial.print("IP address: "); Serial.println(WiFi.localIP()); dht.begin(); server.on("/", handle_OnConnect); server.onNotFound(handle_NotFound); server.begin(); Serial.println("HTTP server started"); } void loop() { server.handleClient(); } void handle_OnConnect() { t = dht.readTemperature(); // Gets the values of the temperature h = dht.readHumidity(); // Gets the values of the humidity server.send(200, "text/html", SendHTML(t,h)); } void handle_NotFound(){ server.send(404, "text/plain", "Not found"); } String SendHTML(float Temperaturestat,float Humiditystat){ server.send (200, "text/html", MAIN_page); }
Ivansuper
Ask questions! we cannot figure out how to help you.
Как мило, что для англоговорящих была создана отдельная группа, но они приходят сюда : )
FakeChimera_420
this is the code
Как мило, что для англоговорящих была создана отдельная группа, но они приходят сюда : )
да он похоже давно пришел. еще сообщу там мало еще народу потихоньку будем расти.
FakeChimera_420
u can help me o no?
Ivansuper
You call it is the context of send function already but call send inside
FakeChimera_420
What is SendHTML function doing?
it should send the web page
Ivansuper
Without even returning a string it is expecting to return
Ivansuper
u can help me o no?
What is the exact problem?
FakeChimera_420
how i can do?
FakeChimera_420
What is the exact problem?
I can't see the data on the web
Ivansuper
You are not sending it
Ivansuper
FakeChimera_420
const char MAIN_page[] PROGMEM = R"=====( <!DOCTYPE html> <HTML> <head> </style> </head> <BODY> <CENTER> <B>TERMOMETRO WIFI</B> </CENTER> <p> <span class="dht-labels">Temperatura</span> <span>(int)Temperaturestat</span> <sup class="units">°C</sup> </p> <p> <span class="dht-labels">Umidità</span> <span>(int)Humiditystat</span> <sup class="units">%</sup> </p> </BODY> </HTML> )=====";
Ivansuper
You need to manually concatenate strings using the arguments that you have passed to the SendHTML function
Ivansuper
Like "<body>" + temp + "</body>" (just an example)
FakeChimera_420
how can i do?
Ivansuper
By coding it properly
Ivansuper
No
Ivansuper
It is broken basically
Ivansuper
https://randomnerdtutorials.com/esp8266-dht11dht22-temperature-and-humidity-web-server-with-arduino-ide/
Ivansuper
Read this
Ivansuper
It is a bit more complicated though with a self-refreshing web page
hi, i need a help with esp and dht11
We are always glad to everyone! But we also have an English-language chat. @Proesp_en If it's not difficult for you, join it too. There are not many people there yet, but still in front. If you tell your friends about the chat, we will be grateful for the new participants in the discussions about esp8266 and esp32.
Bakosh
Hello
Bakosh
How are you?
Konstantin
How are you?
We are fine, what about u?
FakeChimera_420
It is broken basically
i managed to solve
Ivansuper
FakeChimera_420
Great : )
Without async
romanetz
Without async
Nevertheless, in the task it's better to use async than not to do it
Eugene
Всем привет, собрал опторазвязку для управления драйвером турбины, всё работает, вот только у меня есть сомнения, правильно ли я подобрал резистор на 300 Ом
Eugene
Собирал это дело методом тыка, сначала пробовал 10кОм, потом 4.7кОм, потом 1кОм, в итоге заработало только на 300Ом
Eugene
Есть только такая картинка
Eugene
Там два варианта подключения ШИМ сигнал или потенциометр
Eugene
как по мне - то резистор - лучше сверху поставить, от 5в к ШИМ. а оптрон от ШИМ к земле
У меня пробел в этом, не могу в интернете найти ответ на вопрос, почему npn транзисторы ставят между нагрузкой и землёй, а не между питанием и нагрузкой?
Василий
потому что так проще им управлять, но в оптроне - это не имеет значения т.к. транзистор не управляется - базой, а засвечивается
romanetz
Why?
The behaviour of your program won't depend on the state of link to client
romanetz
And at the same time your program won't have to wait for requests/responses, wasting resources
FakeChimera_420
the program automatically loads the data on the site by itself
Алексей
Привет всем
Алексей
Проблема в том что если больше трех функций кнопок в loop записывать то не чего не работает
Алексей
что в ардуино иде что в визуал код
Алексей
такого раньше не было
Алексей
кто может помочь?
Алексей
такая дрянь недавно появилась, я и винду снес даже, но один фиг все плохо
Алексей
Алексей Тюрин, [09.09.20 15:52] это main.cpp Алексей Тюрин, [09.09.20 15:52] #include <Arduino.h> //#include <LiquidCrystal_I2C.h> //const uint8_t COLUMN = 20; //const uint8_t LINE = 4; //LiquidCrystal_I2C lcd(0x27,COLUMN, LINE); bool btn_menu = false; bool btn_up = false; bool btn_down = false; bool btn_left = false; bool btn_right = false; //#include <_general.h> #include <_button.h> //#include <_lcd.h> void setup() { //Get_LCD_Print(); Serial.begin(9600); } void loop() { // Set_Button(8, btn_right); Set_Button_Left(9); if (btn_left == true) { Serial.print("LEFT "); } Set_Button_Down(10); if (btn_down == true) { Serial.print("DOWN "); } Set_Button_Up(11); if (btn_up == true) { Serial.print("Up "); } Set_Button_Menu(12); if (btn_menu == true) { Serial.print("Menu "); } } Алексей Тюрин, [09.09.20 15:53] это _button.h Алексей Тюрин, [09.09.20 15:53] //bool Set_Delay_Millis(uint32_t, uint32_t); void Set_Button_Menu(const uint8_t PIN_BTN_MENU) { static bool setup = false; if (!setup) { pinMode(PIN_BTN_MENU, INPUT_PULLUP); setup = true; } btn_menu = false; uint32_t first_time = millis(); uint32_t click_timer; while (digitalRead(PIN_BTN_MENU)) { btn_menu = false; } click_timer = millis(); if (click_timer - first_time < 20) return; click_timer = millis(); btn_menu = true; } void Set_Button_Up(const uint8_t PIN_BTN_UP) { static bool setup = false; if (!setup) { pinMode(PIN_BTN_UP, INPUT_PULLUP); setup = true; } btn_up = false; uint32_t first_time = millis(); uint32_t click_timer; while (digitalRead(PIN_BTN_UP)) { btn_up = false; delay(1); } click_timer = millis(); if (click_timer - first_time < 20) return; click_timer = millis(); btn_up = true; } void Set_Button_Down(const uint8_t PIN_BTN_DOWN) { static bool setup = false; if (!setup) { pinMode(PIN_BTN_DOWN, INPUT_PULLUP); setup = true; } btn_down = false; uint32_t first_time = millis(); uint32_t click_timer; while (digitalRead(PIN_BTN_DOWN)) { btn_down = false; delay(1); } click_timer = millis(); if (click_timer - first_time < 20) return; click_timer = millis(); btn_down = true; } void Set_Button_Left(const uint8_t PIN_BTN_LEFT) { static bool setup = false; if (!setup) { pinMode(PIN_BTN_LEFT, INPUT_PULLUP); setup = true; } btn_left = false; uint32_t first_time = millis(); uint32_t click_timer; while (digitalRead(PIN_BTN_LEFT)) { btn_left = false; delay(1); } click_timer = millis(); if (click_timer - first_time < 20) return; click_timer = millis(); btn_left = true; } /*void Set_Button(const uint8_t &PIN, bool &a) { static bool setup = false; if (!setup) { pinMode(PIN, INPUT_PULLUP); setup = true; } a = false; uint32_t first_time = millis(); uint32_t click_timer; while (digitalRead(PIN)) { a = false; if (Set_Delay_Millis(click_timer, first_time, 20)) a = true; } } */ Алексей Тюрин, [09.09.20 15:53] это _general.h Алексей Тюрин, [09.09.20 15:53] bool Set_Delay_Millis(uint32_t &a, uint32_t &b, const uint8_t &DELAY_MILLIS) { a = millis(); if (a - b < DELAY_MILLIS) return false; a = millis(); return true; }
Василий
правду говорят - если бы програмисты строили дома - мы бы жили в руинах )))))
Алексей
ну подскажите если знаете, что издеваться то
Василий
........без издевательств, то просто вспомнилось выражение
Василий
а что делают функции - Set_Button_**** ; ?
Алексей
эта функция ведь закоментированна
Алексей
я писал Set_Button_ для того что бы не писать на каждую кнопку обработчик
Алексей
но только три кнопки работает