View Single Post
Old 11-01-2016, 05:33 PM   #18 (permalink)
t vago
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 682 Times in 437 Posts
Originally Posted by skybolt View Post
I need to call tank size/max tank volume in order to show graphically how much is left. How do I call it using your code?
As it stands now, you don't. All calculations were meant to be performed using SWEET64, as they take up much less program space. 64-bit unsigned integers are not natively supported in the Arduino library, so the orignal 64-bit calculations were performed by many subroutine calls. As I added more and more functionality, I discovered these calls were taking more more and more flash space, so I came up with SWEET64 to combat this issue.

It might be better to code a SWEET64 pseudocode program to generate the bar graph. It so happens, I have done some work on this program. It was originally meant to drive an analog output signal suitable for input to an analog gauge. This was a requested addition to MPGuino that I had worked to add. I just never got around to testing it.

your sendJSON function is straightforward, and the reason why it consumes more RAM is because simpletx is being called with many otherwise-constant strings that are being stored in RAM. Unlike the RAM buffer used to generate decimal representations of numbers, these strings would never ordinarily change. Moving these strings to flash memory should take care of RAM consumption.

Let me work on the code a bit, and I will post what I come up with here.

Originally Posted by skybolt View Post
Also, what is the purpose of dOffsetTankSize? Is it the location of dSizeTankSize in an array, or is it a value (like a reserve fuel value?)
pOffsetTankSize tells MPGuino what address in the EEPROM to read TankSize. pSizeTankSize is the size, in bits, of TankSize.
The Fiat Dakota

The Karen-mobile

The Red Sled
  Reply With Quote