Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define monitor_on 1
- #define monitor_off 0
- int monitor_stan = monitor_on; // wyłączanie seriala - np dla ESP01
- //====== predefinicje funkcji z innych bloków programu
- void pin0_rec(String value);
- bool sendValue(const char* tag, String value);
- //======= deklaracje wartości początkowych
- int pin11_lastValue = 0;
- // deklaracje pinów łączących ESP i APP
- const char* pin0 = "V0";
- const char* pin10 = "V10";
- const char* pin11 = "V11";
- const char* pin12 = "V12";
- //===================================================== sendPinStatus
- // It is called every time a new client is connected.
- // The void informs Virtuino app about the current pin states and variable values.
- void sendPinsStatus() {
- sendValue(pin11, String(pin11_lastValue)); // send pin11 value
- // add more here...
- }
- //===================================================== onValueReceived
- // It is called every time a new value received - add ---> esp
- void onValueReceived(String tag, String value) {
- if (monitor_stan == monitor_on) Serial.println("Received: tag=" + tag + " value=" + value);
- if (tag == "V0") pin0_rec(value);
- // add more here...
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement