#include <looptime.h>
#include <Wire.h>
#include <bmp085.h>
/*
Dette program sampler med 10 Hz og maaler
 x,y,z acc samt tryk vha bmp085
 */

void setup()
{
  Serial.begin(2400);
  bmp085_init(); // initaliser trykmaaler
}

float temp, alt;
long pres;

void loop()
{
  char res;
  Serial.print(looptime(500));
  Serial.print(" , ");
  Serial.print(analogRead(A2)); // x
  Serial.print(" , ");
  Serial.print(analogRead(A3)); // y
  Serial.print(" , ");
  Serial.print(analogRead(A1)); // z
  Serial.print(" , ");
  temp = bmp085Temp(); 
  pres = bmp085Pressure(); 
  Serial.print(temp);
  Serial.print(" , ");
  Serial.print(pres);
  alt = bmp085PascalToMeter(pres,100780);  
  Serial.print(" , ");
  Serial.println(alt);

}









