Suggestion about Sparki library.


#1

:bulb: Is it possible to separate different modules of Sparki library into independent files/classes.
Currently the Sparki library is inside the “hardware\arduino…” folder instead of the regular “library” folder. And all the different modules are all crammed inside the 2000 line Sparki.cpp file. As a result, a lot of redundant code takes a lot of flash and RAM. The default program, which does not seems to be that complex, has already taken 20kb of flash, and there’s only 8kb left for me to do anything else.
Wouldn’t it be helpful to separate different modules to make it more efficient?
If we can choose which library to be imported, it would be more flexible, I think.

I tried to modified the code to delete stuffs that I don’t need, but that file is 2000 line long, and having to do this for every single project is extremely painful.

Thx :slight_smile:


#2

Its large because it enables all parts of the robot be default. It could be written smarter with conditional enable/defines so that it only loads the part as needed. The biggest RAM eater by far is the LCD. I’ll be having a method to disable that in the next update.


#3

Have there been any further developments on this suggestion? It seems the most recent response was two years ago. I am having a problem merely uncommenting the NO_LCD define. The AVR editor will not let me save the alteration.


#4

Looks like you’re looking for our memory management lesson:
arcbotics.com/lessons/sparki-memory-management/