EcoModder.com

EcoModder.com (https://ecomodder.com/forum/)
-   OpenGauge / MPGuino FE computer (https://ecomodder.com/forum/opengauge-mpguino-fe-computer.html)
-   -   MPGuino custom characters? Some optimisation suggestions (https://ecomodder.com/forum/showthread.php/mpguino-custom-characters-some-optimisation-suggestions-10872.html)

meelis11 11-05-2009 08:56 AM

MPGuino custom characters? Some optimisation suggestions
 
Hey,
has anybody made custom characters which are more descriptive than "LK" example?
I somewhere saw pictures, where somebody had made custom characters for example "L/100km" - it was made with 2 chars - first char was showing "L\n/1" and second "km\n00" - "\n" means newline - so imagine it as
"L/ km"
" 100"
Would be nice to know how to make them or link where I can get info.

One good hack/optimisation for code also:
I put clear screen commands before every screen change - now that half second when it shows screen name, it is only name - second line is clear. Now you can delete all trailing spaces in screen names and other strings. As a result you should save some bytes (did not count but it was less than before and screen names are clear to read)

inside setup()
Code:

 
  LCD::LcdCommandWrite(B00000001);  // clear display, set cursor position to zero       
  LCD::LcdCommandWrite(B10000);  // set dram to zero

  //LCD::gotoXY(0,0); //no need for it, clear display already made gotoxy(0,0)
  //LCD::print(getStr(PSTR("OpenGauge      ")));
  LCD::print(getStr(PSTR("OpenGauge"))); 

  //LCD::gotoXY(0,1);     
  //LCD::print(getStr(PSTR("  MPGuino  v0.75")));
  LCD::gotoXY(2,1);     
  LCD::print(getStr(PSTR("MPGuino  v0.75")));

inside loop()
Code:

  //LCD::gotoXY(0,0); //no need for it, clear display sets it gotoxy(0,0)
  //is any of three buttons is pressed, clear display
  if( !(buttonState&lbuttonBit)  || !(buttonState&mbuttonBit) || !(buttonState&rbuttonBit) ){
      LCD::LcdCommandWrite(B00000001);  // clear display, set cursor position to zero
  }

  //see if any buttons were pressed, display a brief message if so     
  if(!(buttonState&lbuttonBit) && !(buttonState&rbuttonBit)){
      LCD::print(getStr(PSTR("Setup"))); //remove trailing spaces "Setup " -> "Setup"
      initGuino();
  }
  //....code continues

Meelis

Sebastian 11-05-2009 01:22 PM

The problem is, you don't have enough free chars for all abbreviations. A minimum of three chars is required for the "big" display numbers. The maximum number of chars is 8, so 5 left. And if you insert the chars from the more beautiful big numbers mod, nothing is left. So you would have to rewrite the chars memory in LCD every time you need the other set.

But if you get a beautiful solution, it would be fine :)

PS: I made an excel sheet and resized the cells so they form the LCD pixels. You can fill the black dots with an X an leave other empty. It's a fast method to create chars and see how they will look like.


All times are GMT -4. The time now is 07:55 AM.

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