How to connect a BME280

Overview

From 3.5 beta 2, BME280 sensors can now be connected to RRF. The duet docs page for BME280 sensors can be found here

What pins to choose?

A BME280 sensor requires 6 pins to be connected. 3 for SPI, 1 CS pin, +3.3v (not 5v) and ground.
The pre-configured SPI pins for each board are listed on the pins page of each board. You can also use software SPI and set the pins using board.txt.

You also need to set the following lines in board.txt.

heat.spiTempSensorChannel = 0
heat.spiTempSensorCSPins = { PB_6 }

heat.spiTempSensorChannel should be equal to the SPI channel used by the BME280. heat.spiTempSensorCSPins should be equal to the CS pin used by the BME280.
You can then configure the BME280 in config.g as described here.

Tags: