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-12-2017, 04:42 PM   #121 (permalink)
EcoModding Apprentice
 
Join Date: Dec 2012
Location: Portugal
Posts: 197
Thanks: 93
Thanked 70 Times in 64 Posts
Hi t vago
The problem of waking up that I had before, with this change did not happen again.
But I encountered a problem while scrolling through the setings, when it was. "Scratchpad (odo?)" It does not proceed as it should, it goes to the definition of this parameter, the same happens when I run in the opposite direction, When it is used, the "P(Fuel) Pa" it goes to the definition of this parameter.
Also the name of the parameter in some situations does not erase the name of the previous parameter being visible in the following as you can see in the video.
A correction that should also be made was with the "AutoSave" that should only save when you make a new trip and not only because you pressed the button, also the message that shows "AutoSave Done" should disappear after 1 or 2 seconds, And display again the screen that was before the autosave.

https://youtu.be/KcBTZwrR4QA

https://youtu.be/M9AfyjfGD4g

Thanks
José Rodrigues

  Reply With Quote
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 05-14-2017, 08:06 PM   #122 (permalink)
deviant
 
Join Date: Oct 2016
Location: Seattle, WA
Posts: 69

s2k - '02 Honda s2000
Thanks: 12
Thanked 47 Times in 35 Posts
Quote:
Originally Posted by meelis11 View Post
Hi,
I am Meelis …
Quote:
Originally Posted by t vago View Post
Keep us posted
OK, I've fixed the blown Zener on my meelis board, so I've got that working. In my effort to now blow any more arduinos I decided to base my interface board on meelis' design which is a little different than the others. After reverse-tracing much of the board using Fritzing, I found this reference to the meelis design: MPGuino schematic - MPGuino - Meelis P

I have some questions before I proceed -- I have fried some boards due to back flow -- (power coming in on the vss and existing on who knows what, the fuel injector or ground perhaps) -- do the extra components I mention below address this, and is that why I've been blowing boards, due to simple mistakes?

1. This design (link) shows an electrolytic (or at least polarized) capacitor bridging the 7805 output and ground. All other designs show an unpolarized cap, and everything I've seen shows a nonpolarized ceramic cap in this spot. This cap is similar in function to the 330uf that bridges the input voltage and ground -- which is polarized. Shouldn't the .1uf cap also be polarized?

2. You have an 'extra' .1uf capacitor on the hot (12v) side of the 7805 regulator. So there's a 330uf polarized and 0.1uf nonpolarized. These are to smooth the circuit -- why is the 0.1uf cap here as well? I have seen situations (without the 0.1uf on the 12v input of the 7805) where there is proper voltage but the arduino browns-out (insufficient current). Could my lack of the 0.1uf cap contribute to this?

3. You have an 'extra' 50k resistor on the VSS input: input-->50k--->zener and 50k independently bridge ground). Why is this here? Is there a 12v tendency to cook arduinos on this circuit? (I've seen 12v come in across the vss at times)

4. You have a 0.01uf cap on the VSS -- why? All of these caps appear to be low-pass R/C circuits. Would this have settled down our other poster's Alfa Romeo that had close to 16*10^6 pulses per mile?

Once i know more I will start soldering together a prototype board with the 7805, and vss/fuel in channels. The design will be to use the adafruit button/LCD shield on an Arduino Pro Mini (and a tinycurtcits arduino) both of which are 3.3v 8MHz 328s. Then I'll post my results here.
  Reply With Quote
Old 05-15-2017, 01:37 PM   #123 (permalink)
deviant
 
Join Date: Oct 2016
Location: Seattle, WA
Posts: 69

s2k - '02 Honda s2000
Thanks: 12
Thanked 47 Times in 35 Posts
Also, t_vago and meelis11: Why, oh why is there an array of 2 .22pf capacitors and a 16MHz crystal (q1) connected to GND (pin 8), AGND (pin 22), 9 and 10 (PB6/XTAL1TOSC1 and PB7/XTAL2/TO8C2)? The ATMEGA328 already has an onboard clock, and so without any code changes, this part of the circuit would be ignored, correct?
  Reply With Quote
Old 05-18-2017, 08:06 PM   #124 (permalink)
deviant
 
Join Date: Oct 2016
Location: Seattle, WA
Posts: 69

s2k - '02 Honda s2000
Thanks: 12
Thanked 47 Times in 35 Posts
fDevelopment back on track. I've managed to duplicate an MPGuino using a 3.3v board, which is necessary to transmit data to the pi without a voltage converter like this one.

I kept frying Arduino Pro Minis -- or so I thought. I gave up on that particular board but I suspect the on-board voltage regulator was overheating. When I switched development to a tinycirctuits tinyduino, the results were much different. In short, it worked as expected.

The first piece of the puzzle is a car-to-board interface. I used a blank prototype board and based the circuit on meelis' 3 resistor design:



Then I soldered the necessary pins to the tinyduino prototype board, letting me quickly connect and disconnect the board using the 28-pin connector. This makes updates super simple.



Since this is still a prototype (I still need to perfect the interface board), I bundled the two pieces (now connected) to a raspberry pi. I used this particular case for the pi as there are few opportunities for a short circuit.

I put the entire thing behind the stereo head unit:
and then sealed it all up (well, I pushed the stereo unit back into position):


Very clean, very professional looking, no more wires sticking out of the side off the dash. The two small looms you see allow me to connect to the Adafruit LCD shield for tank resets and any other housekeeping. I also wired up the Adafruit's reset button, which forces the tinyduino to reset the LCD, which doesn't work well if it's connected to an already-running arduino. (The adafruit buttons can't be used to reset the backlight, as they seem to need to be provisioned or addressed at boot time. (I think this has to do with the i2c bus).

My next order of business is: Leverage the program's internal timer to vary the JSON output every couple of seconds. For example, every two seconds the 'subtitle' on the bottom graph could cycle between displaying drag race data, tank/trip data; or primary and extended drag race data. I see a number of timers scattered throughout the code, so I'll use them as a template. This will address a primary limitation of the JSON/Pi approach, limited screen real-estate.



I've taken my own functions (a copy of the doOutputJSON function, plus a blink function) and I can drop them into newer code revisions as I continue development. This should keep me far from the dreaded code fork.

Last edited by skybolt; 05-19-2017 at 12:11 PM.. Reason: trying to fix lame dropbox permissions issue
  Reply With Quote
The Following 2 Users Say Thank You to skybolt For This Useful Post:
josemapiro (06-17-2017), t vago (10-15-2017)
Old 06-16-2017, 12:40 PM   #125 (permalink)
deviant
 
Join Date: Oct 2016
Location: Seattle, WA
Posts: 69

s2k - '02 Honda s2000
Thanks: 12
Thanked 47 Times in 35 Posts
Clean shield, better code

Here's the finalized v1 pi shield. The tinyduino attaches at the top and can be easily unplugged from the shield using the cartridge-style connector.



It includes both a 3.3v and 5v regulator, as the Tinyduino needs to run from a 3.3v source in order to have the tx pin put out 3.3v. Even though it's a 3.3v board, it will accept 5v, run at 5v and if given a 5v source, will put out 5v on the Tx pin, which will cook the rx pin on the pi. This design avoids the need for a logic voltage converter.

There is lots of Kapton tape in this design, as the 3.3v regulator has a very unusual design -- the center pin is the output voltage, and so the heat sink at the top is also the output voltage. To avoid bridging this with the ground on the 7805 5v regulator, I wrapped the 3.3v heart sink with Kapton tape. The picture above shows a mica shield, but the mica eventually tore away from the pins at the bottom (hey, they're fragile) and would freely rotate around the hole cap. Exit, mica, enter Kapton.

Tinycircuits also includes a physical extension shield, which is then connected via a AWM 20624 80C 60V VW-1 32-pin FFC Flexible Flat Cable. Unfortunately, the stock Tinycircuits cable is a bit short, about 5 inches. But, it does help. (See ribbon cabler on this older design):


I will get a screen shot of the DRAG READY, etc. readout on the Pi. It's quite handy.

Question: Is anyone else still active on this thread?
  Reply With Quote
The Following 3 Users Say Thank You to skybolt For This Useful Post:
Joggernot (07-16-2017), josemapiro (06-17-2017), t vago (10-15-2017)
Old 06-16-2017, 12:43 PM   #126 (permalink)
deviant
 
Join Date: Oct 2016
Location: Seattle, WA
Posts: 69

s2k - '02 Honda s2000
Thanks: 12
Thanked 47 Times in 35 Posts
Updated JSON function

Here is the updated JSON function, in zip form and in CODE block

Code:
void doOutputJSON(void) //skybolt added json output function
{
  digitalWrite(LED_BUILTIN, LOW);
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)


  uint64_t instFuelEcon;
  uint64_t tankFuelEcon;
  uint64_t tankFuelEcon53;
  //if->then using timerChecker allows for changing the subtitle to show multiple lines of information
  uint32_t timerChecker = cycles0(); //wastes 20 bytes but ensures all lines will change on the same cycle

  unsigned long reserveQuantity = SWEET64(prgmReserveFuelRemaining, 0);
#ifdef usePartialRefuel
  unsigned long tankSize = eepromReadVal(pTankSizeIdx) + eepromReadVal(pRefuelSizeIdx);
#else // usePartialRefuel
  unsigned long tankSize = eepromReadVal(pTankSizeIdx);
#endif // usePartialRefuel

  text::stringOut(devLogSerial, PSTR("\n\n[")); // begin JSON payload
  

  // first graph, fuel
  text::stringOut(devLogSerial, PSTR("{\"title\":\""));
    if (reserveQuantity == 0) text::stringOut(devLogSerial, PSTR("fumes remaining, ")); // fumes left
  else doOutputNumberJSON(prgmReserveFuelRemaining, 0, 3, PSTR(" \xfbgal\xfcL\xfd remaining, ")); // reserve remaining fuel left
  doOutputNumberJSON(prgmBingoFuelRemaining, 0, 3, PSTR(" \xfbgal\xfcL\xfd e-reserve\",\n")); // bingo remaining fuel left
//  doOutputNumberJSON(instantIdx, tEngineSpeed, 0, PSTR(" RPM\",\n")); // rpm to test latency only vs tachometer and LCD vs raspi indicator (expect 2x looptime)
if (  (timerChecker / 100) % 8000 > 4000 ) {
  text::stringOut(devLogSerial, PSTR("\"subtitle\":\"fuel used: "));
  
  doOutputNumberJSON(currentIdx, tFuelUsed, 3, PSTR(" trip \xfbgal\xfcL\xfd; ")); // current trip fuel used
  doOutputNumberJSON(tankIdx, tFuelUsed, 3, PSTR(" tank \xfbgal\xfcL\xfd; ")); // tank trip fuel used
  doOutputNumberJSON(instantIdx, tFuelRate, 3, PSTR(" using \xfbgal\xfcL\xfd/hr\",\n")); // current rate of fuel burn in units/time

} else {
  text::stringOut(devLogSerial, PSTR("\"subtitle\":\"eco stats: "));
#ifdef trackIdleEOCdata
  doOutputNumberJSON(eocIdleTankIdx, tFuelUsed, 3, PSTR(" \xfbgal\xfcL\xfd used@idle, "));
  doOutputNumberJSON(eocIdleTankIdx, tDistance, 1, PSTR(" \xfbmi\xfckm\xfd fuel cut\",\n"));
#else
  if (reserveQuantity == 0) text::stringOut(devLogSerial, PSTR("fumes remaining, ")); // fumes left
  else doOutputNumberJSON(prgmReserveFuelRemaining, 0, 3, PSTR(" \xfbgal\xfcL\xfd remaining, ")); // reserve remaining fuel left
  doOutputNumberJSON(prgmBingoFuelRemaining, 0, 3, PSTR(" \xfbgal\xfcL\xfd e-reserve\",\n")); // bingo remaining fuel left
#endif
}

  reserveQuantity = eepromReadVal(pTankBingoIdx);

  text::stringOut(devLogSerial, PSTR("\"ranges\":[")); //ranges do not have to be in order, d3js libraries will auto sort, so you can make it easier to read the code by changing the order
  doOutputNumberJSON(tankSize, 3, PSTR(",")); // largest, full tank size (e.g, 13.8 g)
  doOutputNumberJSON(tankSize - reserveQuantity, 3, PSTR(",")); // full tank less reserve (e.g.13.8g - 2.2g = 11.6g)
  doOutputNumberJSON(reserveQuantity, 3, PSTR("],\n")); // reserve amount (e.g. 2.2g)

  text::stringOut(devLogSerial, PSTR("\"measures\":["));
  doOutputNumberJSON(prgmReserveFuelRemaining, 0, 3, PSTR(",")); // reserve remaining fuel left
  doOutputNumberJSON(prgmRemainingFuel, 0, 3, PSTR("],\n")); // total remaining fuel left

  text::stringOut(devLogSerial, PSTR("\"markers\":["));
  doOutputNumberJSON(instantIdx, tFuelRate, 3, PSTR("]},\n\n")); // current rate of fuel burn in units/time

  // second graph, distance  
  text::stringOut(devLogSerial, PSTR("{\"title\":\""));
  doOutputNumberJSON(prgmReserveDTE, tankIdx, 2, PSTR("\xfbmi\xfckm\xfd to e, ")); // distance to bingo
  doOutputNumberJSON(prgmBingoDTE, tankIdx, 2, PSTR(" \xfbmi\xfckm\xfd e-reserve\",\n")); // distance to fully empty tank from bingo

if (  (timerChecker / 100) % 8000 > 4000 ) {
//   text::stringOut(devLogSerial, PSTR("\"subtitle\":\"trip/tank distance: "));
//   doOutputNumberJSON(currentIdx, tDistance, 2, PSTR(" \xfbmi\xfckm\xfd/")); // current trip distance
//   doOutputNumberJSON(tankIdx, tDistance, 2, PSTR(" \xfbmi\xfckm\xfd\",\n")); // current trip distance
  text::stringOut(devLogSerial, PSTR("\"subtitle\":\""));
  doOutputNumberJSON(currentIdx, tDistance, 2, PSTR(" \xfbmi\xfckm\xfd trip distance, ")); // current trip distance
  doOutputNumberJSON(tankIdx, tDistance, 2, PSTR(" \xfbmi\xfckm\xfd tank distance\",\n")); // current trip distance

  } else {
  text::stringOut(devLogSerial, PSTR("\"subtitle\":\""));
  doOutputNumberJSON(prgmFindReserveRange, tankIdx, 2, PSTR(" \xfbmi\xfckm\xfd safe range, ")); // reserve range
  doOutputNumberJSON(prgmFindRange, tankIdx, 2, PSTR(" \xfbmi\xfckm\xfd dry range\",\n")); // distance to fully empty tank
  }

  text::stringOut(devLogSerial, PSTR("\"ranges\":["));
  doOutputNumberJSON(prgmFindRange, tankIdx, 1, PSTR(",")); // maximum range
  doOutputNumberJSON(prgmFindReserveRange, tankIdx, 1, PSTR(",")); // range 2, safe range
  doOutputNumberJSON(prgmFindHalfReserveRange, tankIdx, 1, PSTR("],\n")); // range 3, half of safe range

  text::stringOut(devLogSerial, PSTR("\"measures\":["));
  doOutputNumberJSON(prgmFindBingoRange, tankIdx, 2, PSTR("],\n")); // shows miles of e-reserve in bar form

  text::stringOut(devLogSerial, PSTR("\"markers\":["));
  doOutputNumberJSON(tankIdx, tDistanceToEmpty, 2, PSTR("]},\n\n")); // line is distance to empty





  // third graph, econ
  text::stringOut(devLogSerial, PSTR("{\"title\":\"")); //\xfbgal\xfcL\xfd/	
  #ifdef useDragRaceFunction
//   text::stringOut(devLogSerial, PSTR("("));  
//   doOutputNumberJSON(lastAccelTestStatus, 3, PSTR(") "));
//   doOutputNumberJSON(msInstantIdx, tSpeed, 3, PSTR(" ")); // current fuel economy

  // if (accelerationFlags & accelTestTriggered) {  //display if we are waiting for a drag start  
  // there was a bug in some of the drag cancel logic when using Adafruit. I disabled some statements
  // to get it to work. (Was tripping at 0.718 or 0.0718 seconds (don't remember exact digits)
  //some kind of bit mask; full and half-speed seem to be backwards (0 means tripped)
  //unclear on syntax for building if/then statements
    //accelerationFlags & accelTestTriggered
    // 120, waiting
    // 184, testing. 
    // 176, distance met. 
    // 160, distance and half-speed met. (Full speed then meets all conditions, test ends)
    // 168 half-speed met. (not distance)
    // 136 full-speed met. (Meeting distance then meets all three conditions, race ends). 
    // what the hell is 156? Did this actually come up? 
	// lastAccelTestStatus = 120; //use to force trigger
	
  if (lastAccelTestStatus == 120) {  //display if we are waiting for a drag start  
  text::stringOut(devLogSerial, PSTR("Drag Ready ...\",\n"));
  //did these in reverse order when i was checking for bits, with numbers order is irrelevant
  } else if (lastAccelTestStatus == 136) { //display once test started //too hard to reverse engineer and/or/contains | &, from numeric tests. Numbers work fine. 
  text::stringOut(devLogSerial, PSTR("Full speed reached ...\",\n"));  
  } else if (lastAccelTestStatus == 168) { //display at half speed
  text::stringOut(devLogSerial, PSTR("Half-speed reached ...\",\n")); 
  } else if (lastAccelTestStatus == 176) { //display at half speed
  text::stringOut(devLogSerial, PSTR("Distance reached ...\",\n"));  
  } else if (lastAccelTestStatus == 184) { //display once test started
  text::stringOut(devLogSerial, PSTR("Testing ...\",\n"));    
  } else if ( lastAccelTestStatus == 160) { //display once test started
  text::stringOut(devLogSerial, PSTR("Half-speed and distance reached ...\",\n"));  
  } else { //else not racing or waiting, go to normal
  text::stringOut(devLogSerial, PSTR("trip/tank/inst: ")); //\xfbgal\xfcL\xfd/	
  doOutputNumberJSON(currentIdx, tFuelEcon, 3, PSTR("/ ")); // current fuel economy
  doOutputNumberJSON(tankIdx, tFuelEcon, 3, PSTR("/ ")); // tank fuel economy
  reserveQuantity = doCalculate(instantIdx, tFuelEcon);
  if (reserveQuantity > 9999999) text::stringOut(devLogSerial, PSTR("infinite\",\n"));
  else doOutputNumberJSON(instantIdx, tFuelEcon, 3, PSTR("\",\n")); // instantaneous fuel economy
 }
  
  if ( ( ((timerChecker / 100) % 12000) > 8000) ) { 
  //1 & 2 seconds display
  text::stringOut(devLogSerial, PSTR("\"subtitle\":\"accel time: 0-"));
  doOutputNumberJSON(eepromReadVal(pDragSpeedIdx) / 2, 0, PSTR("/"));
  doOutputNumberJSON(eepromReadVal(pDragSpeedIdx), 0, PSTR(": "));
  doOutputNumberJSON(dragHalfSpeedIdx, tAccelTestTime, 2, PSTR("/")); // 0-30 time
  doOutputNumberJSON(dragFullSpeedIdx, tAccelTestTime, 2, PSTR(", ")); // 0-60 time
  doOutputNumberJSON(dragDistanceIdx, tDistance * 1, 2, PSTR("\xfbmi\xfckm\xfd in ")); // trap distance
  doOutputNumberJSON(dragDistanceIdx, tAccelTestTime, 2, PSTR(" @")); // trap time
  doOutputNumberJSON(dragDistanceIdx, tSpeed, 3, PSTR("\xfbmph\xfckph\xfd; ")); // trap speed
  doOutputNumberJSON(dragHalfSpeedIdx, tEstimatedEnginePower, 0, PSTR("\xfbhp\xfckW\xfd @")); // estimated engine power
  doOutputNumberJSON(dragHalfSpeedIdx, tDragSpeed, 0, PSTR("\xfbmph\xfckph\xfd\",\n")); // max speed
  } else { 
//"subtitle":"accel fuel: 0.000 (0.00mpg) to 15, 0.000 (0.00mpg) to 30; 0.000 (0.000) to 0",
  text::stringOut(devLogSerial, PSTR("\"subtitle\":\"accel fuel: "));
  
//   this dumps the flag values to the screen  
//   text::stringOut(devLogSerial, PSTR("("));
//   doOutputNumberJSON(lastAccelTestStatus, 3, PSTR(" ")); 
//   text::stringOut(devLogSerial, PSTR(" "));
//   doOutputNumberJSON(accelTestActive, 3, PSTR(" ")); //0.128
//   text::stringOut(devLogSerial, PSTR(" "));
//   doOutputNumberJSON(accelTestTriggered, 3, PSTR(" ")); //0.064
//   text::stringOut(devLogSerial, PSTR(" "));
//   doOutputNumberJSON(accelTestFullSpeed, 3, PSTR(" ")); //0.032
//   text::stringOut(devLogSerial, PSTR(" "));
//   doOutputNumberJSON(accelTestHalfSpeed, 3, PSTR(" ")); //0.016
//   text::stringOut(devLogSerial, PSTR(" "));
//   doOutputNumberJSON(accelTestDistance, 3, PSTR(" ")); //0.008
//   text::stringOut(devLogSerial, PSTR(" "));
//   doOutputNumberJSON(accelTestCancelled, 3, PSTR(" ")); //0.004
//   text::stringOut(devLogSerial, PSTR(" "));
//   doOutputNumberJSON(accelTestFinished, 3, PSTR(") ")); //0.002
  if ( ( ((timerChecker / 100) % 12000) > 4000) ) { 
  doOutputNumberJSON(dragHalfSpeedIdx, tFuelUsed, 3, PSTR("\xfbga\xfcL\xfd to ")); // 0-half fuel
  doOutputNumberJSON(eepromReadVal(pDragSpeedIdx) / 2, 0, PSTR(", ")); // 0-half speed
  doOutputNumberJSON(dragFullSpeedIdx, tFuelUsed, 3, PSTR("\xfbga\xfcL\xfd to ")); // 0-full fuel
  doOutputNumberJSON(eepromReadVal(pDragSpeedIdx), 0, PSTR(", ")); // 0-full speed
  doOutputNumberJSON(dragDistanceIdx, tFuelUsed, 3, PSTR("\xfbga\xfcL\xfd to ")); //trap fuel
  doOutputNumberJSON(dragDistanceIdx,  tDistance * 1, 2, PSTR("\xfbmi\xfckm\xfd\",\n")); // "to [trap distance]"  \xfbft\xfcm\xfd; 
} else {
  doOutputNumberJSON(dragHalfSpeedIdx, tFuelEcon, 3, PSTR("\xfbmpg\xfcL100\xfd to ")); // 0-30 mpg
  doOutputNumberJSON(eepromReadVal(pDragSpeedIdx) / 2, 0, PSTR(", ")); // 0-half speed
  doOutputNumberJSON(dragFullSpeedIdx, tFuelEcon, 3, PSTR("\xfbmpg\xfcL100\xfd to ")); // 0-60 mpg
  doOutputNumberJSON(eepromReadVal(pDragSpeedIdx), 0, PSTR(", ")); // 0-60 speed
  doOutputNumberJSON(dragDistanceIdx, tFuelEcon, 3, PSTR("\xfbmpg\xfcL100\xfd to ")); //trap mpg 
  doOutputNumberJSON(dragDistanceIdx,  tDistance * 1, 2, PSTR("\xfbmi\xfckm\xfd\",\n")); // "to [trap distance]"  \xfbft\xfcm\xfd; 

}

}  

#else
  text::stringOut(devLogSerial, PSTR("\"subtitle\":\"[this space intentionally left blank]\",\n"));
#endif

  text::stringOut(devLogSerial, PSTR("\"ranges\":[18,24,"));
//  text::stringOut(devLogSerial, PSTR("\"ranges\":["));
//  doOutputNumberJSON(2 * fuelEconomyFIRvalue / 3, 3, PSTR(",")); // 2/3 averaged instantaneous fuel economy over time
//  doOutputNumberJSON(fuelEconomyFIRvalue, 3, PSTR(",")); // averaged instantaneous fuel economy over time
  doOutputNumberJSON(
  min(
  max(40000,  doCalculate(instantIdx, tFuelEcon))
  , 999000),
  3, PSTR("],\n")); // set scale at 40mpg or instant econ up to 999 mpg. Folks like to watch their mpg meter go to extremes

  text::stringOut(devLogSerial, PSTR("\"measures\":["));
  doOutputNumberJSON(currentIdx, tFuelEcon, 3, PSTR(",")); // current fuel economy
  doOutputNumberJSON(tankIdx, tFuelEcon, 3, PSTR("],\n")); // tank fuel economy

  text::stringOut(devLogSerial, PSTR("\"markers\":["));
  doOutputNumberJSON(
    min(
      999000,   //do not let scale exceed 999
      doCalculate(instantIdx, tFuelEcon))
//    instantIdx, tFuelEcon
    , 3
    , PSTR("]")); // instantaneous fuel economy
//  doOutputNumberJSON(5 * fuelEconomyFIRvalue / 3, 3, PSTR("]\xfd")); // 5/3 averaged instantaneous fuel economy over time
//   text::stringOut(devLogSerial, PSTR("\}]\r")); // end JSON payload, and go trigger read on python.script
  text::stringOut(devLogSerial, PSTR("\}]\n")); // end JSON payload, and go trigger read on python.script
  text::stringOut(devLogSerial, PSTR("\r")); 
}  //end sendJson function
Attached Files
File Type: zip last_known_good_json_method.c.zip (3.7 KB, 28 views)
  Reply With Quote
The Following 2 Users Say Thank You to skybolt For This Useful Post:
josemapiro (06-17-2017), t vago (10-15-2017)
Old 06-16-2017, 04:08 PM   #127 (permalink)
deviant
 
Join Date: Oct 2016
Location: Seattle, WA
Posts: 69

s2k - '02 Honda s2000
Thanks: 12
Thanked 47 Times in 35 Posts
Acceleration screen

Note 3rd graph title for drag status. Drag does not end until both full speed and distance are reached.

Hypermiler use:
Accelerate as slowly or smoothly as possible
Try and keep total fuel used as low as possible
View results for half-speed, full-speed and full distance, in both fuel use form and total fuel form. Results in 3rd graph subtitle

Speed demon use:
Drive it like you stole it
Do not crash at 1/4 speed, consider using .1 mile instead
View times, and how much fuel you wasted. Or, compare to hypermiler run
Results in 3rd graph subtitle





View results after completion of race.
Persists until next race or until Arduino is restarted.
  Reply With Quote
The Following 2 Users Say Thank You to skybolt For This Useful Post:
josemapiro (06-17-2017), t vago (06-19-2017)
Old 06-17-2017, 03:25 PM   #128 (permalink)
EcoModding Apprentice
 
Join Date: Dec 2012
Location: Portugal
Posts: 197
Thanks: 93
Thanked 70 Times in 64 Posts
Hi skybolt
Lately I have not had much time, but sometimes I cross the forum, today was one of those days and undoubtedly a fantastic job.
Congratulations on this great work.

Thanks
José Rodrigues
  Reply With Quote
The Following User Says Thank You to josemapiro For This Useful Post:
skybolt (06-20-2017)
Old 07-15-2017, 06:58 PM   #129 (permalink)
EcoModding Apprentice
 
Join Date: Dec 2012
Location: Portugal
Posts: 197
Thanks: 93
Thanked 70 Times in 64 Posts
I was watching a video on YouTube and crashed into another video that seemed interesting to me.
I think with the lcd of these may be to increase the level of MPGuino even more, making graphics more attractive and easy to use.

https://www.itead.cc/display/nextion.html

José Rodrigues
  Reply With Quote
The Following User Says Thank You to josemapiro For This Useful Post:
t vago (07-16-2017)
Old 07-16-2017, 12:39 AM   #130 (permalink)
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Hungary
Posts: 1,808

iNXS - '10 Opel Zafira 111 Anniversary

Suzi - '02 Suzuki Swift GL
Thanks: 831
Thanked 709 Times in 457 Posts
Quote:
Originally Posted by josemapiro View Post
I was watching a video on YouTube and crashed into another video that seemed interesting to me.
I think with the lcd of these may be to increase the level of MPGuino even more, making graphics more attractive and easy to use.

https://www.itead.cc/display/nextion.html
Looks really nice. Apparently you can also order these screens with optional general purpose input-output pins, too. Might look into these when things have settled down here.

  Reply With Quote
The Following User Says Thank You to t vago For This Useful Post:
josemapiro (07-20-2017)
Reply  Post New Thread


Tags
mpguino, peak and hold





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