#include <SoftwareSerial.h>

#include "arduino_bma456.h"
uint32_t step = 0;
float x = 0, y = 0, z = 0;
int32_t temp = 0;
SoftwareSerial mySerial(4, 3); // RX, 
float calories =0;
float distance =0;
void setup(void)
{    
    Serial.begin(9600);
    mySerial.begin(9600);
    mySerial.print("ready ");
    Serial.println("BMA456 Raw Data");
    bma456.initialize(RANGE_4G, ODR_1600_HZ, NORMAL_AVG4, CONTINUOUS);
    bma456.stepCounterEnable();
  
}

void loop(void)
{  
   
    temp = bma456.getTemperature();
    step = bma456.getStepCounterOutput();
    calories = step * 0.04;
    distance = step * 0.0006;
    mySerial.print("Steps="); 
    mySerial.print(step);
    mySerial.print(" Steps");
    mySerial.println(" Temp="); 
    mySerial.print(temp);
    mySerial.print("C");
    mySerial.print("calories="); 
    mySerial.print(calories);
    mySerial.println("Distance="); 
    mySerial.print(distance);
    mySerial.print("m");
    mySerial.println(" ");
    delay(1000);
}
