It did not work that well till I added the required Interrupt line to digital pin 2, but that was my goof.
Interrupts are a cool way to get things done on a uC but you are pretty much right, i should add a non interrupt driven polling example, I simply forgot that! ;-)
One question though, did you attach the BMA180 at 5V levels???
The routine is fine --- I just was not paying attention. My fault! Not yours!
I have made a few modifications to your routine. One was a simple addition to the notes in the headers.
As for the 5V I am hurt that you think I can't read -- -oh wait I just proved that I can't... :cold_sweat:
I used 3.3 v from my Mega2560. I do note that it specifies 2.4V It occurs to me that I should hook it to 5V with a voltage divider (as in divide by 2 and add a filter cap to the resistor where the 2.5V is present...)
Now the values are reading a bit high -- not that I really care that much as I display "A/C" waveforms in my data collection -- centered about Zero by subtracting the average.... BUT I would also like to calibrate for determining actual force and pressure on the object attached to... One thing at a time though....
The library does need a MODE to sent the Noise/Bandwidth command. (Location 30H, bits 0:1) I dummied up a mode command in my program -- if you do not add a mode command I will, and then send it to you. You saved me quite a bit of time -- it's the least I could do! And your library structure makes it simple.
Now, considering your obvious expertise, we just need you to look at the BM085 library that is floating around -- it gives weird results on some settings...
You have me thinking that you work for BOSCH since you seem to understand their sensors so clearly!