i'll suggest you something else, take a few reading of your signal with the internal adc, store those data into array or internal EPROM and play with. Refering to a table will be much easier and much code efficient. BUT it's my own opinion, probably Melanie or somebody else have a better solution.
Bookmarks