Purpose:
利用Raspberry Pi I2C(Inter-Integrated Circuit)
讀取BMP180(Temp、Pressure、Altitude、Sealevel Pressure)
Material:
Raspberry Pi主板 x 1
BMP180模組 x 1
Pin:
Method:
如果是第一次執行I2C時, 需要先設定如下:
Configuring I2C
https://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/configuring-i2c
更新
> sudo apt-get update
安裝套件
> sudo apt-get install git build-essential python-dev python-smbus
下載Adafruit_Python_BMP專案
>git clone https://github.com/adafruit/Adafruit_Python_BMP.git
進入專案
> cd Adafruit_Python_BMP
安裝
> sudo python setup.py install
進入範例程式
> cd examples
執行程式 > sudo python simpletest.py
Reference:
https://learn.adafruit.com/using-the-bmp085-with-raspberry-pi/using-the-adafruit-bmp-python-library
沒有留言:
張貼留言