View Single Post
Old 11-01-2016, 06:33 PM   #18 (permalink)
t vago
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Hungary
Posts: 1,807

iNXS - '10 Opel Zafira 111 Anniversary

Suzi - '02 Suzuki Swift GL
Thanks: 829
Thanked 708 Times in 456 Posts
Quote:
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.

Quote:
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.
  Reply With Quote