What language is best for displaying data from a turbocharger on a Raspberry Pi?

  • Thread starter Thread starter Rx7man
  • Start date Start date
  • Tags Tags
    Language
AI Thread Summary
A project focused on controlling a Holset HE351 variable vane turbocharger is evolving, utilizing an Arduino and a Raspberry Pi with a 7" HDMI touchscreen for data display. The user is exploring programming options, considering Python and Java, with a preference for Python due to its ease of use and existing support on Raspbian OS. The discussion highlights the need to read and parse serial data for graphical representation, with suggestions for using Pygame for graphics. Concerns about flickering in the display are raised, with advice on frame swapping and the potential use of OpenGL for more advanced graphics. The user expresses hesitation about diving into OpenGL due to a lack of experience and the complexity of learning a new language simultaneously. Alternatives like GLUT and GLUI are mentioned for simpler gauge displays. The conversation emphasizes the importance of ensuring safety while working on the project, particularly regarding driving and monitoring data.
Rx7man
Messages
425
Reaction score
189
Well, a pet project of mine is growing into a fine elephant.
The goal was to control a Holset HE351 variable vane turbocharger.. So I got an Arduino.. and relearned my lost C++ that was never good anyhow.

Then I wanted a display for it, so I wrote a basic one in well. VB.net, but I can't fit a computer on my dash so I can look at it while driving, (you can't tune it if you don't know what's going on) so I got a Raspberry Pi and a 7" HDMI touchscreen.

Now what I need to do is read data from the serial port, parse the data, then display it in graphical (gauges, etc) form.
I'm using the Raspbian OS

I'm looking for something that's not going to torture me to learn.. and has some portability to it as well..
I'm thinking Python or Java.. open to other suggestions
 
Technology news on Phys.org
Why not just use C on the Pi and some character graphics (ie ANSI codes) since you are familiar with it?

For Java, I think you'll need to load some packages to get it working.

However for Python, its there already and I think the Pygame package for graphical displays is too.

Here's a tutorial on it.

http://www.pygame-doku.laymaxx.de/tut/intro/intro.html
 
I am checking out Python right now, Looked at a Hello World program, syntax looks pretty easy so far.

I was considering Java especially for portability.. IE.. if I wanted to run it on an Android phone instead would Python still be a viable option?

Should I concern myself with OpenGL capabilities at all? In the VB.net version I'll be darned if I can't get rid of the flicker (and yes, I googled it, enabled double-buffering and every other trick in the book).. but my computer can play any new video game with good frame rates and no flicker. I don't want to put all the work into developing something to find out it doesn't look any good when I'm done!
 
Python would not work on an Android phone. However, Jython would and its syntax is mostly compatible with Python but you'd need to try out your program first.

I think Python with Pygame would be sufficient for what you want to do.
 
Is there an IDE for Python/Pygame that supports autocomplete, auto compile, etc.. I really don't like command line stuff that much!.. I'll take your suggestion and go with Python for now.
 
I have that installed.. I'll give it a shot.
 
Rx7man said:
Then I wanted a display for it, so I wrote a basic one in well. VB.net, but I can't fit a computer on my dash so I can look at it while driving, (you can't tune it if you don't know what's going on) so I got a Raspberry Pi and a 7" HDMI touchscreen.
I sincerely hope you aren't going to be driving on public roads when you're doing this. We already have enough people who are attempting to drive while they're checking for text messages and their witter accounts.
 
Some of it will be, when I feel a hesitation or something I will look at it like I'd look at any other kind of gauge, no it won't be in my lap, it'll be mounted in a place that doesn't require me to stop looking at the road.
 
  • #10
What about Kivy? any experience with it?
 
  • #11
Flicker is absolutely from not doing frame swapping correctly.

What kind of graphics are you looking for? OpenGL can do a lot of nice things with very easy code, and it's really flexible. That's a good thing if you're already familiar with it, but can be confusing if you aren't.
 
  • #12
I'm just looking to make some dial and bar type gauges and graphs.. never done anything with OpenGL before, and at this point, looking at my learning curve by doing it in an unfamiliar language to boot, is a touch daunting I will say. I don't see myself actually getting serious with this project for some time (next winter?) because I got a lot of other things to do.. but I might fiddle around a little bit.
 
  • #14
Interesting.. it seems to be in .net, perhaps I can even play with GL a little in VB, which would really help me grasp the concepts of it... My C++ is probably not good enough to really understand it.. it's just enough I can do Arduino with.
 
  • #15
Rx7man said:
it seems to be in .net
I don't think so. I looked at a couple of pages at the site that newjerseyrunner linked to, and it seems to be standard C++ code using the OpenGL APIs. To the best of my knowledge this is not part of the .NET Framework, but there are third-party wrappers of the OpenGL APIs (such as SharpGL -- https://sharpgl.codeplex.com/) so that they can be used from the .NET languages.
 
  • #16
Whether or not it's .net is probably not relevant, .net I'm sure has an OpenGL context window. Getting used to the concept of matrices, views, and vectors is most important.
 
  • #17
I did study rotation matrices, vectors, and views superficially about a year ago.. it's pretty cool, and I have a marginal understanding of them now.

I did write a little vb.net program that parsed an input file which had 2 pairs of XYZ coordinates per line (draws a line between the 2 pairs), and then rotated them in 3D space... didn't look fancy with any shading or anything, but was an interesting exercise for a proof of concept and practice.
 
  • #18
For displaying simple dials and gauges, it is not necessary to program low level OpenGL. Look at GLUT and GLUI. They are based on OpenGL and will be much easier to use.

PS. You will want an early version of OpenGL what allows glBegin and glEnd.
 
Last edited:
  • #19
Not glut, Glut has been deprecated for more than a decade.

Also, all OpenGL has glbegin and glend. I use the latest OpenGL and I use it for most texture rendering.
 
  • #20
newjerseyrunner said:
Not glut, Glut has been deprecated for more than a decade.

Also, all OpenGL has glbegin and glend. I use the latest OpenGL and I use it for most texture rendering.
I should have said FreeGLUT. glBegin and glEnd have been deprecated since OGL 3.0 in 2008, but you may be right that they are still available.
 
Back
Top