# Atmospheric pressure sensor BMP280_spi
Reference tutorial
[SCM BMP280 (GY-BM E/P 280 module) atmospheric pressure and temperature sensor use detailed explanation](https://blog.csdn.net/sunshinebooming/article/details/79637822 "SCM BMP280 (GY-BM E/P 280 module) atmospheric pressure and temperature sensor use detailed explanation") [STM32 driver BMP280 module](https://blog.csdn.net/bdjsm_hh/article/details/107623788 "STM32 driver BMP280 module")
**
Note: When writing, the highest position is 0, and when reading, the highest position is 1. Please refer to the data sheet below for details
**
![](././../../images_dir/1625021847/1.png)
Bmp280 module installation diagram
![](././../../images_dir/1625021989/2.png) ![](././../../images_dir/1625022026/3.png)
Source Code Path: driver_210519mp280_spi1 Powering code: bmp280_drv.c Compiler: 1、Copy "driver_210519 mp280_spi1" to the "lichee" directory in tina-d1 sdk 2、Enter bmp280_spi1 and execute the "make" command to generate the bmp280_drv.ko file 3、Copy to the development board, execute insmod bmp280_drv.ko, load the driver module and view the device "/dev/bmp280", as shown below
![](././../../images_dir/1625022099/4.png)
Device tree file and adding nodes: driver_210519sunxi-dts board.dts
rvboards_bmp280:bmp280@0{ device_type = "spibmp280"; compatible = "tina-d1,rvboards-bmp280"; spi-max-frequency = <500000>; reg = <0>; status = "okay"; cs_gpio = <&pio PD 10 GPIO_ACTIVE_HIGH>; };
User layer test program: bmp280_user.c Compile and execute: 1、Copy bmp280_user.c to the development board 2、Execute gcc -o bmp280_user bmp280_user.c to compile and generate bmp280_user execution program 3、Test command: ./bmp280_user /dev/bmp280
![](././../../images_dir/1625031254/5.png)
---
![](././../../images_dir/1703141148/4.png)