Go Back   EcoModder Forum > EcoModding > Instrumentation > OpenGauge / MPGuino FE computer
Register Now
 Register Now
 

Reply  Post New Thread
 
Submit Tools LinkBack Thread Tools
Old 07-21-2009, 11:19 PM   #11 (permalink)
EcoModding Lurker
 
Join Date: Apr 2009
Location: Clarkston, MI
Posts: 16
Thanks: 0
Thanked 1 Time in 1 Post
Quote:
Originally Posted by arlo View Post
skelly,
Where have you posted this code? I really wanted to check out distance to empty. I made a function for it, but it takes up too much memory and won't fit.
Thanks
Hi arlo,

I have not figured out a place to put the code yet. Any ideas?

I did not try

Here is essentially the code for DTE. You will need to add a #define somewhere:
Code:
#define DTE_CFG                    1  /* 0=Off 1=On        */
My call to "doDisplayBigDTE" here:

Code:
pFunc displayFuncs[] ={
   doDisplayCustom,
   doDisplayInstantCurrent,
   doDisplayInstantTank,
   doDisplayBigInstant,
   doDisplayBigCurrent,
   doDisplayBigTank,
   doDisplayCurrentTripData,
   doDisplayTankTripData,
   doDisplayEOCIdleData,
   doDisplaySystemInfo,
#if (BARGRAPH_DISPLAY_CFG == 1)
   doDisplayBigPeriodic,
   doDisplayBarGraph,
#endif
#if (DTE_CFG == 1)
   doDisplayBigDTE,
#endif
};
Also you need to add a label to it:
Code:
   displayFuncNames[x++]=  PSTR("Custom  ");
   displayFuncNames[x++]=  PSTR("Instant/Current ");
   displayFuncNames[x++]=  PSTR("Instant/Tank ");
   displayFuncNames[x++]=  PSTR("BIG Instant ");
   displayFuncNames[x++]=  PSTR("BIG Current ");
   displayFuncNames[x++]=  PSTR("BIG Tank ");
   displayFuncNames[x++]=  PSTR("Current ");
   displayFuncNames[x++]=  PSTR("Tank ");
   displayFuncNames[x++]=  PSTR("EOC mi/Idle gal ");
   displayFuncNames[x++]=  PSTR("CPU Monitor ");
#if (BARGRAPH_DISPLAY_CFG == 1)
   displayFuncNames[x++]=  PSTR("BIG Periodic ");
   displayFuncNames[x++]=  PSTR("Bargraph ");
#endif
#if (DTE_CFG == 1)
   displayFuncNames[x++]=  PSTR("BIG DTE ");
#endif

And here is the function. The 'safety factor' there is if you want to subtract a gallon or so to ensure that even when DTE says zero, you still maybe have a gallon left.

Code:
#if (DTE_CFG == 1)
void doDisplayBigDTE(void) {
   unsigned long dte;
   signed long gals_remaining;
   /* TODO: user configurable safety factor see minus zero below */
   gals_remaining = (parms[tankSizeIdx] - tank.gallons()) - 0;
   gals_remaining = MAX(gals_remaining, 0);
   dte = gals_remaining * (tank.mpg()/100);
   dte /= 10; /* divide by 10 here to avoid precision loss */
   /* dividing a signed long by 10 for some reason adds 100 bytes to program size?
    * otherwise I would've divided gals by 10 earlier! */
   bigNum(dte, "DIST", "TO E");
}
You need this supporting macro "MAX":

Code:
#define MAX(value2, value1)\
    (((value1)>=(value2)) ? (value1) : (value2))

  Reply With Quote
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 07-22-2009, 12:22 AM   #12 (permalink)
cjm
Aerocivic Wannabe
 
Join Date: Jul 2009
Location: Roanoke, VA
Posts: 6

Adventure Mobile II - '94 Honda Civic Hatchback DX
90 day: 45.02 mpg (US)

Adventure Mobile III - '03 Honda CR-V EX
90 day: 24.08 mpg (US)

Roxy - '07 VW Rabbit
90 day: 27.55 mpg (US)
Thanks: 0
Thanked 0 Times in 0 Posts
Not sure if this is the right thread to ask this question, but I haven't seen a more appropriate place. I'm interested in logging data to a PC so that long trips can be profiled and routes analyzed. PC logging would be helpful in coast down tests too. Would adding a serial output to the MPGuino require substantial coding? or is it just a matter of finding someone who is familiar with these sorts of electronics to add that physical interface? Do you know of anyone who's done this or is working on it? Thanks.
  Reply With Quote
Old 07-22-2009, 09:37 AM   #13 (permalink)
EcoModding Lurker
 
Join Date: Apr 2009
Location: Clarkston, MI
Posts: 16
Thanks: 0
Thanked 1 Time in 1 Post
Quote:
Would adding a serial output to the MPGuino require substantial coding? or is it just a matter of finding someone who is familiar with these sorts of electronics to add that physical interface?
I have the 'spiffie' hardware that has a USB plug on it. dcb's code (at least version 0.75) already has a serial output enabled and active. If you plug the USB into your PC, the PC recognizes it as a serial port, and you should see economy, speed, etc. being spit out.

Does the prebuilt unit have a USB plug on it? If so, and you are running at least version 0.75 of the MPGuino software, what you are asking for is already there.
  Reply With Quote
Old 07-22-2009, 10:04 AM   #14 (permalink)
cjm
Aerocivic Wannabe
 
Join Date: Jul 2009
Location: Roanoke, VA
Posts: 6

Adventure Mobile II - '94 Honda Civic Hatchback DX
90 day: 45.02 mpg (US)

Adventure Mobile III - '03 Honda CR-V EX
90 day: 24.08 mpg (US)

