dacowars 1 mesiac pred
rodič
commit
7c1ccbc393

BIN
.DS_Store


+ 0 - 2
.clangd

@@ -1,2 +0,0 @@
-CompileFlags:
-    Remove: [-f*, -m*]

+ 0 - 13
.devcontainer/Dockerfile

@@ -1,13 +0,0 @@
-ARG DOCKER_TAG=latest
-FROM espressif/idf:${DOCKER_TAG}
-
-ENV LC_ALL=C.UTF-8
-ENV LANG=C.UTF-8
-
-RUN apt-get update -y && apt-get install udev -y
-
-RUN echo "source /opt/esp/idf/export.sh > /dev/null 2>&1" >> ~/.bashrc
-
-ENTRYPOINT [ "/opt/esp/entrypoint.sh" ]
-
-CMD ["/bin/bash", "-c"]

+ 0 - 19
.devcontainer/devcontainer.json

@@ -1,19 +0,0 @@
-{
-	"name": "ESP-IDF QEMU",
-	"build": {
-		"dockerfile": "Dockerfile"
-	},
-	"customizations": {
-		"vscode": {
-			"settings": {
-				"terminal.integrated.defaultProfile.linux": "bash",
-				"idf.gitPath": "/usr/bin/git"
-			},
-			"extensions": [
-				"espressif.esp-idf-extension",
-				"espressif.esp-idf-web"
-			]
-		}
-	},
-	"runArgs": ["--privileged"]
-}

+ 0 - 78
.gitignore

@@ -1,78 +0,0 @@
-# macOS
-.DS_Store
-.AppleDouble
-.LSOverride
-
-# Directory metadata
-.directory
-
-# Temporary files
-*~
-*.swp
-*.swo
-*.bak
-*.tmp
-
-# Log files
-*.log
-
-# Build artifacts and directories
-**/build/
-build/
-*.o
-*.a
-*.out
-*.exe # For any host-side utilities compiled on Windows
-
-# ESP-IDF specific build outputs
-*.bin
-*.elf
-*.map
-flasher_args.json # Generated in build directory
-sdkconfig.old
-sdkconfig
-
-# ESP-IDF dependencies
-# For older versions or manual component management
-/components/.idf/
-**/components/.idf/
-# For modern ESP-IDF component manager
-managed_components/
-# If ESP-IDF tools are installed/referenced locally to the project
-.espressif/
-
-# CMake generated files
-CMakeCache.txt
-CMakeFiles/
-cmake_install.cmake
-install_manifest.txt
-CTestTestfile.cmake
-
-# Python environment files
-*.pyc
-*.pyo
-*.pyd
-__pycache__/
-*.egg-info/
-dist/
-
-# Virtual environment folders
-venv/
-.venv/
-env/
-
-# Language Servers
-.clangd/
-.ccls-cache/
-compile_commands.json
-
-# Windows specific
-Thumbs.db
-ehthumbs.db
-Desktop.ini
-
-# User-specific configuration files
-*.user
-*.workspace # General workspace files, can be from various tools
-*.suo       # Visual Studio Solution User Options
-*.sln.docstates # Visual Studio

+ 0 - 23
.vscode/c_cpp_properties.json

@@ -1,23 +0,0 @@
-{
-  "configurations": [
-    {
-      "name": "ESP-IDF",
-      "compilerPath": "/Users/daniel/.espressif/tools/xtensa-esp-elf/esp-14.2.0_20251107/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc",
-      "compileCommands": "${workspaceFolder}/build/compile_commands.json",
-      "includePath": [
-        "${workspaceFolder}/**"
-      ],
-      "browse": {
-        "path": [
-          "${workspaceFolder}/**"
-        ],
-        "limitSymbolsToIncludedHeaders": true
-      },
-      "defines": [],
-      "cStandard": "c17",
-      "cppStandard": "c++17",
-      "intelliSenseMode": "gcc-x64"
-    }
-  ],
-  "version": 4
-}

+ 0 - 10
.vscode/launch.json

@@ -1,10 +0,0 @@
-{
-  "version": "0.2.0",
-  "configurations": [
-    {
-      "type": "gdbtarget",
-      "request": "attach",
-      "name": "Eclipse CDT GDB Adapter"
-    }
-  ]
-}

+ 0 - 18
.vscode/settings.json

@@ -1,18 +0,0 @@
-{
-  "C_Cpp.intelliSenseEngine": "default",
-  "idf.openOcdConfigs": [
-    "board/esp32-wrover-kit-3.3v.cfg"
-  ],
-  "idf.port": "/dev/tty.usbserial-10",
-  "idf.currentSetup": "/Users/daniel/.espressif/v5.5.3/esp-idf",
-  "idf.customExtraVars": {
-    "IDF_TARGET": "esp32"
-  },
-  "clangd.path": "/Users/daniel/.espressif/tools/esp-clang/esp-19.1.2_20250312/esp-clang/bin/clangd",
-  "clangd.arguments": [
-    "--background-index",
-    "--query-driver=**",
-    "--compile-commands-dir=/Users/daniel/Documents/Proyectos/dht22/build"
-  ],
-  "idf.flashType": "UART"
-}

+ 3 - 6
CMakeLists.txt

@@ -1,6 +1,3 @@
-# The following five lines of boilerplate have to be in your project's
-# CMakeLists in this exact order for cmake to work correctly
-cmake_minimum_required(VERSION 3.16)
-
-include($ENV{IDF_PATH}/tools/cmake/project.cmake)
-project(dht22)
+idf_component_register(SRCS "dht22.c"
+                    INCLUDE_DIRS "include"
+                    REQUIRES driver)

+ 0 - 0
components/dht22/Kconfig → Kconfig


+ 0 - 0
components/dht22/README.md → README.md


+ 0 - 3
components/dht22/CMakeLists.txt

@@ -1,3 +0,0 @@
-idf_component_register(SRCS "dht22.c"
-                    INCLUDE_DIRS "include"
-                    REQUIRES driver)

+ 3 - 0
idf_component.yml

@@ -0,0 +1,3 @@
+version: "1.0.0"
+description: "Driver para sensor DHT22 (temperatura y humedad)"
+url: "https://dacogogs.duckdns.org/dacowars/libreria_dht22.git"

+ 0 - 0
components/dht22/include/dht22.h → include/dht22.h


+ 0 - 2
main/CMakeLists.txt

@@ -1,2 +0,0 @@
-idf_component_register(SRCS "main.c"
-                    INCLUDE_DIRS ".")

+ 0 - 34
main/main.c

@@ -1,34 +0,0 @@
-#include <stdio.h>
-#include "freertos/FreeRTOS.h"
-#include "freertos/task.h"
-#include "driver/gpio.h"
-#include "esp_rom_sys.h"
-#include "esp_log.h"
-#include "dht22.h"
-
-
-static const char *TAG = "DHT22";
-
-
-void app_main(void)
-{
-    
-    float temperature;
-    float humidity;
-    esp_err_t err = dht_attach_pin();
-    if (err != ESP_OK) {
-        ESP_LOGE(TAG, "Failed to attach DHT pin: %s", esp_err_to_name(err));
-        vTaskDelay(pdMS_TO_TICKS(5000)); // Wait for 5 seconds before retrying
-        return;
-    }
-    vTaskDelay(pdMS_TO_TICKS(2000)); // Wait for 2 seconds before starting the main loop
-    while (1) {
-        if (dht_read(&temperature, &humidity) == ESP_OK) {
-            ESP_LOGI(TAG, "Temperature: %.1f°C, Humidity: %.1f%%", temperature, humidity);
-        } else {
-            ESP_LOGE(TAG, "Failed to read from DHT22 sensor");
-        }
-        vTaskDelay(pdMS_TO_TICKS(5000)); // Wait for 5 seconds before the next reading
-    }
-
-}

+ 0 - 0
components/dht22/src/dht22.c → src/dht22.c