You should edit your message and place CODE tags around your code. Also for more ease of read, use CTRL T when in the IDE to indent it properly. It will look like that :
const int xpin = A0; // x-axis of the accelerometer
and so on…
These lines of your code are not correct :
float accel_y = ((y - 329.5) / 68.5 * 9.8);
dtostrf(accel_y, 0, 2, text_1);
The variable y is not defined. I guess it is the reading from pin A1. You should add before :
int y = analogRead(ypin);
The use of dtostrf is also incorrect.
char * dtostrf(
signed char __width,
unsigned char __prec,
char * __s)
The dtostrf() function converts the double value passed in val into an ASCII representation that will be stored under s. The caller is responsible for providing sufficient storage in s.
Conversion is done in the format “[-]d.ddd”. The minimum field width of the output string (including the possible ‘.’ and the possible sign for negative values) is given in width, and prec determines the number of digits after the decimal sign. width is signed value, negative for left adjustment.
The dtostrf() function returns the pointer to the converted string s.
The second argument, width, can not be 0. If accel_y is a percentage and possibly negative, then the max format would be -xxx.xx if you want 2 figures after the dot. So the width is no less than 7.
So you need to declare the char array text_1 and write into it:
dtostrf(accel_y, 7, 2, text_1);