Hello everyone!
I’m novice and I no understand how to operate two modules by the arduino code.
My idea with two modules asf:
- HTCC-AB01 with battery and dislay Nextion (serial commands RX,TX)
- HTCC-AB01 with battery and with pressure sensor (I2C), electromagnets and LEDs
Which I need:
- If I tap display’s button “swith on pressure sensor” module 1 hearing command:
void (loop){
if(Serial2.available()){
if (command == “wvScan”) {
if (value == “1”) {
digitalWrite(13, HIGH);
Serial.print(“mes3.tmr.val=” + String (timeMeasureLength) + endChar);
/SEND COMMAND TO MODULE TWO: RUN PRESSURE SENSOR AND READING DATA 200-600 TIMES WITHING 40-120 SECONDS WITH REVERTING/TRANSFERING EACH PRESSURE RESULT BY THE LORA TO MODULE ONE AND INDICATE IT ON DISPLAY DINAMICALLY/
}
} else if (value == "0") {
digitalWrite(13, LOW);
}
value = "";
}
}
}
- If I tap display’s button “swith on electromagnet” module 1 hearing command:
void (loop){
if(Serial2.available()){
if (command == “magneA”) {
if (value == “1”) {
digitalWrite(13, HIGH);
/SEND COMMAND TO MODULE TWO: SWITH ON ELECTROMAGNET/
} else if (value == “0”) {
digitalWrite(13, LOW);
/SEND COMMAND TO MODULE TWO: SWITH OFF ELECTROMAGNET/
}
value = “”;
}
}
}
Thank you for support.