BMP085 + Raspberry Pi
Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

BMP085 + Raspberry Pi

by dronshaw on Sat Mar 23, 2013 11:30 am

Hey all...I'm new to python programming and the raspberry pi. I've got my BMP085 hooked up correctly to read sensor measurements. Right now, I've got this in a loop, but I'm trying to find an If True: statement that I could use on the BMP085 to determine if it goes into the measurement loop.

For example, the adafruit ultimate GPS guide utilizes the following:
Code: Select all | TOGGLE FULL SIZE
if report['class'] == 'TPV':


and then grabs the info if that is true. I'd like to find something for the BMP085 but haven't been able to find a relevant statement for it.

Hope this makes sense, thanks.
dronshaw
 
Posts: 3
Joined: Thu Feb 28, 2013 11:37 pm

Re: BMP085 + Raspberry Pi

by adafruit_support_mike on Sat Mar 23, 2013 5:53 pm

The GPS code doesn't talk to the sensor directly. There's another program running on the RasPi that handles all the device communication and data formatting (it's called 'gpsd'). The example code doesn't even talk to that directly.. it calls a library that talks to gpsd and wraps the results up in a python class. The example code looks at the class it got from the library to decide what results the library got from gpsd, which in turn depend on what the gpsd's code got from the actual sensor.

The BMP085 code doesn't have all those middlemen. It talks directly to the sensor (which is much simpler than a GPS device)

So.. you don't need an "okay, the sensor is ready to give you good data" test before calling the BMP085 functions.
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.
User avatar
adafruit_support_mike
 
Posts: 10132
Joined: Thu Feb 11, 2010 2:51 pm

Re: BMP085 + Raspberry Pi

by dronshaw on Sat Mar 23, 2013 6:22 pm

Ahhh thank you for explaining that. I've got one loop that directly calls a plethora of sensors, cameras, and gps chips. I was wanting to "error proof" my code, so that if one of these elements fails the loop would accommodate that. This definitely help me out in understanding how the sensor interfaces witht he Pi. Thanks!
dronshaw
 
Posts: 3
Joined: Thu Feb 28, 2013 11:37 pm

Re: BMP085 + Raspberry Pi

by adafruit_support_mike on Sun Mar 24, 2013 12:08 pm

That's a good strategy. I don't think the BP085 will give you any errors that would kill the program though.
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.
User avatar
adafruit_support_mike
 
Posts: 10132
Joined: Thu Feb 11, 2010 2:51 pm