I have an Xbee configured as receiver and Arduino (standalone w/ atmega328p chip) connected together. The RSSI pin of the Xbee is connected to one of the Arduino Board PWM pin. I used the PulseIn to get the digital equivalent of the RSSI (i named it rssiDur) I used the Hyperterminal to display the rssiDur value. The rssiDur values displayed on the HT is not consistent. Any interference between my Xbees changes the rssiDur dramatically. I wish to stabilize the rssiDur reading so that the interference will not be of great effect.
it has been suggested to use a timer. i don't know how though. it was something like when the rssiDur displays 10 consecutive of the same value, that value will be the rssiDur. ( example: 9 9 9 9 9 9 9 9 9 9 8 8 6 7 10, rssiDur=9) Does anyone know how to do this? Or any suggestions on how to treat the values of rssiDur? it will much help on our project.
**Update: Hi again! I used the Average Library but I am still getting outliers every now and then for example: (copied from HT)
:
25
4
25
27
25
20
32
1
24
24
20
20
27
28
20
22
20
19
1
3
19
18
20
20
1
20
how do you throw out the outliers? Will it be advisable if I used a double Mode filter?