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-30-2013, 07:34 PM   #111 (permalink)
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Cedar Rapids, IA
Posts: 1,766

The Karen-Mobile - '05 Dodge Magnum SXT
Team Dodge
90 day: 26.72 mpg (US)

Fiat Dakota - '00 Dodge Dakota SLT RWD Quad Cab
90 day: 16.67 mpg (US)

The Red Sled - '01 Dodge Durango SLT 4WD
90 day: 16.96 mpg (US)
Thanks: 799
Thanked 681 Times in 437 Posts
Quote:
Originally Posted by josemapiro View Post
I've been testing the Multiplexed Analog buttons, and it works but not correctly, the first and third seem to do the same functions
Do you mean that pressing the 1st button does the same thing as pressing the 3rd buttton?
Edit: Also, please make sure to check this post - link - This should fix problems with the code not correctly recognizing button presses.

Quote:
Originally Posted by josemapiro View Post
, as the middle button only changes the brightness,
The middle button behaves as it should, then. The middle button is supposed to cycle through brightness settings in most modes, and it should cycle through digits when in settings change mode. If you press (precionar?) and hold down the middle button for a second or so, it should display the CPU loading.

Quote:
Originally Posted by josemapiro View Post
and pro comportace times as the first,
I do not understand - sorry.

Quote:
Originally Posted by josemapiro View Post
the extra 1 to precionar appears (btn 8 pressed), the extra 2 has not tested because had no 47k resistance.
Yah, that's supposed to happen. The "extra 1" and "extra 2" buttons have not yet been defined to do much of anything in the code, other than have the code say "Button xxx pressed". Eventually, I was going to figure out whether to have 4 arrow keys with a center "enter" button, or buttons that were configured such as for the ScanGauge II.

Quote:
Originally Posted by josemapiro View Post
What is the tolerance of the resistors you used? I'm using resistors with 5% tolerance.
Mine are 5% tolerance, too.

Quote:
Originally Posted by josemapiro View Post
I think the problem I'm having now, has to do with the values ​​that each sends resistance, which may vary slightly and complicate the whole process, but at least I can see the system moving.
That's a start. We can work from there to debug this, if there is a bug.

__________________
The Fiat Dakota


The Karen-mobile


The Red Sled

Last edited by t vago; 09-30-2013 at 07:41 PM..
  Reply With Quote
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 09-30-2013, 07:52 PM   #112 (permalink)
EcoModding Apprentice
 
Join Date: Jun 2010
Location: Virginia
Posts: 114
Thanks: 33
Thanked 56 Times in 38 Posts
Quote:
Originally Posted by josemapiro View Post
I think the problem I'm having now, has to do with the values ​​that each sends resistance, which may vary slightly and complicate the whole process, but at least I can see the system moving.
You should be able to monitor the values that the Arduino sees by adding something like the following where "X" corresponds to the analog pin being used:
Code:
Serial.print("adcX = ");
Serial.println(adcX);
. . . and then open the Serial Monitor.
  Reply With Quote
Old 09-30-2013, 08:35 PM   #113 (permalink)
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Cedar Rapids, IA
Posts: 1,766

The Karen-Mobile - '05 Dodge Magnum SXT
Team Dodge
90 day: 26.72 mpg (US)

Fiat Dakota - '00 Dodge Dakota SLT RWD Quad Cab
90 day: 16.67 mpg (US)

The Red Sled - '01 Dodge Durango SLT 4WD
90 day: 16.96 mpg (US)
Thanks: 799
Thanked 681 Times in 437 Posts
I recommend this:

Code:
//#define useSerialPortDataLogging true	// Ability to output 5 basic parameters to a data logger or SD card
//#define useBufferedSerialPort true		// Speed up serial output
...
#define useSerialDebugOutput true

...

	pushHexWord(analogValue[2]);
	pushSerialCharacter(13);

...
then, just re-comment them, once you're done.
__________________
The Fiat Dakota


The Karen-mobile


The Red Sled
  Reply With Quote
Old 10-01-2013, 08:29 AM   #114 (permalink)
EcoModding Apprentice
 
Join Date: Jun 2010
Location: Virginia
Posts: 114
Thanks: 33
Thanked 56 Times in 38 Posts
I tested the button code change and it doesn't seem to address the glitch I'm seeing.

I have figured out the usage scenario where it crops up and a usage workaround though.
  • If a different button is pressed, it must be pressed slowly to not register as the same button press.

It is particularly noticed when changing settings. When pressing a different button, a slow (~0.25s) press is required. If just "clicked" the click is registered as the previous button pressed.

To reproduce:
  1. Press LEFT+RIGHT to enter settings.
  2. Slow click (~0.25s+) the RIGHT button.
  3. Next, a "quick-click" to either the MIDDLE or LEFT button changes to the next screen that should display by pressing the RIGHT button. This continues indefinitely unless the "click" is slowed to a "press".
  Reply With Quote
The Following User Says Thank You to Ardent For This Useful Post:
t vago (10-01-2013)
Old 10-01-2013, 02:32 PM   #115 (permalink)
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Cedar Rapids, IA
Posts: 1,766

The Karen-Mobile - '05 Dodge Magnum SXT
Team Dodge
90 day: 26.72 mpg (US)

Fiat Dakota - '00 Dodge Dakota SLT RWD Quad Cab
90 day: 16.67 mpg (US)

