Single Axis Accelerometer Breakout Board - ADXL193 +/-250g

I need some help with this sensor. I can't seem to find any sample code and also am not an experienced programmer. If anyone has some sample code for this sensor your help would be appreciated.

Sensor output goes to an anlog input. Read the datasheet..: It says ouput is 8mV/g

float a;

void setup()

void loop() 
 a = (analogRead(A0)-511) * 4.8875855 ; //millivolt
 // 5/1023=0,0048875855 V/step
 a = a / 8; // 8mV/g
 // all calc can be done in one calculation
 Serial.println(a,2); // G-value
 // shoud be 0 when not moving
 // expect small values when 'shaking'

Do you have code that I could try to use?

Read datasheet to find if ST shoud be wired hi og low. Data out to A0 to match example..

Thanks, I am still getting negative values. Im not sure as to why this is happening

small nes is OK . Change the numer 511 up/down a litte till you get 0 out when still.

thanks it works now. It moves about 1-2 everytime I shake it. Is this expected? thanks for your help.

OK... you mangage to shake it with 2G.. Tap it on the table.. you'll reach 10G+ (if program reads at the right momemt)

This sensor is best used to measure akseleration in rockets at launch.. ..or inn collision tests