Quote:
Originally Posted by JamesTerm
That is brilliant! I am looking forward to reviewing this C example code! 
|
Example C code is in the zip (culverdrive_sw_release.zip). It isn't great, and isn't tested like the LV implementation, but should illustrate how the logic works.
interp.c and interp.h are C implementations of the LV interpolation functions. I tested these on a desktop GCC build/test harness and they work. We use these in the Culverdrive to define smooth enabling of different terms, and use them elsewhere for nonlinear functions. They're very useful functions. I can explain their use in more detail if anyone is interested.
culverdrive.h is the header, self explanetory.
The logic itself is written and commented in culverdrive.c in the culver_drive() function. The const data is defined in culverdrivedata.c.
There are some things that are a little weird about the C code. I intended to run it on Vex targets, but it won't compile in RobotC because RobotC does not support the C language very well.