A basic question but I am trying to understand how to implement an array with pre-measured analog values. I have 600 values because my sensor is not linear. So sensorvalue of 300 = outputvalue 1, sensorvalue of 301 = outputvalue 3, sensorvalue of 302 = outputvalue 4 etc.I have all the values for each step measured, but instead of creating 600 lines (if sensorvalue == 300. serialPrint 1) I know it must be easier to use array.I am dumb in how to define and call this array.So if my analogread value is the 10th value it must fetch the 10th value from an output array, correct?

How do you implement such a structure and how to call it?Sorry for the basic question.

I guess i am stupi and stilldont understand. I used the tutorial to try this out and just getting garbage out.

I can make it work with a small array without PROGMEM, but as soon as I try to add too many elements I see no output at all in the monitor, just a blank screen. maybe this is due to memory.So I want to try PROGMEM, same result,So I reduce the elements to small array and get wrong values returned.Here is the code.#include <avr/pgmspace.h>

Given the noise on the Arduino ADC most of the time only 8 bits are significant. This implies that a lookup table of size 256 should be sufficient in practice.

Assuming the lookup table makes a nonlinear function you could use multiMap() to make a far shorter lookup table. MultiMap() uses the most important points and interpolates between them if needed. A full description see - http://arduino.cc/playground/Main/MultiMap -