JBlond / bme280

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BME280 sensor on raspberry pi

I used the Waveshare BME280 Environmental Sensor because there is no soldering included. Just plug and play.

hardware

sudo lsmod | grep "bcm"

Look for i2c_bcm2835 and spi_bcm2835

code change

for you to get the code working, you have to see where sensor is detected from the hardware.

sudo i2cdetect -y 1

The output

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- 76 --

in the main.c file search for ###ADDRESS### to see which lines you need to change.

compile

just run make

Libs

  • Sensor driver for BME280 sensor (BSD-3-Clause License)
  • wiringPi (LGPL)
  • wiringPiSPI (LGPL 3.0)

Make libs

cd lib/WiringPi
./build

About

License:MIT License


Languages

Language:C 92.1%Language:Makefile 4.0%Language:Shell 2.0%Language:Roff 1.2%Language:TeX 0.6%Language:C++ 0.2%