Hi guys, I would like to ask if you can do a multi communication
with arduino one, or other. I'm trying to check a couple of relays
with app inventor but at a time send data with mySerial.write (val);
to cellular, receive commands with keys always from the cell phone with
com = Serial.read (); and retrieve data from a potentiometer with
analogread (A5) depending on the value turns each relay on or off.
To say mySerial works for me but Serial does not and on the command keys
with reading com = Serial.read (); from errors, etc. i included the program
Thank you very much
Here is your code posted in code tags and indented with autoformat. Notice that the software serial port is only checked if Serial.available() returns true. Is this the logic that you expect?
My tutorial on Arduino to Arduino/PC via Serial has complete sketches and circuits for connecting two Arduinos together via Serial.
The code does auto connect/reconnect and send/receive is synced so it works well with Software Serial which cannot send/receive at the same time.
Also if you limit you messages to <=60 chars the code is very tolerant of very long delays in either loop. (Not that you should be using delays( ) but in any case)
Thank you so much for your availability. Serial.available I needed to enable the relay with analogRead but it doesn't work so I use this condition if myseria.available () otherwise without this condition the relay was always active. But at a time it makes me problem with the "com" that manually activates the relays with the keys of the mobile phone but it works badly. If I make two different programs for one byte side val = analogRead (A5); and for the other com = mySerial.read (); works perfect.