Serial Com between Arduinos - One not always running.
hi guys,
i have serial connection between 2 arduinos. 1 "master" -a , on other 1 (b) turns on , off needed.
the communication bidirectional: send bytes b , b sends bytes a.
the problem when b goes offline how ensure doesnt run "outgoing buffer overflow".
i coding in simulink not traditional ide cant post code. looking methodology or code snippet allows me either detect when b goes offline can stop sending data and/or clear buffer empty when b comes online.
b may sending or not sending data using received data indicator whether on or off wont work.
any appreciated!
-phil
i have serial connection between 2 arduinos. 1 "master" -a , on other 1 (b) turns on , off needed.
the communication bidirectional: send bytes b , b sends bytes a.
the problem when b goes offline how ensure doesnt run "outgoing buffer overflow".
i coding in simulink not traditional ide cant post code. looking methodology or code snippet allows me either detect when b goes offline can stop sending data and/or clear buffer empty when b comes online.
b may sending or not sending data using received data indicator whether on or off wont work.
any appreciated!
-phil
on a-side:
if (serial.available()>0){ // got data b process
on b-side, send "i'm online" message when ready receive data,
"going offline" when not.
if (serial.available()>0){ // got data b process
on b-side, send "i'm online" message when ready receive data,
"going offline" when not.
Arduino Forum > Using Arduino > Project Guidance > Serial Com between Arduinos - One not always running.
arduino
Comments
Post a Comment