Allocating memory for ADC samples

Hi, I am currently designing a project where I need to take a sample from one of the ADC's on my arduino board every 3 seconds. I need to save 200 samples (i.e. 10 minutes worth) which are sent back to a PC once they are requested.

the problem I have is that the ADC resolution is 10-bit. I initially thought it was 8-bit so I defined an array of type byte with 200 locations. My questions is, is there anyway to define memory in 10-bit words or must I use type int? (Which I presume allocates way more bits than actually required?) I am worried that I may not have enough memory for other parts of the program.

Alternatively, if I cannot allocate the memory more economically, is there a way to ignore the 2 lsb's of the 10-bit sample and still use a byte of memory for each sample at reduced resolution.

Thanks for any ideas

200 "int" samples (16 bits), so 400 bytes. It ain't gonna break the bank (unless you've got a huge program with lots of other variables.

You can ignore the 2 LSB's by shifting the read value right by 2 bits:

(unsigned char) (analogRead(pin) >> 2)

Thanks for the replies. I didn't realise an int was only 16 bits, well in that case I'll use ints. I always thought an int was 32 bits but that must be a float.

Anyway I think I should be ok using ints and if not I can use the method described in the second post to shift to the right.

Thanks again for the advice.

I always thought an int was 32 bits

The size of an int is implementation dependant, so it can be 32 bits, but on the AVR, it's 16.