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

  • Thread starter Rx7man
  • Start date
  • Tags
    Language
In summary: I'm using).In summary, the goal of the project was to control a Holset HE351 variable vane turbocharger. I got an Arduino and relearned my lost C++. I then 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, so I got a Raspberry Pi and a 7" HDMI touchscreen. I'm using the Raspbian OS and I'm looking for something that's not going to torture me to learn. I'm thinking Python or Java, open to other suggestions.
  • #1
Rx7man
425
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
  • #2
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
 
  • #3
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!
 
  • #4
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.
 
  • #5
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.
 
  • #7
I have that installed.. I'll give it a shot.
 
  • #8
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.
 
  • #9
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.
 

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

What are the differences between programming languages?

Programming languages differ in syntax, structure, and purpose. Some are better suited for web development, while others are used for scientific computing or mobile app development. It is important to research and understand the strengths and weaknesses of each language before deciding which one to use.

How do I choose the right language for my project?

When choosing a programming language, consider the requirements of your project, the availability of resources and support for the language, and your own familiarity and comfort with the language. You may also want to consult with other programmers or experts in the field for their recommendations.

Can I use multiple languages for one project?

Yes, it is possible to use multiple programming languages for one project. This is known as multi-language programming and can be useful when certain tasks are better suited for one language over another. However, it may also add complexity to the project and require additional resources and expertise.

Is it necessary to learn multiple languages?

It is not necessary to learn multiple programming languages, but it can be beneficial. Having knowledge of multiple languages can expand your skill set and make you more versatile as a programmer. It can also help you better understand the strengths and limitations of different languages and choose the most appropriate one for a given task.

Will the language I choose become obsolete?

It is possible for programming languages to become obsolete as technology advances and new languages emerge. However, many popular languages have been around for decades and continue to be widely used. It is important to consider the current popularity and use of a language before learning it, but also to stay updated on emerging languages and technologies.

Similar threads

  • Programming and Computer Science
Replies
6
Views
2K
  • Electrical Engineering
Replies
18
Views
8K
  • DIY Projects
Replies
5
Views
3K
  • Programming and Computer Science
Replies
15
Views
4K
Back
Top