Good way to divide 10bit adc by 4?

1. ## Good way to divide 10bit adc by 4?

Looking to convert a 10 bit 0 - 1023 adc reading to 0 - 255. I've tried dividing by 4, dividing by 2 and putting into a byte then dividing that byte by 2 but I keep getting errors. Is there a better way to do this? Thanks.

2. Did you find this post helpful? |

## Re: Good way to divide 10bit adc by 4?

Left shift 2 bits is my favorite way to do so. But you can only do this to an unsigned value.

3. Did you find this post helpful? |

## Re: Good way to divide 10bit adc by 4?

Originally Posted by falingtrea
Left shift 2 bits is my favorite way to do so. But you can only do this to an unsigned value.
Shouldn't that be Right Shift 2 ?

4. Did you find this post helpful? |

## Re: Good way to divide 10bit adc by 4?

Why not save the program space and execution time by using the ADC in 8-bit mode instead. Same result as far as I can see, ie throw away the the two least significant bits.

/Henrik.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts