Subversion Repositories FlightCtrl

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1993 - 1
#include <Wire.h>
2
#include <bma180.h>
3
 
4
BMA180 bma180 = BMA180(BMA180_ADDRESS_SDO_LOW);
5
 
6
void setup()
7
{
8
  Wire.begin();
9
  Serial.begin(115200);
10
  bma180.SoftReset();
11
  bma180.enableWrite();
12
  bma180.SetFilter(bma180.F10HZ);
13
  bma180.setGSensitivty(bma180.G15);
14
  bma180.SetSMPSkip();
15
  bma180.SetISRMode();
16
  bma180.disableWrite();
17
  delay(100);
18
}
19
 
20
void loop()
21
{
22
  bma180.readAccel();
23
  Serial.print(bma180.x,DEC);
24
  Serial.print(",");
25
  Serial.print(bma180.y,DEC);
26
  Serial.print(",");
27
  Serial.println(bma180.z,DEC);
28
  delay(20);
29
}
30
 
31
 
32