In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Beau Schwabe wrote: Matthias09, The variable [green]Samples[/green] is fixed to the number of samples that you want to average. The value on this depends on how you define [green]DataBuffer[/green] and what the highest value you get from [green]New[/green] For instance, if you can only define [green]DataBuffer[/green] as a WORD, and the highest value you get from [green]New[/green] is 50, then the maximum number of [green]Samples[/green] that can be averaged is 1310. [65535 / 50 = 1310.7 Likewise, if you define [green]DataBuffer[/green] as a WORD, and the highest value you get from [green]New[/green] is 255, then the maximum number of [green]Samples[/green] that can be averaged is 257. [65535 / 255 = 257 Your Input variable is [green]New[/green], while your Output variable is [green]Avg[/green] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=175860#m382515 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)