Answer the question
In order to leave comments, you need to log in
Why doesn't QT read from serial?
Here is the Qt code for connecting to serial port
serialPort=new QSerialPort(this);
serialPort->setPortName(port);
serialPort->setBaudRate(baudrate);
serialPort->setDataBits(QSerialPort::Data8);
serialPort->setParity(QSerialPort::NoParity);
serialPort->setStopBits(QSerialPort::OneStop);
serialPort->setFlowControl(QSerialPort::NoFlowControl);
serialPort->open(QIODevice::ReadWrite);
if(serialPort->isOpen()){
QMessageBox::about(this,"title","Соединение установлено успешно");
dialogSettCom->close();
}else{
QMessageBox::warning(this,"title","Соединение не установлено");
}
qDebug()<<serialPort->readAll();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question