Pages: [1]   Go Down
Author Topic: Looking for Arduino sketch: Accelerometer BMA180 and/or BMA020  (Read 2576 times)
0 Members and 1 Guest are viewing this topic.
Marly Switzerland
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,
I am new in the field of interfacing sensors to an Arduino Uno: To do "learning by doing" ...  who might give me a simple Arduino sketch to read the Bosch 3-axis accelerometers BMA180 and if possible also for BMA020 by TWI (I2C) interface ... ? Thanks a lot for the help ... ! smiley
Logged

Portugal
Offline Offline
God Member
*****
Karma: 6
Posts: 962
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Read this:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1276427322

For more, just google arduino bma180
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is a code for an AXDL335, not sure how different they are.  Hope it helps.

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  int xaccel = analogRead(0);   
  int yaccel = analogRead(1);   
  int zaccel = analogRead(2);   
  unsigned long timevar = millis();
 
  Serial.print(timevar);
  Serial.print("  ");   Serial.print(xaccel); 
  Serial.print("  ");
  Serial.print(yaccel);
  Serial.print("  ");
  Serial.println(zaccel);
}
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 299
Posts: 26178
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
This is a code for an AXDL335, not sure how different they are
I think the clue is in "TWI / I2C"
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Pages: [1]   Go Up
Jump to: