In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Beau Schwabe wrote: Matthias09, #2 and #3 combined [code] ' {$STAMP BS2} ' {$PBASIC 2.5} N VAR Nib DataIn VAR Word MaxValue VAR Word MinValue VAR Word DataTotal VAR Word Average VAR Word MaxValue = 0 MinValue = 65535 DataTotal = 0 FOR N = 1 TO 5 IF DataIn > MaxValue THEN MaxValue = DataIn ENDIF IF DataIn < MinValue THEN MinValue = DataIn ENDIF DataTotal = DataTotal + DataIn NEXT Average = (DataTotal - MaxValue - MinValue) / 3 [/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=175860#m395425 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)