new to arduino and need some help.

hey folks, i recently saw this arduino stuff and i thought it might be nice to use to make a universal knock detection system for some friends.

one thing that im having a hard time with is making a threshold table based on RPM. as engine speed goes up, overall backround noise goes up. thats why i want a threshold table.

problem is that im not the best programmer and im wondering the best way to implement this.

i need to sample the knock sensor voltage after the coil fires (interrupt), check the rpm and compare the voltage at that rpm point and determine if the knock sensor voltage is higher than the threshold (ie the line).

what i dont know how to do is implement a table and do all the interpolation.

if someone can give me a little guidance, that would be awesome. thanks

Brian

Implement a table as an array, predefine this.

Interpolation, simply search the array until you find the two array entries that lie between your sample, work out how far your sample is from the lower entry as a fraction of the difference between entries, and apply that to the index (array position) you found. Sounds much more complex written down that it actually is.

thanks, i thought that id have to do something like that but i wondered if there was an easier way.

Brian