This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

lookup table

i need to write program for motor control using 8051 for different frequencies, can any one suggest me how to write the lookup table .......its urgent please....................

  • What do you mean by that?

    With a lookup table, your "input" value tells you where to look in the table to find your "output" value - what 'C' data structure springs to mind to implement such an approach...?

    Or are you just wondering how to compute the values to go into your table?
    A spreadsheet (eg, MS Excel) is a great tool for that...

    The only thing that's specific to the 8051 here is that you probably should ensure that it goes into CODE space...

  • With a lookup table, your "input" value tells you where to look in the table to find your "output" value - what 'C' data structure springs to mind to implement such an approach...?<p>

    Don't ask such leading questions, or you might get "a switch/case structure" as an answer. ;)

  • which the compiler might then implement as a jump table - which is a type of lookup table!

    :-)