Creating an Arduino Library

Started by Rx7man, May 09, 2015, 09:45:29 PM

Rx7man

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
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

Rx7man

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.
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

hakcenter

Make it larger than it will ever be, then later resize down and use memcpy
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.

Rx7man

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..
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles