examples/dhtxx: added configuration option for dhtxx sensor devpath

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
This commit is contained in:
Michal Lenc 2021-06-14 11:18:11 +02:00 committed by Xiang Xiao
parent 5572819bb1
commit 21562e8960
2 changed files with 8 additions and 2 deletions

View File

@ -18,6 +18,12 @@ config EXAMPLES_DHTXX_PROGNAME
This is the name of the program that will be used when the NSH ELF
program is installed.
config EXAMPLES_DHTXX_DEVPATH
string "Device path"
default "/dev/hum0"
---help---
The device path
config EXAMPLES_DHTXX_PRIORITY
int "Dhtxx task priority"
default 100

View File

@ -1,5 +1,5 @@
/****************************************************************************
* examples/dhtxx/dhtxx_main.c
* apps/examples/dhtxx/dhtxx_main.c
*
* Copyright (C) 2018 Abdelatif GUETTOUCHE. All rights reserved.
* Author: Abdelatif GUETTOUCHE <abdelatif.guettouche@gmail.com>
@ -61,7 +61,7 @@ int main(int argc, FAR char *argv[])
printf("Dhtxx app is running.\n");
fd = open("/dev/dht0", O_RDWR);
fd = open(CONFIG_EXAMPLES_DHTXX_DEVPATH, O_RDWR);
for (i = 0; i < 20; i++)
{