Lil' Blackbox

Coding => v1.0 - v1.1 => Topic started by: Rx7man on May 09, 2015, 09:45:29 PM

Title: Creating an Arduino Library
Post by: Rx7man on May 09, 2015, 09:45:29 PM
OK, I'm putting Eagle on the back burner for a couple days...

I'm throwing myself back on the coding side of it, and since I wasn't aware of much OO possibility when I first wrote my sketch, I'm redoing a lot of it.. In particular, I'm creating a library for the 2D map since I think I'll be using more than one by the time everything is said and done.. they just provide so much flexibility in tuning I think I'll be using one on the AFC control with a stepper motor (or whatever other driver I use) to set a 'base position' and compensate it from there, perhaps again for the VGT position, and definitely one for desired boost.

Should I eventually add a brake controller, it will use one as well to define how hard to brake according to vehicle speed, since I found trailer brakes don't seem to do much unless cranked right up at highway speeds, yet bind up at low speeds.

Wish me luck on it.. I'll probably be needing help along the way somewhere
Title: Re: Creating an Arduino Library
Post by: Rx7man on May 09, 2015, 10:10:57 PM
Well, I didn't get far into it before I realized I seriously need to brush up on my pointer skills.. been 23 years since I took my C++ course and haven't touched it since.. *sigh*...

The main grumble is I can't declare a multidimensional array without knowing the bounds of all but the first one...  I really don't want to hard code the limit.
Title: Re: Creating an Arduino Library
Post by: hakcenter on May 09, 2015, 10:12:18 PM
Make it larger than it will ever be, then later resize down and use memcpy
Title: Re: Creating an Arduino Library
Post by: Rx7man on May 09, 2015, 10:34:43 PM
yeah, I guess that's an option... I think a 20x20 map should be plenty for anything, especially considering you can set the division points as you wish to get more resolution  where you need it.. it still bugs me and I *should* be able to find a way around it.

I was looking at Netduino's.. certainly more $$, but they have they would be so much easier for me to program in!.. they're also 168mhz 32 bit machines with 12bit ADC's..