Roxy - '07 VW Rabbit
90 day: 27.55 mpg (US)
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for the response, skelly. I have not yet purchased the prebuilt unit -- just shopping right now. If it has the USB plug you describe, my shopping will be done. I can't really tell from the picture on the web site. Can anyone here confirm that there is a USB plug on the prebuilt? Thanks.
  Reply With Quote
Old 07-25-2009, 10:39 AM   #15 (permalink)
dcb
needs more cowbell
 
dcb's Avatar
 
Join Date: Feb 2008
Location: ÿ
Posts: 5,038

pimp mobile - '81 suzuki gs 250 t
90 day: 96.29 mpg (US)

schnitzel - '01 Volkswagen Golf TDI
90 day: 53.56 mpg (US)
Thanks: 158
Thanked 269 Times in 212 Posts
Nope, the usb was an addition on the spiffed kit (arduino legacy), was never part of the original mpguino except when built from an arduino or clone, though the data is still being transmitted on pin 3 of the cpu for the adventurous sorts (wire in a max232 or bluetooth or ft232rl, or just do straight uart to a large display or ???).
__________________
WINDMILLS DO NOT WORK THAT WAY!!!
  Reply With Quote
Old 07-26-2009, 01:12 PM   #16 (permalink)
EcoModding Lurker
 
Join Date: Jul 2009
Location: Greenfield, IN
Posts: 4

Mazderp - '94 Mazda Protege DX

Mazderp 2.0 - '03 Mazda Protege5
90 day: 28.52 mpg (US)
Thanks: 0
Thanked 0 Times in 0 Posts
So pretty much all you did was just swap out the chip and put in a higher capacity one? Did you have to reflash it at all or na?
  Reply With Quote
Old 07-27-2009, 10:50 AM   #17 (permalink)
EcoModding Lurker
 
hu_man's Avatar
 
Join Date: May 2009
Location: Boyce
Posts: 28
Thanks: 0
Thanked 3 Times in 3 Posts
Skelly you are onto something here. I am planning a 328 upgrade to make room for more programming. I would also like to see your code as I have some ideas of my own and I like your gals to empty idea a lot. I can not trust my fuel gauge so I am always filling up to soon. This would help. I do use the gal used but a direct screen would be nice.
Thanks for your post
Hugh
  Reply With Quote
Old 08-04-2009, 08:46 PM   #18 (permalink)
EcoModding Lurker
 
Join Date: Jul 2008
Location: Ohio
Posts: 28

Johnny's Metro - '93 Geo Metro 4-Door Hatchback
90 day: 47.5 mpg (US)

Jetta GLS TDI - '01 Volkswagon Jetta GLS
90 day: 45.83 mpg (US)
Thanks: 0
Thanked 0 Times in 0 Posts
A few features I think would be cool are 1) and rpm feature based on injector pulses per minute (as already suggested by someone else). And 2) a 1/4 mile time set up so a screen would display a timer that starts when the vehicle speed increases from 0, and stops when the odometer reaches 0.25. It would also display the speed you were at when the timer stopped. You're 1/4 mile time and top speed could be used to get a rough estimate of horsepower from calculators online. It'd be interesting to see how our fuel economy mods change the horsepower output of the engine.
  Reply With Quote
Old 08-05-2009, 10:04 PM   #19 (permalink)
EcoModding Lurker
 
Join Date: Apr 2009
Location: Clarkston, MI
Posts: 16
Thanks: 0
Thanked 1 Time in 1 Post
Quote:
Originally Posted by Fhajad View Post
So pretty much all you did was just swap out the chip and put in a higher capacity one? Did you have to reflash it at all or na?
I got the higher capacity chip, the 328, from Adafruit with their 'customized' bootloader.

Arduino-bootloader speedy 2x upgrade chip (Atmega328) - $6.00 : Adafruit Industries, Unique & fun DIY electronics and kits

You just plug it in, and then I use the Arduino-015 platform to reflash it.
  Reply With Quote
Old 09-13-2009, 06:42 PM   #20 (permalink)
Master EcoModder
 
orange4boy's Avatar
 
Join Date: Aug 2008
Location: The Wet Coast, Kanuckistan.
Posts: 1,275

The Golden Egg - '93 Toyota Previa DX
90 day: 31.91 mpg (US)

Chewie - '03 Toyota Prius
90 day: 57 mpg (US)

The Spaceship - '00 Honda Insight
Thanks: 100
Thanked 306 Times in 178 Posts
Are there any issues with using the earlier versions of arduino?
Can you just flash the chip with the older versions of the code like .75

Quote:
If you plug the USB into your PC, the PC recognizes it as a serial port, and you should see economy, speed, etc. being spit out.
Where / on which program would I see the data on a mac?

__________________
Vortex generators are old tech. My new and improved vortex alternators are unstoppable.

"It’s easy to explain how rockets work but explaining the aerodynamics of a wing takes a rocket scientist.


  Reply With Quote
Reply  Post New Thread


Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
MPGuino release one workspace dcb OpenGauge / MPGuino FE computer 1061 01-17-2020 01:37 AM
Newly assembled Spiffed Kit, Backlight but No Display osme OpenGauge / MPGuino FE computer 9 04-30-2009 06:26 PM
No display on MPGuino LCD, just backlight Wingmn OpenGauge / MPGuino FE computer 27 02-06-2009 06:27 PM
Got my MPGuino Working! Nevyn OpenGauge / MPGuino FE computer 0 12-07-2008 04:38 PM
Help w/ mpguino space shuttle code please forgottenmindset OpenGauge / MPGuino FE computer 14 09-07-2008 03:17 PM



Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com