samples: sensors: drop bme680 sample as a more generic one exists
This sample adds no value compared to e.g. sensor shell. Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This commit is contained in:
parent
b6057cca41
commit
5f65b30117
7 changed files with 0 additions and 152 deletions
|
@ -1,12 +0,0 @@
|
|||
#
|
||||
# Copyright (c) 2018 Bosch Sensortec GmbH
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 3.20.0)
|
||||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
||||
project(bme680)
|
||||
|
||||
FILE(GLOB app_sources src/*.c)
|
||||
target_sources(app PRIVATE ${app_sources})
|
|
@ -1,53 +0,0 @@
|
|||
.. _bme680:
|
||||
|
||||
BME680: Integrated environmental sensor
|
||||
#####################################################
|
||||
|
||||
Description
|
||||
***********
|
||||
|
||||
This sample application periodically (every 3s) measures the ambient temperature
|
||||
in degrees Celsius, atmospheric pressure in kilopascal, relative humidity in percentage,
|
||||
and gas sensor resistance in ohms. The result is written to the console.
|
||||
|
||||
References
|
||||
**********
|
||||
|
||||
- BME680: https://www.bosch-sensortec.com/bst/products/all_products/bme680
|
||||
|
||||
Wiring
|
||||
*******
|
||||
|
||||
This sample uses the BME680 sensor controlled using the I2C interface.
|
||||
Connect Supply: **VDD**, **VDDIO**, **GND** and Interface: **SDA**, **SCL**.
|
||||
The supply voltage can be in the 1.8V to 3.6V range.
|
||||
Depending on the baseboard used, the **SDA** and **SCL** lines require Pull-Up
|
||||
resistors.
|
||||
|
||||
Building and Running
|
||||
********************
|
||||
|
||||
This project outputs sensor data to the console. It requires a BME680
|
||||
sensor. It should work with any platform featuring a I2C peripheral interface.
|
||||
It does not work on QEMU.
|
||||
In this example below the :ref:`nrf52840dk_nrf52840` board is used.
|
||||
|
||||
|
||||
.. zephyr-app-commands::
|
||||
:zephyr-app: samples/sensor/bme680
|
||||
:board: nrf52840dk/nrf52840
|
||||
:goals: build flash
|
||||
|
||||
Sample Output
|
||||
=============
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
Device 0x20002b74 name is BME680
|
||||
T: 23.988877; P: 97.648568; H: 53.689533; G: 1035.211466
|
||||
T: 24.168500; P: 97.648866; H: 53.565966; G: 1046.677896
|
||||
T: 24.336533; P: 97.648596; H: 53.353663; G: 1058.656533
|
||||
T: 24.589696; P: 97.648366; H: 53.958864; G: 1072.155863
|
||||
T: 24.856631; P: 97.648322; H: 53.553669; G: 1096.448788
|
||||
|
||||
<repeats endlessly>
|
|
@ -1,16 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Patrick Moffitt <patrick@moffitt.com>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* i2c interface for the Feather nRF52840 Express and the
|
||||
* Adafruit BME680.
|
||||
*/
|
||||
|
||||
&i2c0 {
|
||||
compatible = "nordic,nrf-twi";
|
||||
bme680: bme680@77 {
|
||||
compatible = "bosch,bme680";
|
||||
reg = <0x77>;
|
||||
};
|
||||
};
|
|
@ -1,12 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Nordic Semiconductor ASA
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
&i2c0 {
|
||||
bme680@76 {
|
||||
compatible = "bosch,bme680";
|
||||
reg = <0x76>;
|
||||
};
|
||||
};
|
|
@ -1,3 +0,0 @@
|
|||
CONFIG_STDOUT_CONSOLE=y
|
||||
CONFIG_I2C=y
|
||||
CONFIG_SENSOR=y
|
|
@ -1,13 +0,0 @@
|
|||
sample:
|
||||
name: BME680 Sensor sample
|
||||
tests:
|
||||
sample.sensor.bme680:
|
||||
harness: sensor
|
||||
tags:
|
||||
- samples
|
||||
- sensor
|
||||
integration_platforms:
|
||||
- nrf52840dk/nrf52840
|
||||
platform_allow:
|
||||
- nrf52840dk/nrf52840
|
||||
- adafruit_feather_nrf52840_sense
|
|
@ -1,43 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2018 Bosch Sensortec GmbH
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/drivers/sensor.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
const struct device *const dev = DEVICE_DT_GET_ONE(bosch_bme680);
|
||||
struct sensor_value temp, press, humidity, gas_res;
|
||||
|
||||
if (!device_is_ready(dev)) {
|
||||
printk("sensor: device not ready.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
printf("Device %p name is %s\n", dev, dev->name);
|
||||
|
||||
#ifndef CONFIG_COVERAGE
|
||||
while (1) {
|
||||
#else
|
||||
for (int i = 0; i < 5; i++) {
|
||||
#endif
|
||||
k_sleep(K_MSEC(3000));
|
||||
|
||||
sensor_sample_fetch(dev);
|
||||
sensor_channel_get(dev, SENSOR_CHAN_AMBIENT_TEMP, &temp);
|
||||
sensor_channel_get(dev, SENSOR_CHAN_PRESS, &press);
|
||||
sensor_channel_get(dev, SENSOR_CHAN_HUMIDITY, &humidity);
|
||||
sensor_channel_get(dev, SENSOR_CHAN_GAS_RES, &gas_res);
|
||||
|
||||
printf("T: %d.%06d; P: %d.%06d; H: %d.%06d; G: %d.%06d\n",
|
||||
temp.val1, temp.val2, press.val1, press.val2,
|
||||
humidity.val1, humidity.val2, gas_res.val1,
|
||||
gas_res.val2);
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue