Suggestion about Sparki library.

The Easy Robot for Everyone!

Suggestion about Sparki library.

Postby dingdinglhz » Wed Jun 04, 2014 8:04 pm

:idea: 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 :)
dingdinglhz
 
Posts: 6
Joined: Tue Jun 03, 2014 4:04 pm

Re: Suggestion about Sparki library.

Postby roboalchemist » Thu Jun 05, 2014 8:13 pm

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.
---
Joseph Schlesinger - ArcBotics Co-Founder/CTO
roboalchemist
Site Admin
 
Posts: 669
Joined: Mon Jul 16, 2012 3:02 am

Re: Suggestion about Sparki library.

Postby tonycmo » Thu Dec 01, 2016 2:49 am

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.
tonycmo
 
Posts: 1
Joined: Thu Nov 17, 2016 5:34 pm

Re: Suggestion about Sparki library.

Postby roboalchemist » Fri Dec 02, 2016 8:25 pm

Looks like you're looking for our memory management lesson:
http://arcbotics.com/lessons/sparki-memory-management/
---
Joseph Schlesinger - ArcBotics Co-Founder/CTO
roboalchemist
Site Admin
 
Posts: 669
Joined: Mon Jul 16, 2012 3:02 am


Return to Sparki

Who is online

Users browsing this forum: Google [Bot] and 3 guests

cron