The Red Sled - '01 Dodge Durango SLT 4WD
90 day: 16.96 mpg (US)
Thanks: 799
Thanked 681 Times in 437 Posts
I duplicated the effects of this bug, according to Ardent's instructions. It appears to be a fairly serious bug with the debouncing code. The bug does not appear to care whether analog or traditional buttons are configured.

I'll take a look at it, either tonight or tomorrow.
__________________
The Fiat Dakota


The Karen-mobile


The Red Sled
  Reply With Quote
The Following User Says Thank You to t vago For This Useful Post:
Ardent (10-01-2013)
Old 10-01-2013, 02:56 PM   #116 (permalink)
EcoModding Apprentice
 
Join Date: Dec 2012
Location: Portugal
Posts: 197
Thanks: 93
Thanked 69 Times in 64 Posts
Quote:
Originally Posted by t vago View Post
Do you mean that pressing the 1st button does the same thing as pressing the 3rd buttton?
Edit: Also, please make sure to check this post - link - This should fix problems with the code not correctly recognizing button presses.
Had already done this fix.


Quote:
The middle button behaves as it should, then. The middle button is supposed to cycle through brightness settings in most modes, and it should cycle through digits when in settings change mode. If you press (precionar?) and hold down the middle button for a second or so, it should display the CPU loading.

I do not understand - sorry.
Very rarely when you press the middle button it does not alter the brightness, and showed the same sequence that shows when pressing the left.

Quote:
Yah, that's supposed to happen. The "extra 1" and "extra 2" buttons have not yet been defined to do much of anything in the code, other than have the code say "Button xxx pressed". Eventually, I was going to figure out whether to have 4 arrow keys with a center "enter" button, or buttons that were configured such as for the ScanGauge II.
Why not use a system of 3 or 5 buttons, but with a different operation, stop using the buttons on the left, middle and right, and move to using a (top), (bottom), (OK), (yes) and (no).
The operation would be to (top) advance the menu to (bottom) retreat, and (OK) defined the choice, in some menus might be used (yes) and (no) to confirm the choice.


Quote:
then, just re-comment them, once you're done.
The results I got were:
Without pressing any button the result was: 03FF
Pressing the left: 02BC and 02BD or 02BE
Pressing the middle button: 034D or 034E and 034F
Precionando right: 03A2 or 03A3 and 03A4
Pressing the extra1: 03D3 or 03D4 and 03D2
Extra 2 still have no results.

Thank you
Josť Rodrigues

Last edited by josemapiro; 10-01-2013 at 03:07 PM..
  Reply With Quote
Old 10-01-2013, 03:06 PM   #117 (permalink)
EcoModding Apprentice
 
Join Date: Dec 2012
Location: Portugal
Posts: 197
Thanks: 93
Thanked 69 Times in 64 Posts
Quote:
Originally Posted by Ardent View Post
I tested the button code change and it doesn't seem to address the glitch I'm seeing.

I have figured out the usage scenario where it crops up and a usage workaround though.[LIST][*]If a different button is pressed, it must be pressed slowly to not register as the same button press.
Probably is the same mistake that I mentioned with the middle button, causing it to behave as the previous button.
  Reply With Quote
Old 10-01-2013, 03:21 PM   #118 (permalink)
EcoModding Apprentice
 
Join Date: Jun 2010
Location: Virginia
Posts: 114
Thanks: 33
Thanked 56 Times in 38 Posts
Thanks for checking; hopefully it won't be too onerous to fix.
  Reply With Quote
Old 10-02-2013, 12:32 AM   #119 (permalink)
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Cedar Rapids, IA
Posts: 1,766

The Karen-Mobile - '05 Dodge Magnum SXT
Team Dodge
90 day: 26.72 mpg (US)

Fiat Dakota - '00 Dodge Dakota SLT RWD Quad Cab
90 day: 16.67 mpg (US)

The Red Sled - '01 Dodge Durango SLT 4WD
90 day: 16.96 mpg (US)
Thanks: 799
Thanked 681 Times in 437 Posts
I hope so, too. I found what I believe to be the problem, and have substantially re-written the debounce code to correct the problem. I will be testing the fix tonight, when I get back to my test MPGuino hardware setup.
__________________
The Fiat Dakota


The Karen-mobile


The Red Sled
  Reply With Quote
Old 10-02-2013, 05:06 PM   #120 (permalink)
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Cedar Rapids, IA
Posts: 1,766

The Karen-Mobile - '05 Dodge Magnum SXT
Team Dodge
90 day: 26.72 mpg (US)

Fiat Dakota - '00 Dodge Dakota SLT RWD Quad Cab
90 day: 16.67 mpg (US)

The Red Sled - '01 Dodge Durango SLT 4WD
90 day: 16.96 mpg (US)
Thanks: 799
Thanked 681 Times in 437 Posts
Got the button press debounce fix working. (current MPGuino code version is at first post of this thread)

Debounce timing adjustments may be made by adjusting the following two lines in the code.

Code:
const unsigned int keyDelay = (unsigned int)(t2CyclesPerSecond / 256ul);
const unsigned int keyShortDelay = keyDelay - (5 * keyDelay / 100); // wait 5/100 of a second before accepting button presses

__________________
The Fiat Dakota


The Karen-mobile


The Red Sled

Last edited by t vago; 05-11-2014 at 02:32 PM.. Reason: current MPGuino code version is at first post of this thread
  Reply With Quote
The Following 2 Users Say Thank You to t vago For This Useful Post:
AndrzejM (10-03-2013), Ardent (10-02-2013)
Reply  Post New Thread


Thread Tools




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