theaxe67
Posts: 4
Joined: Wed Sep 25, 2013 9:40 pm

clean GUI for speedometer

Fri Apr 18, 2014 5:29 am

I'm making a speedometer for a dune buggy I'm building. I've got the programming and hardware all sorted out, now I need to figure out the GUI. I've got a small LCD screen which will be built into the dash, and I want a really simple clean display, like such

Image

looking up python GUIs, TkInter and wxPython look pretty chunky and ugly. I want the display to be full screen, just a background and the speed and time, nothing more. What should I be using for this, and are there any tutorials or guides that will help m to this goal, I have no experience with GUIs

texy
Forum Moderator
Forum Moderator
Posts: 5161
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: clean GUI for speedometer

Fri Apr 18, 2014 9:40 am

Not sure which LCD you have, but I would recommend pygame. It works well with my TFT displays and fbtft.
rgds,
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: clean GUI for speedometer

Fri Apr 18, 2014 10:49 am

I'd agree. Pygame will be able to handle this very easily.

Here's a very basic script for displaying a clock, might be a good starting place for you but I'm happy to provide more help if needed:
http://www.raspberrypi.org/forums/viewt ... ck#p415267
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

theaxe67
Posts: 4
Joined: Wed Sep 25, 2013 9:40 pm

Re: clean GUI for speedometer

Fri Apr 18, 2014 4:49 pm

fantastic, thank you very much

theaxe67
Posts: 4
Joined: Wed Sep 25, 2013 9:40 pm

Re: clean GUI for speedometer

Fri Apr 18, 2014 5:42 pm

I think you're clock script will work perfectly. What I'm thinking is I'll change mysecs to a static "km/h", and mytime to the calculated speed variable. Then within "if pygame.time.get_ticks() > refresh:" I'll add a couple lines first to update the speed variable then have the display update.

Does this sound feasible?

amritpati
Posts: 1
Joined: Thu Mar 06, 2014 10:38 pm

Re: clean GUI for speedometer

Tue Apr 22, 2014 3:20 am

i am working on similar project. please share the code for gui. actually i am from electronics backgroung i dont know python can you share the code please...

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: clean GUI for speedometer

Tue Apr 22, 2014 6:24 pm

theaxe67 wrote:I think you're clock script will work perfectly. What I'm thinking is I'll change mysecs to a static "km/h", and mytime to the calculated speed variable. Then within "if pygame.time.get_ticks() > refresh:" I'll add a couple lines first to update the speed variable then have the display update.

Does this sound feasible?
Absolutely.

Have a go at working out the code yourself and if you get stuck, let me know and I'll be happy to help out.

That "get_ticks() > refresh" bit of the code is pretty ugly and isn't how I do my code now, however, it should be enough for you to get started. Once you've got something that works, we can work out how to make the code "prettier"!

Good luck.
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

amerant
Posts: 9
Joined: Fri Apr 25, 2014 1:05 pm

Re: clean GUI for speedometer

Fri Apr 25, 2014 1:12 pm

Are you using a gps or the speed sensor off the trans?

umair23
Posts: 1
Joined: Tue Apr 29, 2014 11:58 am

Re: clean GUI for speedometer

Tue Apr 29, 2014 12:04 pm

I'm working exactly on the same project, I have managed to capture speed, rpm and other values via OBD2 port. Now i need a gui that is a speedometer to display the values in a fashioned manor. Can anyone please help?

Return to “Python”