This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Processing RSSI Value

At the moment I am collecting 64 RSSI values into an array and want to calculate the average and variance of them. I have managed to calculate the average by adding up the values during collection but trying to find the deviation after the collection phase is not working. It seems as though the RSSI values have just been forgotten and a random variance value is spat out. I have attached the code below and highlighted where the code seems to be going wrong. Any observations or recommendations would be much appreciated! Apologies in advance for the novice level code. Thanks!

Parents Reply Children
  • No the first time, assuming it is in the zerovars section which would be the default, but since it is not created within the function it will retain its previous value on the next calculation (if any), which of course would cause an error. Ideally istdcount = 0; should be added at the end of the calculation ready for the next time, or better at the beginning of that calculation loop.

Related