Last month, some folks had mailed me and commented on one of my youtube videos asking for a code and tutorial on plotting real-time sensor data in Qt. So, here you go! 🙂
I have demonstrated the real-time plotting capabilities of Qt using the BeagleBone Black. If you haven’t set up the Qt cross-platform development environment on your machine, please do so by following the steps described here.
I have used the qcustomplot Library for plotting the graphs. So for this demo, I basically have a  Force Sensor whose output is sampled using an AD7190 ADC and fed into the BeagleBone + 4D Systems LCD.
If you are wondering how to use the AD7190 with the Beaglebone which is out of scope for this post, then I suggest you check out this article, as it has all the information you need.
You can find the Qt example code in my Github or clone it by using the below command.
1 |
git clone https://github.com/deeplyembeddedWP/Plot-Real-Time-Graphs-Qt-Embedded-Linux.git |
The above video demonstrates the working of the example code and use of the qcustomplot Library for plotting real-time graphs for the sensor data. I hope you enjoyed this post and if you have any thoughts, please feel free to comment.
Thank you very much, your project help me a lot of.
I am glad it helped. Thanks 🙂
Hi Vinay,
Thank-you very much for such a great post.
Really easy to understand and follow.
Does this work for qt5 as well?
Thanks,
ASG
Not sure as I haven’t tried building for qt5. Maybe you can try and let me know as well 🙂 Thanks.
What are the possible “user interaction” with this widget ? like zoming, linear/log axis, redefine scale ?
Shall we code all of theses or are there embbeded, so we have just to enable these features ?
I believe these features are there inbuilt. Like for e.g. auto scale. If not, maybe you can just implement them when you are creating the plots. I don’t remember exactly as I had done this long ago.
autoconf is failing with AC_MSG_ERROR undefined. Suggestions?
libtoolize: putting auxiliary files in
.'.
./ltmain.sh’libtoolize: copying file
libtoolize: putting macros in AC_CONFIG_MACRO_DIR,
m4/internal'.
m4/internal/libtool.m4′libtoolize: copying file
libtoolize: copying file
m4/internal/ltoptions.m4'
m4/internal/ltsugar.m4′libtoolize: copying file
libtoolize: copying file
m4/internal/ltversion.m4'
m4/internal/lt~obsolete.m4′libtoolize: copying file
configure:13130: error: possibly undefined macro: AC_MSG_ERROR
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1
You might be missing something. Just did a quick search and found a similar issue here. Might be helpful.