AVR CAN Bus Project: LeafCAN v1.2 Released

Another tweak today, I added instantaneous battery power consumption in KWh to the second line of the display. In order to make room, I had to do away with the V and A characters after the voltage and current draw. Here is the new display:

The top line, from left to right, contains Battery Pack Remaining KWh, SOC (“GIDs”), SOC % (GIDs/281*100), and Remaining Fuel Bars.
The bottom line now contains Battery Pack Voltage, Battery Pack Current Draw (Amps), and Battery Power Consumption (Pack Voltage * Pack Amps).

For users who prefer the old display, I added:

#define SHOW_KWH
#define SHOW_KW

If you comment out both lines, the display will be the same as v1.0, but with the smoothing that was added in v1.1.

As usual can download the latest release from github: https://github.com/lincomatic/LeafCAN/downloads.

Previous: AVR CAN Bus Project: LeafCAN v1.1 Released

8 thoughts on “AVR CAN Bus Project: LeafCAN v1.2 Released”

  1. Hi. I’m new to Adruino, so please excuse me if I’ve made some basic mistake. I am an experienced C/embedded engineer.

    I’m trying to set up to compile LeafCAN so I can try some changes and I ran into a couple of issues I wanted to let you know about.

    First, 1.0/at90can/cores/at90can is missing WProgram.h. I copied it over from 0023 to allow main.cpp to compile. Hopefully, it doesn’t require any changes.

    Second, in the LeafCAN sketch, line 216 is failing to compile with “no matching function for call” on Serial.write. Since it’s the logging code which is turned off anyway, I just commented out that line. It would be nice to figure out what is going wrong, though.

    Thanks for all of your work

    1. I made some fixes to the 1.0 branch just now, and installed it into a clean download of 1.0.2. Please give it a shot.
      You should not have had to copy WProgram.h. That was an error on my part. Arduino 1.0+ uses Arduino.h instead.
      I also fixed the issue with Serial.write(buf,len).

  2. FYI, I went ahead and downloaded Arduino 0023 and inserted the 0023 folder from at90can and LeafCAN compiled fine, with no changes.

    This gets me going but you should probably take a look at what’s happening in 1.0.2.


  3. I just tried 1.0.2 with your fixes to at90can. Looks good. I was able to build and flash to the board.


  4. Thank you for posting your work with this. I’m developing an open source device module for vehicle control and management and had decided on going with Arduino on an AT90CAN128. After ordering the breakout boards and other supplies, I thought to myself that surely someone else as already done some work in this area. Last night I came across your work and was very happy to see that you were using the same hardware that I thought would be good. I look forward to trying out your software and recommendations.

    1. You project looks pretty interesting. I will be releasing V2 of LeafCAN soon. The preliminary code is in the development branch on github.

Leave a Reply