In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Beau Schwabe wrote: Matthias09, Your 25 samples assumes that the [green]DataBuffer[/green] and [green]Avg[/green] start out as Zero. On your very first sample do this... Avg = New DataBuffer = Avg * Samples ... and then apply this to any samples that follow... DataBuffer = DataBuffer - Avg + New Avg = DataBuffer / Samples ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=175860#m382575 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)