THC
Posts: 7
Joined: Tue Feb 17, 2015 5:17 am

Best way to accomplish 2 gauges

Tue Mar 24, 2015 2:02 am

Here's the deal, I have searched and searched the site and others, I just cant seem to find what I need.

The project: Replace fuel/temp gauge in my vehicle and display information onto a screen with 2 gauges. I have a mcp3008 analog to digital converter, haven't gotten to mess around with it because I forgot to buy female jumper wires.. I'm using the raspberry pi b+ running raspbian.

What is the best way to go about creating a gauge that will use a code coming from these two sensors, most likely python, to display the information on two simple gauges?

Again, I have searched and gotten a little ways with my search but I just can't seem to stumble across exactly what I need.

I have attached a preview, I just need a way to make *2* gauges, fuel level and temperature.
Attachments
Car_GUI_preview_by_upiir.jpg
Car_GUI_preview_by_upiir.jpg (58.53 KiB) Viewed 10018 times

User avatar
paddyg
Posts: 2359
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Best way to accomplish 2 gauges

Tue Mar 24, 2015 10:29 pm

I'm not sure if this is the best way but it wasn't too difficult to do:
https://www.youtube.com/watch?v=IW94tTeSbLk
The disadvantage is that you wouldn't get all the rest of the gui you might get from using another framework. The advantage would be that you wouldn't need to start the xserver and it's reasonably light weight and quick to load.
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

User avatar
dividuum
Posts: 172
Joined: Sun Jun 16, 2013 1:18 pm
Location: Germany
Contact: Website

Re: Best way to accomplish 2 gauges

Tue Mar 24, 2015 11:46 pm

info-beamer hosted - A user and programmer friendly digital signage platform for the Pi: https://info-beamer.com/hosted

User avatar
Gavinmc42
Posts: 3719
Joined: Wed Aug 28, 2013 3:31 am

Re: Best way to accomplish 2 gauges

Tue Mar 31, 2015 3:28 am

4 gauges

http://www.raspberrypi.org/forums/viewt ... 73#p730773

On a Pi 2, should be able to do lots of gauges?
Would be nice to make a dial class that can be themed:)
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
RogerW
Posts: 285
Joined: Sat Dec 20, 2014 12:15 pm
Location: London UK

Re: Best way to accomplish 2 gauges

Wed Apr 08, 2015 3:41 pm

You can create a gauge class by inheriting tkinter.Canvas. Then you can have as many as you like.
This link shows one way to do this
http://www.raspberrypi.org/forums/viewt ... 65#p733365
The design may not suit you but you could modify the code.

Roger Woollett

User avatar
sommersoft
Posts: 35
Joined: Sat Jul 11, 2015 1:43 pm
Location: Delaware, US

Re: Best way to accomplish 2 gauges

Sun Oct 18, 2015 4:26 am

dividuum wrote:Have a look at this thread: http://www.raspberrypi.org/forums/viewt ... 7&t=103343
I'll second dividuum on recommending info-beamer. I'm doing a similar project (using the MCP3208). Python for the sensor work, info-beamer for the display.

dividuum has done an excellent job on info-beamer. Amazes me how fast it can read then render. My gauges are somewhat low resolution, since near real-time is important for my readings (boost, intake temp, etc). Plus I'm displaying on a low-res nav screen over NTSC composite. With a slower interval (like fuel level/temp) and a better display, you could use pretty high resolution images like you attached.
"We mock what we don't understand." - Dr. Trowbridge

Return to “Graphics programming”