Table in supplimentary code

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
Chris_MIRA
Posts: 186
Joined: Wed Jan 23, 2013 3:43 pm
Has thanked: 2 times
Been thanked: 21 times
Contact:

Table in supplimentary code

Post by Chris_MIRA »

Hi,
Im trying to learn how to place a table in supplementary code then use it in a programme. The attached programme (taken from "30 PIC projects in FC6 by Bert Van Dam" does this BUT the programme doesn't seem to work, it just retrurns 0.0 regardless of input, Im guessing that the table is set up wrong or the instruction to read a point in the table is wrong? Please help, or is there another example (from youtube perhaps) that I could follow?
Regards,
Chris
Attachments
ATF ratio.fcfx
(9.02 KiB) Downloaded 198 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Table in supplimentary code

Post by Benj »

Hi Chris,

Code in the supplementary code window will not simulate and can be a bit tricky to work with. In v6 we have added a component called a Look up table. If you go to the component search and type in LUT then it should appear. This will generate the same C code but should also simulate and provide macros to access the values.

Here is some help on the LUT component.
http://www.matrixtsl.com/wiki/index.php ... e3c95d86ab

Chris_MIRA
Posts: 186
Joined: Wed Jan 23, 2013 3:43 pm
Has thanked: 2 times
Been thanked: 21 times
Contact:

Re: Table in supplimentary code

Post by Chris_MIRA »

That is very cool!
Thanks very much for both your help and speed of reply!
Regards,
Chris

Post Reply