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

Reply  Post New Thread
 
Submit Tools LinkBack Thread Tools
Old 05-13-2011, 07:10 PM   #121 (permalink)
EcoModding Lurker
 
FalconFour's Avatar
 
Join Date: Sep 2010
Location: Fresno, CA
Posts: 78

LEAF - '11 Nissan LEAF
Thanks: 4
Thanked 9 Times in 7 Posts
Kinda on hold, haven't opened the code in a few weeks... I'll be the first to admit my personality has a few flaws, procrastination and lack of inspiration being one :P

I think I may have found a solution to the "dynamic tab array" issue, but I'll have to get my lazy arse back to the coding board to implement it.

In the delay period I'd been thinking about ways to improve the UI responsiveness, and I think I'm going to start making better use of the event timer functionality... by "better use" I believe I may end up implementing the ENTIRE user interface in a chain of timer event functions. Right now it's really only used to time injector delays and a handful of (?) other things... but seeing how simple it is, I think it can be used for the entire user interface! I'll have to play with that idea and see how it works, but if I've gotten this far in the concept, I think the code should be pretty simple once I start to work on it...

  Reply With Quote
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 05-31-2011, 10:41 PM   #122 (permalink)
EcoModding Lurker
 
FalconFour's Avatar
 
Join Date: Sep 2010
Location: Fresno, CA
Posts: 78

LEAF - '11 Nissan LEAF
Thanks: 4
Thanked 9 Times in 7 Posts
Well, there's a little update...

Phi_prompt Liudr's Blog



... You can guess where this is going. And yeah, it works 100% with the MPGuino as well - a 3-button mode is selectable (although a bit tough to navigate, I'll smooth out the wrinkles there somehow), and it's pretty much exactly what I had in mind. I'll have to tweak some things here and there, maybe, but I mean... just look at it! xD

Just define what buttons are what (the analog pins that the buttons use are digital 17, 18, and 19), and pass it a LiquidCrystal object, and it does the rest!
  Reply With Quote
The Following User Says Thank You to FalconFour For This Useful Post:
TOOQIKK (09-01-2011)
Old 06-24-2011, 05:00 AM   #123 (permalink)
EcoModding Lurker
 
FalconFour's Avatar
 
Join Date: Sep 2010
Location: Fresno, CA
Posts: 78

LEAF - '11 Nissan LEAF
Thanks: 4
Thanked 9 Times in 7 Posts
Just a little teaser... make of it what you will
Code:
Trip tmpTrip;
Trip instant;
Trip current;
Trip tank;
// from http://www.parashift.com/c++-faq-lite/pointers-to-members.html#faq-33.7
// ...headache-inducing.
typedef long unsigned int (Trip::*TripFn)(void);
#define CALL_MEMBER_FN(object,ptrToMember)  ((object).*(ptrToMember))
TripFn idxCallers[] = { &Trip::miles, &Trip::gallons, &Trip::mpg, &Trip::mph, &Trip::time, &Trip::eocMiles, &Trip::idleGallons };
char *idxLabelsSm[] PROGMEM={ "Mil",       "Gal",        "MPG",       "MPH",      "H/M",         "EOC",            "Idl"        };
char *idxLabelsLg[] PROGMEM={"Miles",   "Gallons",     "MPG",      "MPH",      "Time",      "EOC Miles",      "Idle Gal"        };

char menuItem00[] PROGMEM = "Edit Display";
char menuItem01[] PROGMEM = "Clear Trip";
char menuItem02[] PROGMEM = "Clear Tank";
char menuItem03[] PROGMEM = "End Trip";
char menuItem04[] PROGMEM = "New Trip";
char menuItem05[] PROGMEM = "Set Clock";
char menuItem06[] PROGMEM = "Preferences";
char menuItem07[] PROGMEM = "System Setup";
char menuItem08[] PROGMEM = "History";
char menuItem09[] PROGMEM = "Switch Screen";
char menuItem10[] PROGMEM = "Screensaver";
char menuItem11[] PROGMEM = "Timeout";
char menuItem12[] PROGMEM = "Info Cycle";
char menuItem13[] PROGMEM = "Show Clock";
char menuItem14[] PROGMEM = "Show Graphic";
char menuItem15[] PROGMEM = "Dim Backlight";
char menuItem16[] PROGMEM = "Backlight";
char menuItem17[] PROGMEM = "Save Default";
char menuItem18[] PROGMEM = "Restore Mode";
char menuItem19[] PROGMEM = "Past 5 Tanks";
char menuItem20[] PROGMEM = "Past 5 Trips";
char menuItem21[] PROGMEM = "Big Display";
char menuItem22[] PROGMEM = "Instant";
char menuItem23[] PROGMEM = "Trip";
char menuItem24[] PROGMEM = "Tank";
I've been working on understanding and extending the phi_prompt library to where I need it to be to use it with this project (which I still don't have a proper name for). Needed to overcome a major limitation with being able to create dynamic menu entries, not just "fixed" ones like those shown above. That way I can display the currently-selected values on the options screens, and create menus based on what needs to be shown at the moment instead of a fixed menu of options for each possible outcome (yuck).

Believe me, I haven't forgotten about this project. It's kind of my "holy grail" of my understanding of avr-libc and Arduino. And for what it's worth, yeah, Arduino is definitely a pretty convoluted build system, but it really helps make the code amazingly portable. After having taken the whole build process apart (code -> libs -> core(->lib) -> link -> hex -> upload), and been able to take Arduino code and run it through AVR Studio's AVR Simulator... or, say, take the build folder and "avr-objdump -dC" the .elf file to step through the assembly, or write an inline ASM definition "optimizer" for time-sensitive functions, or create a rolling buffer of audio data in RAM and use it to generate an echo effect... or intelligently hand off timer-counting responsibilities between Timer0 and Timer2 depending on if Timer2 needs to be active at clk/1 to run a sine-wave tone generator, or if the toner is silent... or created animated sequences using the 16x2 character LCD, or wrote a full fledged, menu-based, self-contained diagnostic and monitoring tool for SMBus Smart Battery protocol-based laptop batteries... or... YES, I've done a SH*TLOAD of work with my Arduinos using the most low-level code imaginable, or just any code that gets the job done.

That said, I have no intention of making some all-in-all disconnection from the Arduino environment. It's astoundingly flexible, and I'll make sure that the ultimate "release distribution" compiles well under both Arduino *and* standard AVR-GCC build environments. I just prefer using Arduino since my physical dev environment *is* Arduino, and other IDEs feel more like dirty hacks than anything. I'm still playing with the idea of using AVR Studio, but it's got a real "unclean" feel to it - ffs, it has C++ support as an "add-on", and half the default build environment options are non-optimal for our setup. Only thing I don't like about Arduino is that it wastes time re-compiling all files each time I do something like a simple "syntax check" build.

Well, enough out of me for now... expect great things in the coming weeks - this thing's been eating at me for a while
  Reply With Quote
Old 06-24-2011, 07:19 AM   #124 (permalink)
dcb
needs more cowbell
 
dcb's Avatar
 
Join Date: Feb 2008
Location:
Posts: 5,032

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: 156
Thanked 264 Times in 207 Posts
Quote:
Originally Posted by FalconFour View Post
...and create menus based on what needs to be shown at the moment instead of a fixed menu of options for each possible outcome...
There are few in computer science problems that cannot be solved by another layer of indirection. Of course those layers may create new problems however, so you have to choose your layers (and problems) carefully
__________________
WINDMILLS DO NOT WORK THAT WAY!!!
  Reply With Quote
Old 06-24-2011, 01:39 PM   #125 (permalink)
EcoModding Lurker
 
FalconFour's Avatar
 
Join Date: Sep 2010
Location: Fresno, CA
Posts: 78

LEAF - '11 Nissan LEAF
Thanks: 4
Thanked 9 Times in 7 Posts
Quote:
Originally Posted by dcb View Post
There are few in computer science problems that cannot be solved by another layer of indirection. Of course those layers may create new problems however, so you have to choose your layers (and problems) carefully
Oh, don't I know it! Spent many late night hours trying to solve one indirect problem caused by trying to solve another problem, so on and so forth. That's why I'm trying to get all the "indirect problems" (like "how can I make it do (this) or (that)") out of the way before jumping head-first into this project

Menu stuff is the easiest part, though... putting together menus of dynamic options is pretty easy with the "dual-mode" mod I came up with in phi_prompt's list-render function. The hard part is finding ways to organize and implement each of the functions I wrote into that sort of "wish list" in the code block above! Most of them were already planned out, but others I just knew it could be done (like "last 5 trips") but hadn't sketched out where to put it, manage it, or display it yet. Those will be the fun parts, but jotting them down now is a good way to remember what still needs to be done, and how far along I am!
  Reply With Quote
Old 09-01-2011, 03:05 PM   #126 (permalink)
slave to the grind
 
TOOQIKK's Avatar
 
Join Date: May 2010
Location: NKY
Posts: 73

Sippy The Slow Sentra - '94 NISSAN SENTRA EX
Team Nissan
90 day: 45.73 mpg (US)
Thanks: 89
Thanked 4 Times in 4 Posts
Send a message via AIM to TOOQIKK
this is all so interesting!! are there any new updates??
falconfour...appreciate what you are doin! i wish i understood code and could write it....but i can do the hardware side and soldering....read schematics and what not...the code side has always left me puzzled....maybe one day ill get around to learning some of it!


F4-ECO....for a name?

like the clock idea,the menu idea, the tack idea, the no zero idea,the battery power display,like the button delay fix idea.....and i want the duck!
a way to switch it off(well the screen at least) or a timed delay to turn off the screen,a usb, and a way to data log to either a MP3 player, ipod, laptop or flash drive would be cool too!(or in real time)
__________________

Last edited by TOOQIKK; 09-01-2011 at 03:12 PM.. Reason: added more text.
  Reply With Quote
Old 09-01-2011, 10:04 PM   #127 (permalink)
slave to the grind
 
TOOQIKK's Avatar
 
Join Date: May 2010
Location: NKY
Posts: 73

Sippy The Slow Sentra - '94 NISSAN SENTRA EX
Team Nissan
90 day: 45.73 mpg (US)
Thanks: 89
Thanked 4 Times in 4 Posts
Send a message via AIM to TOOQIKK
duino name maker! found this thought is was funny
__________________
  Reply With Quote
Old 12-14-2011, 12:22 PM   #128 (permalink)
Master EcoModder
 
Join Date: Oct 2009
Location: Midwest
Posts: 337
Thanks: 4
Thanked 37 Times in 21 Posts
Any updates on this Falconfour? Been about 7 months since I posted on here. I bought a new mpguino and didn't have any problems with the freezing up so I didn't bother to mod mine with your code, was hoping for a new release.

  Reply With Quote
Reply  Post New Thread


Thread Tools




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