rotate bytes in array


Results 1 to 19 of 19

Threaded View

  1. #14
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default Re: rotate bytes in array

    Hi, Art

    a good question to ask : do you need to store the 30 values for another purpose than calculate your mean value ???

    because @ each measurement you could calculate:

    new_meanval = (old_meanval*29 + last_measure) /30 ... which gives you the mean value over the 30 lasts measurements ! ( called "rolling average", if I'm right )

    note here 32 measures would be best for dividing time ! so :

    new_meanval = (old_meanval*31 + last_measure) >> 5 ...

    I think Darrel posted a while ago a nice routine about that ...

    I remember he also posted about a 48 level stack ... may be ideas to take there ...

    Alain
    Last edited by Acetronics2; - 15th March 2012 at 09:26.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts