EcoModder.com

EcoModder.com (https://ecomodder.com/forum/)
-   OpenGauge / MPGuino FE computer (https://ecomodder.com/forum/opengauge-mpguino-fe-computer.html)
-   -   Modding the MPGuino (https://ecomodder.com/forum/showthread.php/modding-mpguino-5411.html)

ac7ss 10-05-2008 03:27 PM

Modding the MPGuino
 
Came up with an idea the other day for adding lights to the MPGuino.

Previously posted in the MPGuino release one workspace:


I was thinking about adding code for a 'Red / Green' indicator (2 LEDs hooked up to the outputs) Red would come on if instant was lower than Current, Green would come on if instant was higher than tank. Check to see if backlight was not 0 before turning the light on.
Code:

// in header section
#define GreenLed 10     
#define RedLed 11
...
// in setup()
pinMode(GreenLed,OUTPUT);     
pinMode(RedLed,OUTPUT);     
...
// After sei() call in loop()
if(lastActivity != nil){
  if(instantmpg()>tank.mpg()){
    //turn on GreenLed
    digitalWrite( GreenLed, HIGH);
  }else{
    //turn off GreenLed
    digitalWrite( GreenLed, LOW);
  }
  if(instantmpg()>current.mpg()){
    //turn off RedLed
    digitalWrite( RedLed, LOW);
  }else{
    //turn on RedLed
    digitalWrite( RedLed, HIGH);
  }
}else{
  //turn off both lights if we are in sleep mode.
  digitalWrite( RedLed, LOW);
  digitalWrite( GreenLed, LOW);
}

Please check the code, I think this is right. Now just install 2 led's on the 10 and 11 pins with drop resistors.

I feel that this would give an instant, eyes up, indication of your driving efficiency based upon bettering your averages. By basing it on both tank and current you will have 4 different states possible:
  • Green on, Red off: Better than both Tank and Current avg, you are doing it right.
  • Both on or Both off: You are somewhere between current and tank averages, you could be doing better.
  • Red on, green off: You are driving too hard or accelerating.

mkiitmr2 11-14-2008 12:38 PM

While I cant tell you if this is correct or not. I would like to have a single LED on mine to light up when Instant MPG > Tank MPG. Did you ever try this to see if it works out? If it does, maybe I can just wire up a green led to pin 10 and use only the code for instant>tank. Great Idea!

ERIK

ac7ss 11-14-2008 08:54 PM

I have since started driving a new car. So I have not gone ahead with it. Also, not having any feedback on the idea for a month left me without much interest.
After my emergency house re-model, I will look into doing it.

wyatt 11-17-2008 01:44 PM

I have a secondary idea that I thought would be neat. I find myself watching my gallons per hour a lot during accelerations, with my goal of being under .7 or .8 gph. I was thinking the same idea only with gallons per hour would also be very useful, since I have noticed that accelerating more slowly is helping take the edge off the cooler weather. It's a great idea, I haven't tried anything with it yet either, but thought it would be easy enough if I wasn't able to get the hang of the sound my car makes around .8 gph.

mkiitmr2 11-17-2008 04:46 PM

I would really like to know if this code would work okay to light up the led's. Can anyone verify this is written properly?

tangomar 11-18-2008 03:40 PM

Another idea: can we use on of the other analog inputs to monitor a CHT sensor on the plugs? That would be great for other mods (O2 leaning)

stargazerf3a 02-18-2013 12:15 PM

Hey guys! Nice mod!!!

Did anyone tested it yet?
I would like to impliment it to my mpguino but i can not compile it with the canadian version 0.82 it's just drives me crazy :mad:
but nice idea i'll keep trying, if anyone manages to do it please share it with us! :thumbup:

here it seams to be the problem :
instantmpg()>tank.mpg
instantmpg()>current.mpg
They have different names on the canadian version but i can not find them

stargazerf3a 02-18-2013 02:55 PM

if(instantdistanceperfuelunit()>tank.distanceperfu elunit()){
if(instantdistanceperfuelunit()>current.distancepe rfuelunit()){

It does compile it , but is it ok?:confused:


All times are GMT -4. The time now is 01:49 PM.

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