Hardware Reference
In-Depth Information
Accessing the altimeter/pressure sensor
from the Arduino IDE
The following are the steps associated with connecting this device to Arduino:
1. The first step in accessing the device is to download the appropriate library. Here,
you have a choice. You can use the library described in the Connecting an acceler-
ometer/gyro to Arduino section, or you can download a library just for this device.
The library supplied for the accelerometer/gyro is a more general library designed
to communicate with many different I2C devices. The library for this device sup-
ports only this device. If you want to download the library for this device, go to
www.sainsmart.com/sainsmart-bmp085-digital-pressure-sensor-module-board.html
and select the Download Link selection at the bottom of the link. This will down-
load a .rar file that will include an example sketch. I personally prefer to use the
I2C library version; it is more up to date, so I will follow that example here.
2. Open the example by navigating to File | Examples | BMP085 | Examples |
BMP085_basic , as shown in the following screenshot:
3. You should now set the Serial Monitor baud rate to 38400 if you haven't already
done so, as this is the baud rate set by the example program. Now, you can upload
the sketch of Arduino, and when you open the Serial Monitor, you should see
something similar to the following screenshot:
Search WWH ::




Custom Search