How to convert analogRead value from accelerometer

Perhaps a stupid answer, but let's try it :

You said :
gvalue = [(ADCvalue * 3) / 1024 - 1.5] / 0.3 = [(ADCvalue * 3) / 1024 - (15/10)] / (3/10) = [(ADCvalue * 10) / 1024 - 5]

Assuming that << 10 divide by 1024

this 'll give you :

[((ADCvalue * 10)<<10) - 5] = [((ADCvalue * 5)<<9) - 5] , but you will loose decimal precision

But if your target precision is around 1/10 of g (look at the datasheet or depend on what you want to do), you can compute :

10gvalue = [((ADCvalue * 510)<<9) - 5*10] = [((ADCvalue * 25)<<8) - 50]

This way you can avoid float

Not sure of what I am doing :-[, but CosineKitty (the Math expert) can probably confirm.

Nicolas