Hi,

im currently working on a project where a TX sends a packet, the packet is picked up by the RX and the RX echoes back another packet. The echoed packet is picked up by the TX, and the signal strength and echoed packet is then sent through UART to a Single board computer as a string.

As the signal strength is inconsistent, i am trying to get the average of 3 of the same packets before sending the information through the UART. I am really new to C programming and I hope yall can help!

this is part of my code: (rssi is the signal strength)

insert
Code:
 /* Check the packet against what was transmitted */
        int16_t status = memcmp(returnCheck, rxPacket, checkLength);






        if(status == 0)
        {
            /* Toggle LED1, clear LED2 to indicate RX */
            PIN_setOutputValue(ledPinHandle, Board_PIN_LED1,
                               !PIN_getOutputValue(Board_PIN_LED1));
            PIN_setOutputValue(ledPinHandle, Board_PIN_LED2, 0);


            char buff[20];  // take a chance that 10 is always enough
            sprintf(buff,"%s %d",rxPacket,RSSIout);
            UART_write(uart, buff, strlen(buff));




        }