Answer the question
In order to leave comments, you need to log in
Qt C++ Serial Port in examples, how to convert it to read Arduino data?
A card reader is connected to the Arduino, a sketch is uploaded to the Arduino that allows you to find out the card number, how now using C ++ to show this number in a separate window?
Answer the question
In order to leave comments, you need to log in
doc.qt.io/qt-5/qtserialport-terminal-example.html - details how to create a port for receiving data asynchronously.
Match the port settings on the PC with the UART settings in the Arduino sketch (speed, number of stop bits and parity).
On the arduino, generate a package from the card number. Pass the number as a string, after the number pass a carriage return character.
In QT, when a byte arrives, write it to the buffer until the received byte equals a carriage return. As soon as you find such a symbol, transfer the data from the buffer to a new window and clear the buffer.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question