A
A
AlexSer2020-02-17 14:58:22
Qt
AlexSer, 2020-02-17 14:58:22

How to send CR signal over RS232 in C++?

The device receives signals in AScii. I need to send a CR signal to hex 0D.
Am I sending port->write("\r")?
Am I doing it right or should I send it
port->write("\x0D")?
I don't know much about coding...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Armenian Radio, 2020-02-17
@gbg

const char chr = '\r';
port->write(&chr,1);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question