When creating microcontroller firmware, you often need to work with data arrays. Tables make easy work of data arrays, such as those for digital-code transformation, correction for sensor linearity, sophisticated calculations, and multiple output organization. Table 1 shows how you can organize data in a table. Outputs A, B, and C have values based on the input value, V.rnWhen using a lookup table, choose the proper microcontroller input and outputs. Assign values for input and outputs data in Table 2. These data can consist of constants in binary, hexadecimal, or decimal format or names. For names, you should assign a constant value to each one.
展开▼