That code gets 16 samples not 10. You just have to limit the samples from 16 to 5. But this is not very useful. Leave it as it is for ironing out the noise or parasites in the signal.
Here you will find snippets of working code that will help save you time. Please help add to our collection of examples by contributing code that you have written.
Re: Hserout questions
For a 4Mhz timing at 9600 baud
Scampy Today, 11:50Register settings
RCSTA = $90 ' Enable serial port & continuous receive
TXSTA = $20 ' Enable transmit, BRGH = 0
SPBRG = 25 ' 9600 Baud @ 0.16%...