How to use MM8452 and Bluesmirf Gold together!!HELP!!!

I am doing a project which needs to transmitting the accelerometer data via bluetooth. I am using ATMEGA 328, Bluesmirf gold and an accelerometer MMA8452. However, i cannot successfully transmit the accelerometer data via bluetooth.When not sending accelerometer data, the bluetooth module works fine. I couldn’t find the reason. Could someone give me some help on this? I attached my code for ATMEGA 328 below. Thank you soooooooooo much!!!

/*Hardware hookup:
  Arduino --------------- MMA8452Q Breakout
    3.3V  ---------------     3.3V
    GND   ---------------     GND
  SDA (A4) --\/330 Ohm\/--    SDA
  SCL (A5) --\/330 Ohm\/--    SCL
*/
#include <Wire.h> // Must include Wire library for I2C
#include <SFE_MMA8452Q.h> // Includes the SFE_MMA8452Q library
#include <Event.h>
#include <Timer.h>
#include<stdlib.h>

#include <SoftwareSerial.h>  
int bluetoothTx = 16;  // TX-O pin of bluetooth mate, Arduino A2,16
int bluetoothRx = 17;  // RX-I pin of bluetooth mate, Arduino A3,17
MMA8452Q accel;
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx); // for communication between ATMEGA 328 and BlueSMiRF Gold
Timer readSensorTimer;
Timer blueToothTimer;
int Start_But =4;
int LED_init =7;
int LED_start =8;

int x[20];
int y[20];
int sum=0;
int sum1=0;
float begin_val1;
float begin_val2;
int type;
int start_ref1;
int start_ref2;
float start_point ;
float force_sum;
float force_value1 ;
float force_value2;
float voltage_value ;
char value[10];
char value2[10];

// taking the sensor reading and convert it to the force value and transmit  


void setup()
{
// delay(3000);
   Serial.begin(57600);  // Begin the serial monitor at 57600bps
bluetooth.begin(57600);  // The Bluetooth Mate defaults to 115200bps
   bluetooth.println("MMA8452Q Test Code!");
  accel.init();
pinMode(Start_But,INPUT);
pinMode(LED_start,OUTPUT);
pinMode(LED_init,OUTPUT);
digitalWrite(LED_init,1);
digitalWrite(LED_start,0);
analogReference(INTERNAL);//set the analog output reference to be 3.3V instead of 5V since the output voltage from the sensors are small
 
//Taking the several readings under no load condition to decide which relationship between voltage and force the sensor is following 
 x[0]=analogRead(1);
  delay(100);
    x[1]=analogRead(1);
  delay(100);
  sum+=x[1];
    x[2]=analogRead(1);
    delay(100);
  sum+=x[2];
    x[3]=analogRead(1);
  delay(100);
  sum+=x[3];
    x[4]=analogRead(1);
   delay(100);
  sum+=x[4];
    x[5]=analogRead(1);
  delay(100);
  sum+=x[5];
    x[6]=analogRead(1);
   delay(100);
  sum+=x[6];
    x[7]=analogRead(1);
  delay(100);
  sum+=x[7]; 
  x[8]=analogRead(1);
  delay(100);
  sum+=x[8];
    x[9]=analogRead(1);
  delay(100);
  sum+=x[9];
    x[10]=analogRead(1);
  delay(100);
  sum+=x[10];
begin_val1=sum/10;
y[0]=analogRead(0);
  delay(100);
    y[1]=analogRead(0);
  delay(100);
  sum1+=y[1];
    y[2]=analogRead(0);
    delay(100);
  sum1+=y[2];
    y[3]=analogRead(0);
  delay(100);
  sum1+=x[3];
    y[4]=analogRead(0);
   delay(100);
  sum1+=x[4];
    y[5]=analogRead(0);
  delay(100);
  sum1+=x[5];
    y[6]=analogRead(0);
   delay(100);
  sum1+=x[6];
    y[7]=analogRead(0);
  delay(100);
  sum1+=x[7]; 
  y[8]=analogRead(0);
  delay(100);
  sum1+=x[8];
    y[9]=analogRead(0);
  delay(100);
  sum1+=x[9];
    y[10]=analogRead(0);
  delay(100);
  sum1+=x[10];
begin_val2=sum1/10;
//Serial.println(sum);
//Serial.print("begin_val=");
//Serial.println(begin_val1);

 digitalWrite(LED_init,0);
  digitalWrite(LED_start,1);

  
}

void loop()
{
 while(1)
 {
     accel.read();
  
  int xAcceleration = accel.cx; 
int yAcceleration = accel.cy; 
int total =xAcceleration+yAcceleration;
Serial.print("ACC");
Serial.println(total);
bluetooth.print("ACCB");
bluetooth.println(total);
delay(15);

   int start_ref1=(analogRead(1));
  int start_ref2=(analogRead(0));
     force_value1=(start_ref1-begin_val1)/25;
 if(force_value1<=0)
   {
     force_value1=0.0;
   }
   if(force_value1>=25)
   {
     force_value1=force_value1*0.8;
   }
   force_value2=(start_ref2-begin_val2)/5;
    if(force_value2<=0)
   {
     force_value2=0.0;
   }
  if(force_value2>=25)
   {
     force_value2=force_value2*0.8;
   }
force_sum=(force_value1+force_value2)*0.8;

dtostrf(force_sum,3,2,value);
String str(value);
str="N"+str;
delay(20);
Serial.print("force");
Serial.println(str);
bluetooth.print("FORCEB");
 bluetooth.println(str);
 delay(1000);
}
}

(you missed a little with the code tags - good try tho)

_2015_worked.ino (3.85 KB)