THANK YOU Tim! Sometimes you can't see the wood for the trees - I inherited that old code and it didn't occur to me to see if someone had since made a Python 3 Adafruit library. That works perfectly and is super easy to install and use.
The Barometric Pressure sensor *shall* go to the ball! :)
Laura
On Tue, Dec 20, 2016 at 10:17 AM, Tim Golden <mail@timgolden.me.uk> wrote:
On 20/12/2016 09:38, Laura Sach wrote:
Hi all,
I'm working on a resource which reads weather data, and I'm using this code to read data from a BMP180 barometric pressure sensor.
Laura,
I may be missing something, but it looks to me as though Adafruit have already done this for the modules you're using. The repo you point to at the head of the backend file:
https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code/
describes how they've broken the code out into smaller repos and made them work with Py2/3.
Certainly
https://github.com/adafruit/Adafruit_Python_BMP
and
https://github.com/adafruit/Adafruit_Python_GPIO/blob/master /Adafruit_GPIO/I2C.py
seem, by inspection, to be 2/3 compatible.
I'm happy to help, but is it possible that you're re-inventing the wheel here? Or have I missed something?
TJG