This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --Message-Boundary-by-Mail-Sender-1111541358 Content-type: text/plain; charset=ISO-8859-1 Content-description: Mail message body Content-transfer-encoding: 8bit Content-disposition: inline > But if you want to give it a try, you should get to the code for > autopilot project. > > http://autopilot.sourceforge.net/ > > It will give you a good place to start. > > Personally I generally use a moving average for similar things. > Very easy to implement and works ok in most situations. Before my first post at piclist I did a good search on google. The algorithm is complex and above my skills for now. A moving average won't work for my application, as it needs to predict the next sample. I am trying this code and verifying how good it is. ERROR(n-1) = ERROR(n) ERROR(n) = ERROR(n-1) + SAMPLE(n) - SAMPLE(n+1) SAMPLE(n+1) = SAMPLE(n) * 2 - SAMPLE(n-1) + ERROR(n) SAMPLE(n) is the reading from sensor. --Message-Boundary-by-Mail-Sender-1111541358 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist --Message-Boundary-by-Mail-Sender-1111541358--