![]() ![]() Press F1 to open the document and see the manual of data such as classes and functions. As a novice, I found that I can select keywords in QtCreator when I don’t know how to do it. Read and write operations can be performed after setting these. Here set the serial port name as name, open the serial port and set it to be readable and writable, the baud rate is BaudRate, the data bit is 8 bits, there is no parity bit, the stop bit is 1 bit, and there is no flow control. ![]() 2 // Set the serial port name 3 serial-> setPortName(name) Ĥ // Open the serial port 5 serial-> open(QIODevice::ReadWrite) Ħ // Set the baud rate 7 serial-> setBaudRate(BaudRate) Ĩ // Set the number of data bits 9 serial-> setDataBits(QSerialPort::Data8) ġ0 // Set parity 11 serial-> setParity(QSerialPort::NoParity) ġ2 // Set stop bit 13 serial-> setStopBits(QSerialPort::OneStop) ġ4 // Set up flow control 15 serial->setFlowControl(QSerialPort::NoFlowControl)
0 Comments
Leave a Reply. |