Scaling ADC question

I want to scale the readadc (256 values) to give 80 values distributed across the range, since I can only use whole numbers does anyone know a way to do this?

Maths is not my strong point, so please don't take the p*ss if it is blindingly obvious:)

EDIT I know I need to divide by 3.2
 

Technical

Technical Support
Staff member
Dividing by 3.2 is the same as multiplying by 10 then dividing by 32

result = result * 10 / 32
 
Top