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

Reply  Post New Thread
 
Submit Tools LinkBack Thread Tools
Old 09-27-2013, 12:33 PM   #91 (permalink)
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Hungary
Posts: 1,807

iNXS - '10 Opel Zafira 111 Anniversary

Suzi - '02 Suzuki Swift GL
Thanks: 829
Thanked 708 Times in 456 Posts
Quote:
Originally Posted by Ardent View Post
Also, when waking the unit from sleep-mode by pressing the LEFT, RIGHT or CENTER button, "Current Reset" is displayed.
Yah, that's actually deliberately coded in. If a button press is used to wake the code up from sleep mode, the code ignores the button press. Additionally, the original 0.86 behavior is retained by resetting the current trip. It's just that the current reset function is now called, which will display that brief message.

I've been meaning to make that choice a setup parameter entry, of whether to have the current trip reset when the unit is woken up.

  Reply With Quote
The Following User Says Thank You to t vago For This Useful Post:
Ardent (09-27-2013)
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 09-27-2013, 12:40 PM   #92 (permalink)
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Hungary
Posts: 1,807

iNXS - '10 Opel Zafira 111 Anniversary

Suzi - '02 Suzuki Swift GL
Thanks: 829
Thanked 708 Times in 456 Posts
Quote:
Originally Posted by Ardent View Post
Here are some backlight code changes I like: (items need to be placed in their proper locations)

Code:
//Backlight range changes
const uint8_t brightness[] PROGMEM = { 0, 85, 170, 255 }; //middle button cycles through these brightness settings

const char brightString[] PROGMEM = {
   "HIGH\0"
   " MED\0"
   " LOW\0"
   " OFF\0"
};

//Changed 0 to 3 for OFF while sleeping
LCD::setBright(3); // set backlight brightness to zero
//Initial brightness
uint8_t brightnessIdx = 2;  //brightness at startup. 2 = LOW
//Descriptive brightness labels
void doNextBright(void) {
	brightnessIdx++;
	if (brightnessIdx >= brightnessLength) brightnessIdx = 0;
	LCD::setBright(brightnessIdx);
	printFlash(PSTR("Backlight = "));

   printStr(brightString, brightnessIdx);
   clrEOL();
   gotoXY(0, 1);
   clrEOL();

	holdDisplay = holdDelay;
}
Done. I've added the above code in (made a few changes - hope you don't mind). I've made it selectable at compile-time via a "#define".
  Reply With Quote
Old 09-27-2013, 12:41 PM   #93 (permalink)
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Hungary
Posts: 1,807

iNXS - '10 Opel Zafira 111 Anniversary

Suzi - '02 Suzuki Swift GL
Thanks: 829
Thanked 708 Times in 456 Posts
Quote:
Originally Posted by AndrzejM View Post
I think you should try to A-B-A test that
Heh!
  Reply With Quote
Old 09-27-2013, 01:31 PM   #94 (permalink)
EcoModding Apprentice
 
Join Date: Jun 2010
Location: Virginia
Posts: 114
Thanks: 33
Thanked 56 Times in 38 Posts
Quote:
Originally Posted by t vago View Post
Interesting. Are you using the traditional button setup, or are you using analog buttons?
Just the ordinary tactile buttons in the default Fundamental Logic setup.
  Reply With Quote
Old 09-27-2013, 01:32 PM   #95 (permalink)
EcoModding Apprentice
 
Join Date: Jun 2010
Location: Virginia
Posts: 114
Thanks: 33
Thanked 56 Times in 38 Posts
Quote:
Originally Posted by t vago View Post
Yah, that's actually deliberately coded in.
Oh. Ooops.
  Reply With Quote
Old 09-27-2013, 01:34 PM   #96 (permalink)
EcoModding Apprentice
 
