E
E
elisey4742015-10-11 16:43:25
linux
elisey474, 2015-10-11 16:43:25

How to send and read from serial port at the same time?

Arduino is configured so that if you apply to the Serial Port /dev/ttyACM0
:
1 - turn on the LED
2 - turn off
3 - beeps for 1 second
for them, I use
echo "digit" > /dev/ttyACM0
and now you need to simultaneously apply to arduino - 4 and read the answer as a number that indicates the level of light read from the light sensor.
There is a solution - screen, but I need to send one command to port - 4 and get a response.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Ruslan Fedoseev, 2015-10-11
@martin74ua

forum.arduino.cc/index.php?topic=54268.0
3 minutes of google. Call your ISP and ask to unblock Google.

C
chupasaurus, 2015-10-11
@chupasaurus

echo 4 > /dev/ttyACM0 && dd if=/dev/ttyACM0 count=1 bs="длина ответа"

V
Vitaly Filinkov, 2015-10-11
@vitfil

Does it bother you that serial is a serial port? You cannot read and send at the same time.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question