Thank you MWS for the suggestion. I shall again try the ElmChan code to understand.
The calibration part I removed, because I did not put much attention to it, as I think it is not much important for me. When it is started it would show a number like 1700 (+- 40) without touch, when touched the number will increase to 4000 (+-). It happens always, like after restart. What to calibrate here? If it is restarted while being touched, how to calibrate automatically?
The number changes if the size of foil changes (even for measuring water level the number would differ for the size of tank and material used to make the tank, plus other factors). That means different value for different project. So for a project I think 1st the number shown while 'untouched', has to be recorded, either in the code or option to write in eeprom. I don't know how to do this (determine 'untouched' state) automatically with calibration.
If I find some pseudo code for calibration, may be I could understand that, and the necessity of it. I shall try to find more about this.
Best regards.
↧