Acceleration Sensor BMA020

Well if you're confident you have it wired up correctly and the above code is not returning a 2 then there may be something wrong with the sensor. I can see that your link has additional pins on the breakout board. Do you have a link to that schematic by any chance?