Qt and teensy 3.x

Status
Not open for further replies.

MichaelT

Member
There is already a thread for Qt, but (i) it infrequently visited these days and (ii) it focuses on a specific library for audio processing. Hence the new thread.

I have been using Qt for a while to interface with an Arduino UNO board, for applications in data acquisition. As an upgrade I now want to replace the UNO with a Teensy 3.5, and am rewriting the relevant parts of the code. Data flow looks something like this:

(1) From Qt program running on a PC, open serial port corresponding to microcontroller (UNO or Teensy)
(2) From Qt program, send a string of serial values to microcontroller telling it what to record (how many data points, sampling rate, etc.)
(3) microcontroller sends back data over serial port, Qt program records data in a buffer (and saves data to file, plots graphs etc).

So the question for now is the following, what are the differences between an Arduino UNO and Teensy 3.x regarding the serial communication? For the UNO, the following settings are used. This code runs on the Qt side. What changes are required, if any? If you can be provide explanation for the changes, that would be great too.

Code:
    qSerialPort->setPortName(portName);
    qSerialPort->open(QSerialPort::ReadWrite);
    qSerialPort->setBaudRate(QSerialPort::Baud115200);
    qSerialPort->setDataBits(QSerialPort::Data8);
    qSerialPort->setParity(QSerialPort::NoParity);
    qSerialPort->setStopBits(QSerialPort::OneStop);
    qSerialPort->setFlowControl(QSerialPort::NoFlowControl);
 
Status
Not open for further replies.
Back
Top