Join Date: Jun 2010
Location: Virginia
Posts: 114
Thanks: 33
Thanked 56 Times in 38 Posts
Quote:
Originally Posted by t vago View Post
(made a few changes - hope you don't mind)
Hardly. You appear to be a capable coder; I'm just a brute-force hack.
  Reply With Quote
Old 09-27-2013, 05:04 PM   #97 (permalink)
EcoModding Apprentice
 
Join Date: Dec 2012
Location: Portugal
Posts: 197
Thanks: 93
Thanked 70 Times in 64 Posts
Quote:
Originally Posted by t vago View Post
The tank size is a parameter that can be edited in the settings, just like metric mode, the inactivity timeout, and that humongous microseconds per fuel quantity number. I think it was present in the original 0.86 code, but it was never really used. The tank size parameter is affected by metric mode - if metric mode is set, the tank size is displayed and entered/edited as liters. Otherwise, it's in US gallons.
Ok that was the idea I had. I do not know if it still exists pins available, but one idea was to have a pin that measures the resistance of the tank level indicator and adjusts the liters / Galon of Fuel automatically.
Example my Honda with full tank has a resistance of 5 ohms, half full 32.5 ohms, and empty 105 ohms, not all cars tenhem the same value of resistance, but I think it should be possible to find a way to calibrate the tank .
This is just an idea, if it is too complicated to try out, do not waste your time.


I will test this new update, then inform you of how it went, I'll try with AnalogButtons, to see if does not reset as did before.

Thank you
José Rodrigues
  Reply With Quote
Old 09-28-2013, 04:26 AM   #98 (permalink)
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Hungary
Posts: 1,807

iNXS - '10 Opel Zafira 111 Anniversary

Suzi - '02 Suzuki Swift GL
Thanks: 829
Thanked 708 Times in 456 Posts
If you do try the analog buttons, don't use that R-2R thingy in the other thread - I could not get it to work at all on my Arduino Uno. I suspect it was because the internal pullup resistor in my chip was sufficiently different from nickdigger's setup - those things can vary by as much as 20 kohm, I've read. So, I went with a more traditional setup. Instead of the resistance values at that link, I used what I had available in my resistor bin - 1K, 2.2K, 4.7K, 10K, 22K, and 47K. I used 1K for R1, 2.2K for R2 (which was button 1), 4.7K for R3 (button 2), 10K for R4, (button 3), and so on.

I agree that it'd be neat to calibrate the fuel gauge against what the MPGuino read out. It'd just be necessary to be able to ensure that the voltage coming off of the gauge resistor would not exceed 5 VDC, in addition to ensuring that you'd get a variable voltage off the circuit. Should be rather simple to implement, really. My code is set up so that all you have to do to read an analog voltage value is to do something like:
Code:
unsigned int v = analogValue[channel];
Was able to duplicate the button bug that Ardent reported, and I think I figured out why it was happening. I think it has something to do with the fact that buttonState is continually updated via the main timer interrupt, and was allowed to change as it was being compared to values in the valid button press table. I modified the code to copy buttonState to another variable (gee, like the Trip values), and had the code compare that variable against the valid button press table, instead. This appears to have made the bug disappear.
  Reply With Quote
The Following User Says Thank You to t vago For This Useful Post:
Ardent (09-28-2013)
Old 09-28-2013, 05:26 AM   #99 (permalink)
EcoModding Apprentice
 
Join Date: Dec 2012
Location: Portugal
Posts: 197
Thanks: 93
Thanked 70 Times in 64 Posts
To remove any doubt, the scheme should I use is what is depicted in the image?



Thank you
José Rodrigues

Last edited by josemapiro; 09-28-2013 at 06:10 AM..
  Reply With Quote
Old 09-28-2013, 09:40 AM   #100 (permalink)
EcoModding Apprentice
 
Join Date: Jun 2010
Location: Virginia
Posts: 114
Thanks: 33
Thanked 56 Times in 38 Posts
Quote:
Originally Posted by t vago View Post
. . . This appears to have made the bug disappear.
Nice.

  Reply With Quote
Reply  Post New Thread






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