Which language should I use?

  • Thread starter Rx7man
  • Start date
  • #1
414
185
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
 

Answers and Replies

  • #2
12,023
5,677
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
414
185
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
12,023
5,677
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
414
185
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
414
185
I have that installed.. I'll give it a shot.
 
  • #8
33,968
5,624
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
414
185
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
414
185
What about Kivy? any experience with it?
 
  • #11
1,518
618
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
414
185
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
414
185
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
33,968
5,624
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
1,518
618
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
414
185
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
FactChecker
Science Advisor
Gold Member
5,746
2,133
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
1,518
618
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
FactChecker
Science Advisor
Gold Member
5,746
2,133
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 Threads on Which language should I use?

Replies
26
Views
6K
Replies
7
Views
4K
Replies
3
Views
2K
Replies
6
Views
2K
Replies
15
Views
3K
Replies
11
Views
3K
  • Last Post
Replies
8
Views
3K
Replies
15
Views
6K
  • Last Post
2
Replies
34
Views
6K
Top