samples: sensors: drop ens210 sample as a more generic one exists

This sample adds no value compared to generic dht
polling sample

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This commit is contained in:
Benjamin Cabé 2024-08-24 10:59:42 +02:00 committed by Anas Nashif
commit 6a5428b751
6 changed files with 0 additions and 104 deletions

View file

@ -1,9 +0,0 @@
# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(ens210)
FILE(GLOB app_sources src/*.c)
target_sources(app PRIVATE ${app_sources})

View file

@ -1,34 +0,0 @@
.. _ens210:
ams ens210 Relative Humidity and Temperature Sensor
###################################################
Overview
********
This sample application demonstrates how to use the ams ens210 sensor to
measure the ambient temperature and relative humidity.
Building and Running
********************
This sample application uses the sensor connected to the i2c stated in the
app.overlay file.
Flash the binary to a board of choice with a sensor connected.
For example build for a nucleo_f446re board:
.. zephyr-app-commands::
:zephyr-app: samples/sensor/ens210
:board: nucleo_f446re
:goals: build flash
:compact:
Sample Output
=============
.. code-block:: console
device is 0x20001174, name is ENS210
Temperature: 28.28881222 C; Humidity: 25.25689737%
Temperature: 28.28912472 C; Humidity: 25.25799105%
Temperature: 28.28959347 C; Humidity: 25.25760045%

View file

@ -1,14 +0,0 @@
/*
* Copyright (c) 2018 Alexander Wachter
* SPDX-License-Identifier: Apache-2.0
*/
&arduino_i2c {
status = "okay";
clock-frequency = <I2C_BITRATE_FAST>;
ens210: ens210@43 {
compatible = "ams,ens210";
reg = <0x43>;
};
};

View file

@ -1,2 +0,0 @@
CONFIG_I2C=y
CONFIG_SENSOR=y

View file

@ -1,10 +0,0 @@
sample:
description: Demonstration of the AMS Temperature and Humidity Sensor driver
name: ENS210 sample
tests:
sample.sensor.ens210:
harness: sensor
tags: samples
depends_on:
- i2c
- arduino_i2c

View file

@ -1,35 +0,0 @@
/*
* Copyright (c) 2018 Alexander Wachter
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/sys/printk.h>
int main(void)
{
const struct device *const dev = DEVICE_DT_GET_ONE(ams_ens210);
struct sensor_value temperature, humidity;
if (!device_is_ready(dev)) {
printk("Device %s is not ready\n", dev->name);
return 0;
}
printk("device is %p, name is %s\n", dev, dev->name);
while (1) {
sensor_sample_fetch(dev);
sensor_channel_get(dev, SENSOR_CHAN_HUMIDITY, &humidity);
sensor_channel_get(dev, SENSOR_CHAN_AMBIENT_TEMP, &temperature);
printk("Temperature: %d.%06d C; Humidity: %d.%06d%%\n",
temperature.val1, temperature.val2,
humidity.val1, humidity.val2);
k_sleep(K_MSEC(1000));
}
return 0;
}