#include <looptime.h>
 
#include <linscale.h>

#include <mma7361l.h>

void setup() 
{
  Serial.begin(9600);
  mma7361lInit();
  // calib with -/+ 1g from 1.5g and 6g range 
  // get numbers from calib15g6g
  
  mma7361lInitX(183,512,312,399);
  mma7361lInitY(181,522,316,405);
  mma7361lInitZ(150,482,296,386);
}

void loop()
{
  mma7361lMea();
  // hereafter mma7361l ax/ay/az and r holds accelerations
  Serial.print(mma7361lax,4); Serial.print("   ");
  Serial.print(mma7361lay,4); Serial.print("   ");
  Serial.print(mma7361laz,4); Serial.print("   ");
  Serial.println(mma7361lr,4);
  Serial.println(looptime(100)); 
}

