From 65b30d40916a80701deaf19a6e8aa26431789564 Mon Sep 17 00:00:00 2001
From: erpepe2004
Date: Wed, 10 Dec 2025 17:59:53 +0000
Subject: [PATCH 01/11] =?UTF-8?q?Traduci=C3=B6n?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/copilot-instructions.md | 45 +
CONTRIBUTING.md | 4 +-
include/README | 33 +-
.../src/core_esp8266_waveform_phase.cpp | 120 +-
.../include/NeoEsp32RmtHIMethod.h | 50 +-
lib/NeoESP32RmtHI/src/NeoEsp32RmtHIMethod.cpp | 94 +-
lib/README | 22 +-
readme.md | 106 +-
test/README | 13 +-
tools/cdata-test.js | 24 +-
tools/cdata.js | 42 +-
tools/check-translations.js | 573 +++++
tools/translate-all-comments.js | 242 ++
tools/translate-comments.js | 235 ++
usermods/ADS1115_v2/ADS1115_v2.cpp | 2 +-
usermods/AHT10_v2/AHT10_v2.cpp | 32 +-
.../Animated_Staircase/Animated_Staircase.cpp | 78 +-
usermods/Artemis_reciever/usermod.cpp | 14 +-
usermods/BH1750_v2/BH1750_v2.cpp | 14 +-
usermods/BH1750_v2/BH1750_v2.h | 20 +-
usermods/BME280_v2/BME280_v2.cpp | 46 +-
usermods/BME68X_v2/BME68X_v2.cpp | 210 +-
usermods/Battery/Battery.cpp | 182 +-
usermods/Battery/UMBattery.h | 26 +-
usermods/Battery/battery_defaults.h | 12 +-
usermods/Battery/types/UnkownUMBattery.h | 2 +-
usermods/Cronixie/Cronixie.cpp | 20 +-
usermods/DHT/DHT.cpp | 20 +-
usermods/EXAMPLE/readme.md | 10 +-
usermods/EXAMPLE/usermod_v2_example.cpp | 238 +-
usermods/EleksTube_IPS/ChipSelect.h | 8 +-
usermods/EleksTube_IPS/EleksTube_IPS.cpp | 22 +-
usermods/EleksTube_IPS/Hardware.h | 2 +-
usermods/EleksTube_IPS/TFTs.h | 50 +-
usermods/EleksTube_IPS/User_Setup.h | 34 +-
.../usermod.cpp | 32 +-
.../usermod_bme280.cpp | 34 +-
.../usermod_Fix_unreachable_netservices.cpp | 74 +-
usermods/INA226_v2/INA226_v2.cpp | 22 +-
.../Internal_Temperature_v2.cpp | 42 +-
usermods/LD2410_v2/LD2410_v2.cpp | 24 +-
.../LDR_Dusk_Dawn_v2/LDR_Dusk_Dawn_v2.cpp | 22 +-
usermods/MAX17048_v2/MAX17048_v2.cpp | 26 +-
usermods/MY9291/MY92xx.h | 42 +-
.../PIR_sensor_switch/PIR_Highlight_Standby | 10 +-
.../PIR_sensor_switch/PIR_sensor_switch.cpp | 102 +-
usermods/PWM_fan/PWM_fan.cpp | 74 +-
usermods/RTC/RTC.cpp | 4 +-
usermods/RelayBlinds/usermod.cpp | 6 +-
.../SN_Photoresistor/SN_Photoresistor.cpp | 16 +-
usermods/SN_Photoresistor/SN_Photoresistor.h | 18 +-
usermods/ST7789_display/ST7789_display.cpp | 92 +-
usermods/Si7021_MQTT_HA/Si7021_MQTT_HA.cpp | 30 +-
usermods/TTGO-T-Display/README.md | 2 +-
usermods/TTGO-T-Display/usermod.cpp | 46 +-
usermods/Temperature/Temperature.cpp | 56 +-
usermods/Temperature/UsermodTemperature.h | 28 +-
usermods/TetrisAI_v2/TetrisAI_v2.cpp | 14 +-
usermods/TetrisAI_v2/gridbw.h | 8 +-
usermods/TetrisAI_v2/gridcolor.h | 4 +-
usermods/TetrisAI_v2/pieces.h | 4 +-
usermods/TetrisAI_v2/rating.h | 2 +-
usermods/TetrisAI_v2/tetrisai.h | 22 +-
usermods/TetrisAI_v2/tetrisaigame.h | 6 +-
usermods/TetrisAI_v2/tetrisbag.h | 6 +-
.../VL53L0X_gestures/VL53L0X_gestures.cpp | 22 +-
.../usermod.cpp | 38 +-
.../usermod_bme280.cpp | 34 +-
usermods/audioreactive/audio_reactive.cpp | 538 ++---
usermods/audioreactive/audio_source.h | 156 +-
usermods/boblight/boblight.cpp | 82 +-
usermods/buzzer/buzzer.cpp | 20 +-
usermods/deep_sleep/deep_sleep.cpp | 20 +-
usermods/mpu6050_imu/mpu6050_imu.cpp | 124 +-
usermods/mpu6050_imu/usermod_gyro_surge.h | 97 +-
usermods/multi_relay/multi_relay.cpp | 138 +-
usermods/multi_relay/readme.md | 2 +-
.../photoresistor_sensor_mqtt_v1/usermod.cpp | 20 +-
usermods/pixels_dice_tray/README.md | 2 +-
usermods/pixels_dice_tray/dice_state.h | 32 +-
usermods/pixels_dice_tray/led_effects.h | 22 +-
.../pixels_dice_tray/pixels_dice_tray.cpp | 140 +-
usermods/pixels_dice_tray/tft_menu.h | 50 +-
usermods/pov_display/bmpimage.cpp | 14 +-
usermods/pov_display/bmpimage.h | 12 +-
usermods/pov_display/pov.cpp | 4 +-
usermods/pov_display/pov.h | 14 +-
usermods/pov_display/pov_display.cpp | 8 +-
usermods/pwm_outputs/pwm_outputs.cpp | 9 +-
.../quinled-an-penta/quinled-an-penta.cpp | 60 +-
usermods/readme.md | 26 +-
.../rgb-rotary-encoder/rgb-rotary-encoder.cpp | 62 +-
usermods/sd_card/sd_card.cpp | 8 +-
usermods/sensors_to_mqtt/sensors_to_mqtt.cpp | 16 +-
.../seven_segment_display.cpp | 68 +-
.../seven_segment_display_reloaded.cpp | 42 +-
usermods/sht/ShtUsermod.h | 2 +-
usermods/sht/sht.cpp | 92 +-
usermods/smartnest/smartnest.cpp | 26 +-
.../stairway_wipe_basic.cpp | 22 +-
usermods/udp_name_sync/udp_name_sync.cpp | 6 +-
usermods/user_fx/README.md | 18 +-
usermods/user_fx/user_fx.cpp | 24 +-
.../usermod_rotary_brightness_color.cpp | 42 +-
.../usermod_v2_HttpPullLightControl.cpp | 94 +-
.../usermod_v2_HttpPullLightControl.h | 24 +-
.../usermod_v2_RF433/usermod_v2_RF433.cpp | 16 +-
.../usermod_v2_animartrix.cpp | 4 +-
.../usermod_v2_auto_save.cpp | 74 +-
.../usermod_v2_brightness_follow_sun.cpp | 2 +-
.../4LD_wled_fonts.h | 46 +-
.../usermod_v2_four_line_display.h | 84 +-
.../usermod_v2_four_line_display_ALT.cpp | 138 +-
.../usermod_v2_klipper_percentage.cpp | 32 +-
.../usermod_v2_ping_pong_clock.cpp | 6 +-
.../usermod_v2_rotary_encoder_ui_ALT.cpp | 212 +-
.../usermod_v2_word_clock.cpp | 152 +-
usermods/wizlights/wizlights.cpp | 16 +-
.../word-clock-matrix/word-clock-matrix.cpp | 42 +-
wled00/FX.cpp | 1952 ++++++++---------
wled00/FX.h | 74 +-
wled00/FX_2Dfcn.cpp | 134 +-
wled00/FX_fcn.cpp | 364 +--
wled00/FXparticleSystem.cpp | 314 +--
wled00/FXparticleSystem.h | 60 +-
wled00/alexa.cpp | 10 +-
wled00/bus_manager.cpp | 148 +-
wled00/bus_manager.h | 40 +-
wled00/bus_wrapper.h | 42 +-
wled00/button.cpp | 58 +-
wled00/cfg.cpp | 64 +-
wled00/colors.cpp | 58 +-
wled00/colors.h | 36 +-
wled00/const.h | 92 +-
wled00/data/common.js | 22 +-
wled00/data/favicon.ico | Bin 156 -> 157 bytes
wled00/data/icons-ui/demo.html | 2 +-
wled00/data/index.css | 48 +-
wled00/data/index.htm | 1 +
wled00/data/index.js | 237 +-
wled00/data/pixart/boxdraw.js | 14 +-
wled00/data/pixart/getPixelValues.js | 84 +-
wled00/data/pixart/pixart.css | 2 +-
wled00/data/pixart/pixart.js | 62 +-
wled00/data/rangetouch.js | 2 +-
wled00/data/settings_leds.htm | 1 +
wled00/dmx_input.cpp | 18 +-
wled00/dmx_input.h | 34 +-
wled00/dmx_output.cpp | 12 +-
wled00/e131.cpp | 66 +-
wled00/fcn_declare.h | 62 +-
wled00/file.cpp | 58 +-
wled00/hue.cpp | 6 +-
wled00/image_loader.cpp | 24 +-
wled00/improv.cpp | 6 +-
wled00/ir.cpp | 66 +-
wled00/ir_codes.h | 6 +-
wled00/json.cpp | 104 +-
wled00/led.cpp | 30 +-
wled00/mqtt.cpp | 22 +-
wled00/my_config_sample.h | 24 +-
wled00/net_debug.h | 2 +-
wled00/network.cpp | 24 +-
wled00/ntp.cpp | 36 +-
wled00/ota_update.cpp | 198 +-
wled00/ota_update.h | 86 +-
wled00/overlay.cpp | 4 +-
wled00/palettes.cpp | 110 +-
wled00/pin_manager.cpp | 48 +-
wled00/pin_manager.h | 36 +-
wled00/playlist.cpp | 4 +-
wled00/presets.cpp | 18 +-
wled00/remote.cpp | 22 +-
wled00/set.cpp | 76 +-
wled00/src/dependencies/dmx/ESPDMX.cpp | 20 +-
wled00/src/dependencies/dmx/ESPDMX.h | 6 +-
wled00/src/dependencies/dmx/SparkFunDMX.cpp | 24 +-
wled00/src/dependencies/dmx/SparkFunDMX.h | 6 +-
wled00/src/dependencies/e131/ESPAsyncE131.cpp | 18 +-
wled00/src/dependencies/e131/ESPAsyncE131.h | 34 +-
wled00/src/dependencies/espalexa/Espalexa.h | 70 +-
.../dependencies/espalexa/EspalexaDevice.cpp | 8 +-
wled00/src/dependencies/json/AsyncJson-v6.h | 10 +-
wled00/src/dependencies/network/Network.cpp | 2 +-
wled00/src/dependencies/time/DS1307RTC.cpp | 38 +-
wled00/src/dependencies/time/DS1307RTC.h | 8 +-
wled00/src/dependencies/time/DateStrings.cpp | 10 +-
wled00/src/dependencies/time/Time.cpp | 46 +-
wled00/src/dependencies/time/TimeLib.h | 24 +-
wled00/src/dependencies/timezone/Timezone.cpp | 54 +-
wled00/src/dependencies/timezone/Timezone.h | 6 +-
wled00/src/dependencies/toki/Toki.h | 18 +-
wled00/src/font/console_font_4x6.h | 514 ++---
wled00/src/font/console_font_5x12.h | 514 ++---
wled00/src/font/console_font_5x8.h | 514 ++---
wled00/src/font/console_font_6x8.h | 514 ++---
wled00/src/font/console_font_7x9.h | 514 ++---
wled00/udp.cpp | 138 +-
wled00/um_manager.cpp | 12 +-
wled00/usermod.cpp | 12 +-
wled00/util.cpp | 210 +-
wled00/wled.cpp | 52 +-
wled00/wled.h | 140 +-
wled00/wled_eeprom.cpp | 50 +-
wled00/wled_ethernet.h | 20 +-
wled00/wled_main.cpp | 10 +-
wled00/wled_math.cpp | 76 +-
wled00/wled_metadata.cpp | 54 +-
wled00/wled_metadata.h | 36 +-
wled00/wled_serial.cpp | 12 +-
wled00/wled_server.cpp | 64 +-
wled00/ws.cpp | 42 +-
wled00/xml.cpp | 24 +-
213 files changed, 8359 insertions(+), 7255 deletions(-)
create mode 100644 tools/check-translations.js
create mode 100644 tools/translate-all-comments.js
create mode 100644 tools/translate-comments.js
diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md
index bc1f9761a9..437f4590d0 100644
--- a/.github/copilot-instructions.md
+++ b/.github/copilot-instructions.md
@@ -4,6 +4,26 @@ WLED is a fast and feature-rich implementation of an ESP32 and ESP8266 webserver
Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.
+## Architecture Overview
+
+**Two-layer system**: Web UI (JavaScript/HTML/CSS) + Embedded firmware (C++).
+
+1. **Web UI layer** (`wled00/data/`): Frontend served by ESP device or HTTP server
+ - Single-page app using vanilla JavaScript (no frameworks)
+ - State management in global variables (e.g., `isOn`, `selectedFx`, `segCount`)
+ - Color picker (iro.js library) and effects driven by JSON API
+ - Pages generated via template pattern: `index.htm` (main), `settings*.htm` (config), `*.htm` (utilities)
+
+2. **Firmware layer** (`wled00/*.cpp/.h`): C++ on microcontroller
+ - Effect system: `FX.cpp` (100+ effects), `palettes.cpp` (50+ color palettes)
+ - LED management: `bus_manager.h` (multi-strip support), `pin_manager.h` (GPIO allocation)
+ - Protocol handlers: `json.cpp` (REST API), `ws.cpp` (WebSocket), `mqtt.cpp`, `udp.cpp`, `e131.cpp`
+ - Usermod system: Plugin architecture for extensions (v1 simple, v2 class-based)
+
+3. **Build bridge**: `tools/cdata.js` embeds minified web UI into C++ headers (`html_*.h`)
+ - Inlines CSS/JS, gzips for size, generates C arrays for firmware
+ - These headers are included in firmware binary—cannot edit directly
+
## Working Effectively
### Initial Setup
@@ -75,6 +95,31 @@ After making changes to web UI, always test:
- **Effects**: Test effect selection and parameter changes
- **Settings**: Test form submission and validation
+## Code Patterns and Conventions
+
+### Web UI Patterns
+- **Global state variables**: `isOn`, `nlA` (nightlight active), `selectedFx`, `selectedPal`, `csel` (color slot), `segCount`
+- **Utility functions** (`common.js`): `gId()` (getElementById), `cE()` (createElement), `isN()` (isNumeric), `isO()` (isObject)
+- **JSON API communication**: `requestJson()` to GET `/json/state`, `SetV()` to update UI from response
+- **Form submission**: Settings pages POST to `/settings/` endpoints; web UI listens for config with `preGetV()` hook before `GetV()`
+- **Tabs system**: `toggle()` function hides/shows divs with `.hide` class
+- **Color management**: Color slots use HTML dataset attributes (`data-r`, `data-g`, `data-b`, `data-w`)
+
+### Firmware Patterns (C++)
+- **Version format**: `#define VERSION 2506160` (yymmddb format)
+- **Feature flags**: Conditional compilation via `#define WLED_ENABLE_*` / `#define WLED_DISABLE_*` in `wled.h`
+- **Usermod v2 API**: Inherit from `Usermod` class, override `setup()`, `connected()`, `loop()`, `addToConfig()`, `readFromConfig()`
+- **Usermod v1 API**: Simple callbacks `userSetup()`, `userConnected()`, `userLoop()` — limited but useful for small mods
+- **Segment system**: LEDs grouped into "segments" with individual colors/effects—core WLED feature
+- **EEPROM storage**: Config persisted in EEPROM; usermod v1 uses bytes 2551-2559 (8 bytes) or 2750+ (custom size)
+
+### Build System Conventions
+- **Tabs in web files** (`.html`, `.css`, `.js`), **2-space indentation in C++** (`.cpp`, `.h`)
+- **Header files auto-generated**: Never edit `html_*.h` — always edit source in `wled00/data/` instead
+- **Environment selection**: Use `platformio_override.ini` for custom boards/usermods, don't modify main `platformio.ini`
+- **Usermod registration**: Add `#include "usermod_*.h"` + `registerUsermod(new ClassName())` in `usermods_list.cpp`
+- **Custom usermods**: Specify in `platformio.ini` with `custom_usermods = mod1,mod2` or in `platformio_override.ini`
+
## Common Tasks
### Repository Structure
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index d73ba5b7d9..f6a32c2256 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -111,12 +111,12 @@ Good:
```
// This is a comment.
-/* This is a CSS inline comment */
+/* This is a CSS en línea comment */
/*
* This is a comment
* wrapping over multiple lines,
- * used in WLED for file headers and function explanations
+ * used in WLED for archivo headers and función explanations
*/
diff --git a/include/README b/include/README
index 194dcd4325..d3c50ecfa7 100644
--- a/include/README
+++ b/include/README
@@ -1,10 +1,10 @@
-This directory is intended for project header files.
+Este directorio está destinado a los archivos de encabezado del proyecto.
-A header file is a file containing C declarations and macro definitions
-to be shared between several project source files. You request the use of a
-header file in your project source file (C, C++, etc) located in `src` folder
-by including it, with the C preprocessing directive `#include'.
+Un archivo de encabezado es un archivo que contiene declaraciones de C y definiciones de macros
+que se compartirán entre varios archivos fuente del proyecto. Solicita el uso de un
+archivo de encabezado en su archivo fuente del proyecto (C, C++, etc) ubicado en la carpeta `src`
+incluyéndolo con la directiva de preprocesamiento de C `#include'.
```src/main.c
@@ -16,20 +16,19 @@ int main (void)
}
```
-Including a header file produces the same results as copying the header file
-into each source file that needs it. Such copying would be time-consuming
-and error-prone. With a header file, the related declarations appear
-in only one place. If they need to be changed, they can be changed in one
-place, and programs that include the header file will automatically use the
-new version when next recompiled. The header file eliminates the labor of
-finding and changing all the copies as well as the risk that a failure to
-find one copy will result in inconsistencies within a program.
+Incluir un archivo de encabezado produce los mismos resultados que copiar el archivo de encabezado
+en cada archivo fuente que lo necesita. Tal copia sería lenta
+y propensa a errores. Con un archivo de encabezado, las declaraciones relacionadas aparecen
+en un solo lugar. Si es necesario cambiarlas, se pueden cambiar en un
+lugar, y los programas que incluyen el archivo de encabezado usarán automáticamente la
+nueva versión cuando se recompilen. El archivo de encabezado elimina el trabajo de
+encontrar y cambiar todas las copias, así como el riesgo de que no encontrar una copia resulte en inconsistencias dentro de un programa.
-In C, the usual convention is to give header files names that end with `.h'.
-It is most portable to use only letters, digits, dashes, and underscores in
-header file names, and at most one dot.
+En C, la convención habitual es dar a los archivos de encabezado nombres que terminen con `.h'.
+Es más portátil usar solo letras, dígitos, guiones e guiones bajos en
+nombres de archivos de encabezado, y como máximo un punto.
-Read more about using header files in official GCC documentation:
+Lea más sobre el uso de archivos de encabezado en la documentación oficial de GCC:
* Include Syntax
* Include Operation
diff --git a/lib/ESP8266PWM/src/core_esp8266_waveform_phase.cpp b/lib/ESP8266PWM/src/core_esp8266_waveform_phase.cpp
index 68cb9010ec..d9927a437b 100644
--- a/lib/ESP8266PWM/src/core_esp8266_waveform_phase.cpp
+++ b/lib/ESP8266PWM/src/core_esp8266_waveform_phase.cpp
@@ -1,6 +1,6 @@
-/* esp8266_waveform imported from platform source code
- Modified for WLED to work around a fault in the NMI handling,
- which can result in the system locking up and hard WDT crashes.
+/* esp8266_waveform imported from plataforma source código
+ Modified for WLED to work around a fallo in the NMI handling,
+ which can resultado in the sistema locking up and hard WDT crashes.
Imported from https://github.com/esp8266/Arduino/blob/7e0d20e2b9034994f573a236364e0aef17fd66de/cores/esp8266/core_esp8266_waveform_phase.cpp
*/
@@ -13,38 +13,38 @@
Copyright (c) 2018 Earle F. Philhower, III. All rights reserved.
Copyright (c) 2020 Dirk O. Kaar.
- The core idea is to have a programmable waveform generator with a unique
- high and low period (defined in microseconds or CPU clock cycles). TIMER1 is
+ The core idea is to have a programmable waveform generador with a unique
+ high and low período (defined in microseconds or CPU clock cycles). TIMER1 is
set to 1-shot mode and is always loaded with the time until the next edge
of any live waveforms.
- Up to one waveform generator per pin supported.
+ Up to one waveform generador per pin supported.
- Each waveform generator is synchronized to the ESP clock cycle counter, not the
- timer. This allows for removing interrupt jitter and delay as the counter
+ Each waveform generador is synchronized to the ESP clock cycle counter, not the
+ temporizador. This allows for removing interrupción inestabilidad and retraso as the counter
always increments once per 80MHz clock. Changes to a waveform are
- contiguous and only take effect on the next waveform transition,
+ contiguous and only take efecto on the next waveform transición,
allowing for smooth transitions.
This replaces older tone(), analogWrite(), and the Servo classes.
- Everywhere in the code where "ccy" or "ccys" is used, it means ESP.getCycleCount()
- clock cycle time, or an interval measured in clock cycles, but not TIMER1
+ Everywhere in the código where "ccy" or "ccys" is used, it means ESP.getCycleCount()
+ clock cycle time, or an intervalo measured in clock cycles, but not TIMER1
cycles (which may be 2 CPU clock cycles @ 160MHz).
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
+ This biblioteca is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Público
License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
+ versión 2.1 of the License, or (at your option) any later versión.
- This library is distributed in the hope that it will be useful,
+ This biblioteca is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+ Lesser General Público License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ You should have received a copy of the GNU Lesser General Público
+ License along with this biblioteca; if not, escribir to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Piso, Boston, MA 02110-1301 USA
*/
#include "core_esp8266_waveform.h"
@@ -54,16 +54,16 @@
#include
-// ----- @willmmiles begin patch -----
+// ----- @willmmiles begin parche -----
// Linker magic
extern "C" void usePWMFixedNMI(void) {};
-// NMI crash workaround
-// Sometimes the NMI fails to return, stalling the CPU. When this happens,
-// the next NMI gets a return address /inside the NMI handler function/.
-// We work around this by caching the last NMI return address, and restoring
+// NMI bloqueo workaround
+// Sometimes the NMI fails to retorno, stalling the CPU. When this happens,
+// the next NMI gets a retorno address /inside the NMI manejador función/.
+// We work around this by caching the last NMI retorno address, and restoring
// the epc3 and eps3 registers to the previous values if the observed epc3
-// happens to be pointing to the _NMILevelVector function.
+// happens to be pointing to the _NMILevelVector función.
extern "C" void _NMILevelVector();
extern "C" void _UserExceptionVector_1(); // the next function after _NMILevelVector
static inline IRAM_ATTR void nmiCrashWorkaround() {
@@ -72,32 +72,32 @@ static inline IRAM_ATTR void nmiCrashWorkaround() {
uintptr_t epc3, eps3;
__asm__ __volatile__("rsr %0,epc3; rsr %1,eps3":"=a"(epc3),"=a" (eps3));
if ((epc3 < (uintptr_t) &_NMILevelVector) || (epc3 >= (uintptr_t) &_UserExceptionVector_1)) {
- // Address is good; save backup
+ // Address is good; guardar backup
epc3_backup = epc3;
eps3_backup = eps3;
} else {
- // Address is inside the NMI handler -- restore from backup
+ // Address is inside the NMI manejador -- restore from backup
__asm__ __volatile__("wsr %0,epc3; wsr %1,eps3"::"a"(epc3_backup),"a"(eps3_backup));
}
}
-// ----- @willmmiles end patch -----
+// ----- @willmmiles end parche -----
-// No-op calls to override the PWM implementation
+// No-op calls to anular the PWM implementación
extern "C" void _setPWMFreq_weak(uint32_t freq) { (void) freq; }
extern "C" IRAM_ATTR bool _stopPWM_weak(int pin) { (void) pin; return false; }
extern "C" bool _setPWM_weak(int pin, uint32_t val, uint32_t range) { (void) pin; (void) val; (void) range; return false; }
-// Timer is 80MHz fixed. 160MHz CPU frequency need scaling.
+// Temporizador is 80MHz fixed. 160MHz CPU frecuencia need scaling.
constexpr bool ISCPUFREQ160MHZ = clockCyclesPerMicrosecond() == 160;
-// Maximum delay between IRQs, Timer1, <= 2^23 / 80MHz
+// Máximo retraso between IRQs, Timer1, <= 2^23 / 80MHz
constexpr int32_t MAXIRQTICKSCCYS = microsecondsToClockCycles(10000);
-// Maximum servicing time for any single IRQ
+// Máximo servicing time for any single IRQ
constexpr uint32_t ISRTIMEOUTCCYS = microsecondsToClockCycles(18);
-// The latency between in-ISR rearming of the timer and the earliest firing
+// The latencia between in-ISR rearming of the temporizador and the earliest firing
constexpr int32_t IRQLATENCYCCYS = microsecondsToClockCycles(2);
-// The SDK and hardware take some time to actually get to our NMI code
+// The SDK and hardware take some time to actually get to our NMI código
constexpr int32_t DELTAIRQCCYS = ISCPUFREQ160MHZ ?
microsecondsToClockCycles(2) >> 1 : microsecondsToClockCycles(2);
@@ -108,7 +108,7 @@ constexpr int32_t DELTAIRQCCYS = ISCPUFREQ160MHZ ?
// for INIT, the NMI initializes nextPeriodCcy, and if expiryCcy != 0 includes UPDATEEXPIRY.
enum class WaveformMode : uint8_t {INFINITE = 0, EXPIRES = 1, UPDATEEXPIRY = 2, UPDATEPHASE = 3, INIT = 4};
-// Waveform generator can create tones, PWM, and servos
+// Waveform generador can crear tones, PWM, and servos
typedef struct {
uint32_t nextPeriodCcy; // ESP clock cycle when a period begins.
uint32_t endDutyCcy; // ESP clock cycle when going from duty to off
@@ -127,7 +127,7 @@ namespace {
uint32_t states = 0; // Is the pin high or low, updated in NMI so no access outside the NMI code
uint32_t enabled = 0; // Is it actively running, updated in NMI so no access outside the NMI code
- // Enable lock-free by only allowing updates to waveform.states and waveform.enabled from IRQ service routine
+ // Habilitar bloqueo-free by only allowing updates to waveform.states and waveform.enabled from IRQ servicio rutina
int32_t toSetBits = 0; // Message to the NMI handler to start/modify exactly one waveform
int32_t toDisableBits = 0; // Message to the NMI handler to disable exactly one pin from waveform generation
@@ -145,10 +145,10 @@ namespace {
}
-// Interrupt on/off control
+// Interrupción on/off control
static IRAM_ATTR void timer1Interrupt();
-// Non-speed critical bits
+// Non-velocidad critical bits
#pragma GCC optimize ("Os")
static void initTimer() {
@@ -169,7 +169,7 @@ static void IRAM_ATTR deinitTimer() {
extern "C" {
-// Set a callback. Pass in NULL to stop it
+// Set a devolución de llamada. Pass in NULO to detener it
void setTimer1Callback_weak(uint32_t (*fn)()) {
waveform.timer1CB = fn;
std::atomic_thread_fence(std::memory_order_acq_rel);
@@ -180,8 +180,8 @@ void setTimer1Callback_weak(uint32_t (*fn)()) {
}
}
-// Start up a waveform on a pin, or change the current one. Will change to the new
-// waveform smoothly on next low->high transition. For immediate change, stopWaveform()
+// Iniciar up a waveform on a pin, or change the current one. Will change to the new
+// waveform smoothly on next low->high transición. For immediate change, stopWaveform()
// first, then it will immediately begin.
int startWaveformClockCycles_weak(uint8_t pin, uint32_t highCcys, uint32_t lowCcys,
uint32_t runTimeCcys, int8_t alignPhase, uint32_t phaseOffsetCcys, bool autoPwm) {
@@ -230,7 +230,7 @@ int startWaveformClockCycles_weak(uint8_t pin, uint32_t highCcys, uint32_t lowCc
initTimer();
}
else if (T1V > IRQLATENCYCCYS) {
- // Must not interfere if Timer is due shortly
+ // Must not interfere if Temporizador is due shortly
timer1_write(IRQLATENCYCCYS);
}
}
@@ -259,18 +259,18 @@ int startWaveformClockCycles_weak(uint8_t pin, uint32_t highCcys, uint32_t lowCc
// Stops a waveform on a pin
IRAM_ATTR int stopWaveform_weak(uint8_t pin) {
- // Can't possibly need to stop anything if there is no timer active
+ // Can't possibly need to detener anything if there is no temporizador active
if (!waveform.timer1Running) {
return false;
}
- // If user sends in a pin >16 but <32, this will always point to a 0 bit
- // If they send >=32, then the shift will result in 0 and it will also return false
+ // If usuario sends in a pin >16 but <32, this will always point to a 0 bit
+ // If they enviar >=32, then the shift will resultado in 0 and it will also retorno falso
std::atomic_thread_fence(std::memory_order_acquire);
const uint32_t pinBit = 1UL << pin;
if (waveform.enabled & pinBit) {
waveform.toDisableBits = 1UL << pin;
std::atomic_thread_fence(std::memory_order_release);
- // Must not interfere if Timer is due shortly
+ // Must not interfere if Temporizador is due shortly
if (T1V > IRQLATENCYCCYS) {
timer1_write(IRQLATENCYCCYS);
}
@@ -287,11 +287,11 @@ IRAM_ATTR int stopWaveform_weak(uint8_t pin) {
};
-// Speed critical bits
+// Velocidad critical bits
#pragma GCC optimize ("O2")
-// For dynamic CPU clock frequency switch in loop the scaling logic would have to be adapted.
-// Using constexpr makes sure that the CPU clock frequency is compile-time fixed.
+// For dynamic CPU clock frecuencia conmutador in bucle the scaling logic would have to be adapted.
+// Usando constexpr makes sure that the CPU clock frecuencia is compile-time fixed.
static inline IRAM_ATTR int32_t scaleCcys(const int32_t ccys, const bool isCPU2X) {
if (ISCPUFREQ160MHZ) {
return isCPU2X ? ccys : (ccys >> 1);
@@ -305,15 +305,15 @@ static IRAM_ATTR void timer1Interrupt() {
const uint32_t isrStartCcy = ESP.getCycleCount();
//int32_t clockDrift = isrStartCcy - waveform.nextEventCcy;
- // ----- @willmmiles begin patch -----
+ // ----- @willmmiles begin parche -----
nmiCrashWorkaround();
- // ----- @willmmiles end patch -----
+ // ----- @willmmiles end parche -----
const bool isCPU2X = CPU2X & 1;
if ((waveform.toSetBits && !(waveform.enabled & waveform.toSetBits)) || waveform.toDisableBits) {
- // Handle enable/disable requests from main app.
+ // Handle habilitar/deshabilitar requests from principal app.
waveform.enabled = (waveform.enabled & ~waveform.toDisableBits) | waveform.toSetBits; // Set the requested waveforms on/off
- // Find the first GPIO being generated by checking GCC's find-first-set (returns 1 + the bit of the first 1 in an int32_t)
+ // Encontrar the first GPIO being generated by checking GCC's encontrar-first-set (returns 1 + the bit of the first 1 in an int32_t)
waveform.toDisableBits = 0;
}
@@ -335,7 +335,7 @@ static IRAM_ATTR void timer1Interrupt() {
}
// fall through
case WaveformMode::UPDATEEXPIRY:
- // in WaveformMode::UPDATEEXPIRY, expiryCcy temporarily holds relative CPU cycle count
+ // in WaveformMode::UPDATEEXPIRY, expiryCcy temporarily holds relative CPU cycle conteo
wave.expiryCcy = wave.nextPeriodCcy + scaleCcys(wave.expiryCcy, isCPU2X);
wave.mode = WaveformMode::EXPIRES;
break;
@@ -358,7 +358,7 @@ static IRAM_ATTR void timer1Interrupt() {
waveform.toSetBits = 0;
}
- // Exit the loop if the next event, if any, is sufficiently distant.
+ // Salida the bucle if the next evento, if any, is sufficiently distant.
const uint32_t isrTimeoutCcy = isrStartCcy + ISRTIMEOUTCCYS;
uint32_t busyPins = waveform.enabled;
waveform.nextEventCcy = isrStartCcy + MAXIRQTICKSCCYS;
@@ -391,7 +391,7 @@ static IRAM_ATTR void timer1Interrupt() {
if (WaveformMode::EXPIRES == wave.mode &&
static_cast(waveNextEventCcy - wave.expiryCcy) >= 0 &&
static_cast(now - wave.expiryCcy) >= 0) {
- // Disable any waveforms that are done
+ // Deshabilitar any waveforms that are done
waveform.enabled ^= pinBit;
busyPins ^= pinBit;
}
@@ -475,13 +475,13 @@ static IRAM_ATTR void timer1Interrupt() {
}
now = ESP.getCycleCount();
int32_t nextEventCcys = waveform.nextEventCcy - now;
- // Account for unknown duration of timer1CB().
+ // Account for unknown duración of timer1CB().
if (waveform.timer1CB && nextEventCcys > callbackCcys) {
waveform.nextEventCcy = now + callbackCcys;
nextEventCcys = callbackCcys;
}
- // Timer is 80MHz fixed. 160MHz CPU frequency need scaling.
+ // Temporizador is 80MHz fixed. 160MHz CPU frecuencia need scaling.
int32_t deltaIrqCcys = DELTAIRQCCYS;
int32_t irqLatencyCcys = IRQLATENCYCCYS;
if (isCPU2X) {
@@ -490,7 +490,7 @@ static IRAM_ATTR void timer1Interrupt() {
irqLatencyCcys >>= 1;
}
- // Firing timer too soon, the NMI occurs before ISR has returned.
+ // Firing temporizador too soon, the NMI occurs before ISR has returned.
if (nextEventCcys < irqLatencyCcys + deltaIrqCcys) {
waveform.nextEventCcy = now + IRQLATENCYCCYS + DELTAIRQCCYS;
nextEventCcys = irqLatencyCcys;
@@ -499,6 +499,6 @@ static IRAM_ATTR void timer1Interrupt() {
nextEventCcys -= deltaIrqCcys;
}
- // Register access is fast and edge IRQ was configured before.
+ // Register acceso is fast and edge IRQ was configured before.
T1L = nextEventCcys;
}
diff --git a/lib/NeoESP32RmtHI/include/NeoEsp32RmtHIMethod.h b/lib/NeoESP32RmtHI/include/NeoEsp32RmtHIMethod.h
index 02e066f741..a058d987f9 100644
--- a/lib/NeoESP32RmtHI/include/NeoEsp32RmtHIMethod.h
+++ b/lib/NeoESP32RmtHI/include/NeoEsp32RmtHIMethod.h
@@ -1,48 +1,48 @@
/*-------------------------------------------------------------------------
-NeoPixel driver for ESP32 RMTs using High-priority Interrupt
+NeoPixel controlador for ESP32 RMTs usando High-priority Interrupción
-(NB. This cannot be mixed with the non-HI driver.)
+(NB. This cannot be mixed with the non-HI controlador.)
Written by Will M. Miles.
-I invest time and resources providing this open source code,
+I invest time and resources providing this open source código,
please support me by donating (see https://github.com/Makuna/NeoPixelBus)
-------------------------------------------------------------------------
-This file is part of the Makuna/NeoPixelBus library.
+This archivo is part of the Makuna/NeoPixelBus biblioteca.
NeoPixelBus is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation, either version 3 of
-the License, or (at your option) any later version.
+it under the terms of the GNU Lesser General Público License as
+published by the Free Software Foundation, either versión 3 of
+the License, or (at your option) any later versión.
NeoPixelBus is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Lesser General Public License for more details.
+GNU Lesser General Público License for more details.
-You should have received a copy of the GNU Lesser General Public
+You should have received a copy of the GNU Lesser General Público
License along with NeoPixel. If not, see
-.
+.
-------------------------------------------------------------------------*/
#pragma once
#if defined(ARDUINO_ARCH_ESP32)
-// Use the NeoEspRmtSpeed types from the driver-based implementation
+// Use the NeoEspRmtSpeed types from the controlador-based implementación
#include
namespace NeoEsp32RmtHiMethodDriver {
- // Install the driver for a specific channel, specifying timing properties
+ // Install the controlador for a specific channel, specifying timing properties
esp_err_t Install(rmt_channel_t channel, uint32_t rmtBit0, uint32_t rmtBit1, uint32_t resetDuration);
- // Remove the driver on a specific channel
+ // Eliminar the controlador on a specific channel
esp_err_t Uninstall(rmt_channel_t channel);
- // Write a buffer of data to a specific channel.
- // Buffer reference is held until write completes.
+ // Escribir a búfer of datos to a specific channel.
+ // Búfer reference is held until escribir completes.
esp_err_t Write(rmt_channel_t channel, const uint8_t *src, size_t src_size);
// Wait until transaction is complete.
@@ -71,7 +71,7 @@ template class NeoEsp32RmtHIMethodBase
~NeoEsp32RmtHIMethodBase()
{
- // wait until the last send finishes before destructing everything
+ // wait until the last enviar finishes before destructing everything
// arbitrary time out of 10 seconds
ESP_ERROR_CHECK_WITHOUT_ABORT(NeoEsp32RmtHiMethodDriver::WaitForTxDone(_channel.RmtChannelNumber, 10000 / portTICK_PERIOD_MS));
@@ -113,30 +113,30 @@ template class NeoEsp32RmtHIMethodBase
void Update(bool maintainBufferConsistency)
{
- // wait for not actively sending data
- // this will time out at 10 seconds, an arbitrarily long period of time
+ // wait for not actively sending datos
+ // this will time out at 10 seconds, an arbitrarily long período of time
// and do nothing if this happens
if (ESP_OK == ESP_ERROR_CHECK_WITHOUT_ABORT(NeoEsp32RmtHiMethodDriver::WaitForTxDone(_channel.RmtChannelNumber, 10000 / portTICK_PERIOD_MS)))
{
- // now start the RMT transmit with the editing buffer before we swap
+ // now iniciar the RMT transmit with the editing búfer before we swap
ESP_ERROR_CHECK_WITHOUT_ABORT(NeoEsp32RmtHiMethodDriver::Write(_channel.RmtChannelNumber, _dataEditing, _sizeData));
if (maintainBufferConsistency)
{
// copy editing to sending,
- // this maintains the contract that "colors present before will
+ // this maintains the contrato that "colors present before will
// be the same after", otherwise GetPixelColor will be inconsistent
memcpy(_dataSending, _dataEditing, _sizeData);
}
- // swap so the user can modify without affecting the async operation
+ // swap so the usuario can modify without affecting the asíncrono operation
std::swap(_dataSending, _dataEditing);
}
}
bool AlwaysUpdate()
{
- // this method requires update to be called only if changes to buffer
+ // this método requires actualizar to be called only if changes to búfer
return false;
}
@@ -165,7 +165,7 @@ template class NeoEsp32RmtHIMethodBase
const uint8_t _pin; // output pin number
const T_CHANNEL _channel; // holds instance for multi channel support
- // Holds data stream which include LED color values and other settings as needed
+ // Holds datos stream which incluir LED color values and other settings as needed
uint8_t* _dataEditing; // exposed for get and set
uint8_t* _dataSending; // used for async send using RMT
@@ -173,10 +173,10 @@ template class NeoEsp32RmtHIMethodBase
void construct()
{
_dataEditing = static_cast(malloc(_sizeData));
- // data cleared later in Begin()
+ // datos cleared later in Begin()
_dataSending = static_cast(malloc(_sizeData));
- // no need to initialize it, it gets overwritten on every send
+ // no need to inicializar it, it gets overwritten on every enviar
}
};
diff --git a/lib/NeoESP32RmtHI/src/NeoEsp32RmtHIMethod.cpp b/lib/NeoESP32RmtHI/src/NeoEsp32RmtHIMethod.cpp
index 8353201f08..0db95e3915 100644
--- a/lib/NeoESP32RmtHI/src/NeoEsp32RmtHIMethod.cpp
+++ b/lib/NeoESP32RmtHI/src/NeoEsp32RmtHIMethod.cpp
@@ -1,30 +1,30 @@
/*-------------------------------------------------------------------------
-NeoPixel library helper functions for Esp32.
+NeoPixel biblioteca helper functions for Esp32.
-A BIG thanks to Andreas Merkle for the investigation and implementation of
-a workaround to the GCC bug that drops method attributes from template methods
+A BIG thanks to Andreas Merkle for the investigation and implementación of
+a workaround to the GCC bug that drops método attributes from plantilla methods
Written by Michael C. Miller.
-I invest time and resources providing this open source code,
+I invest time and resources providing this open source código,
please support me by donating (see https://github.com/Makuna/NeoPixelBus)
-------------------------------------------------------------------------
-This file is part of the Makuna/NeoPixelBus library.
+This archivo is part of the Makuna/NeoPixelBus biblioteca.
NeoPixelBus is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation, either version 3 of
-the License, or (at your option) any later version.
+it under the terms of the GNU Lesser General Público License as
+published by the Free Software Foundation, either versión 3 of
+the License, or (at your option) any later versión.
NeoPixelBus is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Lesser General Public License for more details.
+GNU Lesser General Público License for more details.
-You should have received a copy of the GNU Lesser General Public
+You should have received a copy of the GNU Lesser General Público
License along with NeoPixel. If not, see
-.
+.
-------------------------------------------------------------------------*/
#include
@@ -49,14 +49,14 @@ License along with NeoPixel. If not, see
#include "soc/rmt_struct.h"
// Selected RMT API functions borrowed from ESP-IDF v4.4.8
-// components/hal/esp32/include/hal/rmt_ll.h
+// components/hal/esp32/incluir/hal/rmt_ll.h
// Copyright 2019 Espressif Systems (Shanghai) PTE LTD
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
+// Licensed under the Apache License, Versión 2.0 (the "License");
+// you may not use this archivo except in compliance with the License.
// You may obtain a copy of the License at
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// HTTP://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@@ -170,28 +170,28 @@ static inline uint32_t rmt_ll_get_tx_thres_interrupt_status(rmt_dev_t *dev)
// *********************************
-// Select method for binding interrupt
+// Select método for binding interrupción
//
-// - If the Bluetooth driver has registered a high-level interrupt, piggyback on that API
-// - If we're on a modern core, allocate the interrupt with the API (old cores are bugged)
-// - Otherwise use the low-level hardware API to manually bind the interrupt
+// - If the Bluetooth controlador has registered a high-nivel interrupción, piggyback on that API
+// - If we're on a modern core, allocate the interrupción with the API (old cores are bugged)
+// - Otherwise use the low-nivel hardware API to manually bind the interrupción
#if defined(CONFIG_BTDM_CTRL_HLI)
-// Espressif's bluetooth driver offers a helpful sharing layer; bring in the interrupt management calls
+// Espressif's bluetooth controlador offers a helpful sharing capa; bring in the interrupción management calls
#include "hal/interrupt_controller_hal.h"
extern "C" esp_err_t hli_intr_register(intr_handler_t handler, void* arg, uint32_t intr_reg, uint32_t intr_mask);
#else /* !CONFIG_BTDM_CTRL_HLI*/
-// Declare the our high-priority ISR handler
+// Declare the our high-priority ISR manejador
extern "C" void ld_include_hli_vectors_rmt(); // an object with an address, but no space
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3)
#include "soc/periph_defs.h"
#endif
-// Select level flag
+// Select nivel bandera
#if defined(__riscv)
// RISCV chips don't block interrupts while scheduling; all we need to do is be higher than the WiFi ISR
#define INT_LEVEL_FLAG ESP_INTR_FLAG_LEVEL3
@@ -201,8 +201,8 @@ extern "C" void ld_include_hli_vectors_rmt(); // an object with an address, bu
#define INT_LEVEL_FLAG ESP_INTR_FLAG_LEVEL5
#endif
-// ESP-IDF v3 cannot enable high priority interrupts through the API at all;
-// and ESP-IDF v4 on XTensa cannot enable Level 5 due to incorrect interrupt descriptor tables
+// ESP-IDF v3 cannot habilitar high priority interrupts through the API at all;
+// and ESP-IDF v4 on XTensa cannot habilitar Nivel 5 due to incorrect interrupción descriptor tables
#if !defined(__XTENSA__) || (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)) || ((ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 0, 0) && CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5))
#define NEOESP32_RMT_CAN_USE_INTR_ALLOC
@@ -217,14 +217,14 @@ extern "C" void ld_include_hli_vectors_rmt(); // an object with an address, bu
#else
/* !CONFIG_BTDM_CTRL_HLI && !NEOESP32_RMT_CAN_USE_INTR_ALLOC */
-// This is the index of the LV5 interrupt vector - see interrupt descriptor table in idf components/hal/esp32/interrupt_descriptor_table.c
+// This is the índice of the LV5 interrupción vector - see interrupción descriptor table in idf components/hal/esp32/interrupt_descriptor_table.c
#define ESP32_LV5_IRQ_INDEX 26
#endif /* NEOESP32_RMT_CAN_USE_INTR_ALLOC */
#endif /* CONFIG_BTDM_CTRL_HLI */
-// RMT driver implementation
+// RMT controlador implementación
struct NeoEsp32RmtHIChannelState {
uint32_t rmtBit0, rmtBit1;
uint32_t resetDuration;
@@ -243,8 +243,8 @@ static intr_handle_t isrHandle = nullptr;
static NeoEsp32RmtHIChannelState** driverState = nullptr;
constexpr size_t rmtBatchSize = RMT_MEM_ITEM_NUM / 2;
-// Fill the RMT buffer memory
-// This is implemented using many arguments instead of passing the structure object to ensure we do only one lookup
+// Fill the RMT búfer memoria
+// This is implemented usando many arguments instead of passing the structure object to ensure we do only one lookup
// All the arguments are passed in registers, so they don't need to be looked up again
static void IRAM_ATTR RmtFillBuffer(uint8_t channel, const byte** src_ptr, const byte* end, uint32_t bit0, uint32_t bit1, size_t* offset_ptr, size_t reserve) {
// We assume that (rmtToWrite % 8) == 0
@@ -275,19 +275,19 @@ static void IRAM_ATTR RmtFillBuffer(uint8_t channel, const byte** src_ptr, const
}
if (rmtToWrite > 0) {
- // Add end event
+ // Add end evento
rmt_item32_t bit0_val = {{.val = bit0 }};
*dest = rmt_item32_t {{{ .duration0 = 0, .level0 = bit0_val.level1, .duration1 = 0, .level1 = bit0_val.level1 }}};
}
}
static void IRAM_ATTR RmtStartWrite(uint8_t channel, NeoEsp32RmtHIChannelState& state) {
- // Reset context state
+ // Restablecer contexto estado
state.rmtOffset = 0;
- // Fill the first part of the buffer with a reset event
- // FUTURE: we could do timing analysis with the last interrupt on this channel
- // Use 8 words to stay aligned with the buffer fill logic
+ // Fill the first part of the búfer with a restablecer evento
+ // FUTURO: we could do timing análisis with the last interrupción on this channel
+ // Use 8 words to stay aligned with the búfer fill logic
rmt_item32_t bit0_val = {{.val = state.rmtBit0 }};
rmt_item32_t fill = {{{ .duration0 = 100, .level0 = bit0_val.level1, .duration1 = 100, .level1 = bit0_val.level1 }}};
rmt_item32_t* dest = (rmt_item32_t*) &RMTMEM.chan[channel].data32[0];
@@ -295,18 +295,18 @@ static void IRAM_ATTR RmtStartWrite(uint8_t channel, NeoEsp32RmtHIChannelState&
fill.duration1 = state.resetDuration > 1400 ? (state.resetDuration - 1400) : 100;
dest[7] = fill;
- // Fill the remaining buffer with real data
+ // Fill the remaining búfer with real datos
RmtFillBuffer(channel, &state.txDataCurrent, state.txDataEnd, state.rmtBit0, state.rmtBit1, &state.rmtOffset, 8);
RmtFillBuffer(channel, &state.txDataCurrent, state.txDataEnd, state.rmtBit0, state.rmtBit1, &state.rmtOffset, 0);
- // Start operation
+ // Iniciar operation
rmt_ll_clear_tx_thres_interrupt(&RMT, channel);
rmt_ll_tx_reset_pointer(&RMT, channel);
rmt_ll_tx_start(&RMT, channel);
}
extern "C" void IRAM_ATTR NeoEsp32RmtMethodIsr(void *arg) {
- // Tx threshold interrupt
+ // Tx umbral interrupción
uint32_t status = rmt_ll_get_tx_thres_interrupt_status(&RMT);
while (status) {
uint8_t channel = __builtin_ffs(status) - 1;
@@ -315,7 +315,7 @@ extern "C" void IRAM_ATTR NeoEsp32RmtMethodIsr(void *arg) {
NeoEsp32RmtHIChannelState& state = *driverState[channel];
RmtFillBuffer(channel, &state.txDataCurrent, state.txDataEnd, state.rmtBit0, state.rmtBit1, &state.rmtOffset, 0);
} else {
- // Danger - another driver got invoked?
+ // Danger - another controlador got invoked?
rmt_ll_tx_stop(&RMT, channel);
}
rmt_ll_clear_tx_thres_interrupt(&RMT, channel);
@@ -323,8 +323,8 @@ extern "C" void IRAM_ATTR NeoEsp32RmtMethodIsr(void *arg) {
}
};
-// Wrapper around the register analysis defines
-// For all currently supported chips, this is constant for all channels; but this is not true of *all* ESP32
+// Wrapper around the register análisis defines
+// For all currently supported chips, this is constante for all channels; but this is not verdadero of *all* ESP32
static inline bool _RmtStatusIsTransmitting(rmt_channel_t channel, uint32_t status) {
uint32_t v;
switch(channel) {
@@ -360,7 +360,7 @@ static inline bool _RmtStatusIsTransmitting(rmt_channel_t channel, uint32_t stat
esp_err_t NeoEsp32RmtHiMethodDriver::Install(rmt_channel_t channel, uint32_t rmtBit0, uint32_t rmtBit1, uint32_t reset) {
- // Validate channel number
+ // Validar channel number
if (channel >= RMT_CHANNEL_MAX) {
return ESP_ERR_INVALID_ARG;
}
@@ -375,21 +375,21 @@ esp_err_t NeoEsp32RmtHiMethodDriver::Install(rmt_channel_t channel, uint32_t rmt
RMT.int_ena.val = 0;
RMT.int_clr.val = 0xFFFFFFFF;
- // Bind interrupt handler
+ // Bind interrupción manejador
#if defined(CONFIG_BTDM_CTRL_HLI)
- // Bluetooth driver has taken the empty high-priority interrupt. Fortunately, it allows us to
- // hook up another handler.
+ // Bluetooth controlador has taken the empty high-priority interrupción. Fortunately, it allows us to
+ // hook up another manejador.
err = hli_intr_register(NeoEsp32RmtMethodIsr, nullptr, (uintptr_t) &RMT.int_st, 0xFF000000);
// 25 is the magic number of the bluetooth ISR on ESP32 - see soc/soc.h.
intr_matrix_set(cpu_hal_get_core_id(), ETS_RMT_INTR_SOURCE, 25);
intr_cntrl_ll_enable_interrupts(1<<25);
#elif defined(NEOESP32_RMT_CAN_USE_INTR_ALLOC)
- // Use the platform code to allocate the interrupt
+ // Use the plataforma código to allocate the interrupción
// If we need the additional assembly bridge, we pass it as the "arg" to the IDF so it gets linked in
err = esp_intr_alloc(ETS_RMT_INTR_SOURCE, INT_LEVEL_FLAG | ESP_INTR_FLAG_IRAM, HI_IRQ_HANDLER, (void*) HI_IRQ_HANDLER_ARG, &isrHandle);
//err = ESP_ERR_NOT_FINISHED;
#else
- // Broken IDF API does not allow us to reserve the interrupt; do it manually
+ // Broken IDF API does not allow us to reserve the interrupción; do it manually
static volatile const void* __attribute__((used)) pleaseLinkAssembly = (void*) ld_include_hli_vectors_rmt;
intr_matrix_set(xPortGetCoreID(), ETS_RMT_INTR_SOURCE, ESP32_LV5_IRQ_INDEX);
ESP_INTR_ENABLE(ESP32_LV5_IRQ_INDEX);
@@ -416,7 +416,7 @@ esp_err_t NeoEsp32RmtHiMethodDriver::Install(rmt_channel_t channel, uint32_t rmt
state->rmtBit1 = rmtBit1;
state->resetDuration = reset;
- // Initialize hardware
+ // Inicializar hardware
rmt_ll_tx_stop(&RMT, channel);
rmt_ll_tx_reset_pointer(&RMT, channel);
rmt_ll_enable_tx_err_interrupt(&RMT, channel, false);
@@ -451,7 +451,7 @@ esp_err_t NeoEsp32RmtHiMethodDriver::Uninstall(rmt_channel_t channel) {
heap_caps_free(state);
#if !defined(CONFIG_BTDM_CTRL_HLI) /* Cannot unbind from bluetooth ISR */
- // Turn off the driver ISR and release global state if none are left
+ // Turn off the controlador ISR and lanzamiento global estado if none are left
for (uint8_t channelIndex = 0; channelIndex < RMT_CHANNEL_MAX; ++channelIndex) {
if (driverState[channelIndex]) return ESP_OK; // done
}
diff --git a/lib/README b/lib/README
index 6debab1e8b..91637b498f 100644
--- a/lib/README
+++ b/lib/README
@@ -1,11 +1,11 @@
-This directory is intended for project specific (private) libraries.
-PlatformIO will compile them to static libraries and link into executable file.
+Este directorio está destinado a librerías específicas del proyecto (privadas).
+PlatformIO las compilará en librerías estáticas y las vinculará al archivo ejecutable.
-The source code of each library should be placed in a an own separate directory
-("lib/your_library_name/[here are source files]").
+El código fuente de cada librería debe colocarse en su propio directorio separado
+("lib/nombre_de_su_libreria/[aquí están los archivos fuente]").
-For example, see a structure of the following two libraries `Foo` and `Bar`:
+Por ejemplo, vea una estructura de las siguientes dos librerías `Foo` y `Bar`:
|--lib
| |
@@ -15,19 +15,19 @@ For example, see a structure of the following two libraries `Foo` and `Bar`:
| | |--src
| | |- Bar.c
| | |- Bar.h
-| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
+| | |- library.json (opcional, opciones de compilación personalizadas, etc) https://docs.platformio.org/page/librarymanager/config.html
| |
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |
-| |- README --> THIS FILE
+| |- README --> ESTE ARCHIVO
|
|- platformio.ini
|--src
|- main.c
-and a contents of `src/main.c`:
+y un contenido de `src/main.c`:
```
#include
#include
@@ -39,8 +39,8 @@ int main (void)
```
-PlatformIO Library Dependency Finder will find automatically dependent
-libraries scanning project source files.
+El Buscador de Dependencias de Librerías de PlatformIO encontrará automáticamente librerías dependientes
+escaneando archivos fuente del proyecto.
-More information about PlatformIO Library Dependency Finder
+Más información sobre el Buscador de Dependencias de Librerías de PlatformIO
- https://docs.platformio.org/page/librarymanager/ldf.html
diff --git a/readme.md b/readme.md
index bcdf5ab303..60e02db332 100644
--- a/readme.md
+++ b/readme.md
@@ -10,78 +10,78 @@
-# Welcome to WLED! ✨
-
-A fast and feature-rich implementation of an ESP32 and ESP8266 webserver to control NeoPixel (WS2812B, WS2811, SK6812) LEDs or also SPI based chipsets like the WS2801 and APA102!
-
-Originally created by [Aircoookie](https://github.com/Aircoookie)
-
-## ⚙️ Features
-- WS2812FX library with more than 100 special effects
-- FastLED noise effects and 50 palettes
-- Modern UI with color, effect and segment controls
-- Segments to set different effects and colors to user defined parts of the LED string
-- Settings page - configuration via the network
-- Access Point and station mode - automatic failsafe AP
-- [Up to 10 LED outputs](https://kno.wled.ge/features/multi-strip/#esp32) per instance
-- Support for RGBW strips
-- Up to 250 user presets to save and load colors/effects easily, supports cycling through them.
-- Presets can be used to automatically execute API calls
-- Nightlight function (gradually dims down)
-- Full OTA software updateability (HTTP + ArduinoOTA), password protectable
-- Configurable analog clock (Cronixie, 7-segment and EleksTube IPS clock support via usermods)
-- Configurable Auto Brightness limit for safe operation
-- Filesystem-based config for easier backup of presets and settings
-
-## 💡 Supported light control interfaces
-- WLED app for [Android](https://play.google.com/store/apps/details?id=ca.cgagnier.wlednativeandroid) and [iOS](https://apps.apple.com/gb/app/wled-native/id6446207239)
-- JSON and HTTP request APIs
+# ¡Bienvenido a WLED! ✨
+
+Una implementación rápida y rica en características de un servidor web ESP32 y ESP8266 para controlar LEDs NeoPixel (WS2812B, WS2811, SK6812) o también chipsets basados en SPI como el WS2801 y APA102.
+
+Creado originalmente por [Aircoookie](https://github.com/Aircoookie)
+
+## ⚙️ Características
+- Librería WS2812FX con más de 100 efectos especiales
+- Efectos de ruido de FastLED y 50 paletas
+- Interfaz moderna con controles de color, efecto y segmento
+- Segmentos para establecer diferentes efectos y colores en partes definidas por el usuario de la tira de LEDs
+- Página de configuración - configuración a través de la red
+- Modo Punto de Acceso y estación - AP de conmutación por error automática
+- [Hasta 10 salidas de LED](https://kno.wled.ge/features/multi-strip/#esp32) por instancia
+- Soporte para tiras RGBW
+- Hasta 250 presets de usuario para guardar y cargar colores/efectos fácilmente, admite ciclar a través de ellos.
+- Los presets se pueden usar para ejecutar automáticamente llamadas de API
+- Función de luz nocturna (se atenúa gradualmente)
+- Actualizabilidad completa del software OTA (HTTP + ArduinoOTA), protegible por contraseña
+- Reloj analógico configurable (soporte de reloj Cronixie, pantalla de 7 segmentos y EleksTube IPS a través de usermods)
+- Límite de brillo automático configurable para operación segura
+- Configuración basada en sistema de archivos para copia de seguridad más fácil de presets y configuración
+
+## 💡 Interfaces de control de luz soportadas
+- Aplicación WLED para [Android](https://play.google.com/store/apps/details?id=ca.cgagnier.wlednativeandroid) e [iOS](https://apps.apple.com/gb/app/wled-native/id6446207239)
+- APIs JSON y solicitudes HTTP
- MQTT
-- E1.31, Art-Net, DDP and TPM2.net
-- [diyHue](https://github.com/diyhue/diyHue) (Wled is supported by diyHue, including Hue Sync Entertainment under udp. Thanks to [Gregory Mallios](https://github.com/gmallios))
+- E1.31, Art-Net, DDP y TPM2.net
+- [diyHue](https://github.com/diyhue/diyHue) (Wled es soportado por diyHue, incluido Hue Sync Entertainment bajo udp. Gracias a [Gregory Mallios](https://github.com/gmallios))
- [Hyperion](https://github.com/hyperion-project/hyperion.ng)
-- UDP realtime
-- Alexa voice control (including dimming and color)
-- Sync to Philips hue lights
-- Adalight (PC ambilight via serial) and TPM2
-- Sync color of multiple WLED devices (UDP notifier)
-- Infrared remotes (24-key RGB, receiver required)
-- Simple timers/schedules (time from NTP, timezones/DST supported)
+- UDP en tiempo real
+- Control de voz de Alexa (incluyendo atenuación y color)
+- Sincronizar con luces Philips hue
+- Adalight (ambilight de PC a través de puerto serie) y TPM2
+- Sincronizar color de múltiples dispositivos WLED (notificador UDP)
+- Controles remotos por infrarrojos (RGB de 24 teclas, receptor requerido)
+- Temporizadores/horarios simples (tiempo de NTP, zonas horarias/DST soportadas)
-## 📲 Quick start guide and documentation
+## 📲 Guía de inicio rápido y documentación
-See the [documentation on our official site](https://kno.wled.ge)!
+¡Consulte la [documentación en nuestro sitio oficial](https://kno.wled.ge)!
-[On this page](https://kno.wled.ge/basics/tutorials/) you can find excellent tutorials and tools to help you get your new project up and running!
+[En esta página](https://kno.wled.ge/basics/tutorials/) puede encontrar excelentes tutoriales y herramientas para ayudarle a poner su nuevo proyecto en funcionamiento.
-## 🖼️ User interface
+## 🖼️ Interfaz de usuario
-## 💾 Compatible hardware
+## 💾 Hardware compatible
-See [here](https://kno.wled.ge/basics/compatible-hardware)!
+¡Vea [aquí](https://kno.wled.ge/basics/compatible-hardware)!
-## ✌️ Other
+## ✌️ Otros
-Licensed under the EUPL v1.2 license
-Credits [here](https://kno.wled.ge/about/contributors/)!
-CORS proxy by [Corsfix](https://corsfix.com/)
+Licenciado bajo la licencia EUPL v1.2
+Créditos [aquí](https://kno.wled.ge/about/contributors/)!
+Proxy CORS por [Corsfix](https://corsfix.com/)
-Join the Discord server to discuss everything about WLED!
+¡Únase al servidor de Discord para discutir todo sobre WLED!
-Check out the WLED [Discourse forum](https://wled.discourse.group)!
+¡Consulte el [foro de Discourse de WLED](https://wled.discourse.group)!
-You can also send me mails to [dev.aircoookie@gmail.com](mailto:dev.aircoookie@gmail.com), but please, only do so if you want to talk to me privately.
+También puede enviarme correos a [dev.aircoookie@gmail.com](mailto:dev.aircoookie@gmail.com), pero por favor, solo hágalo si desea hablar conmigo en privado.
-If WLED really brightens up your day, you can [](https://paypal.me/aircoookie)
+Si WLED realmente ilumina tu día, puedes [](https://paypal.me/aircoookie)
-*Disclaimer:*
+*Descargo de responsabilidad:*
-If you are prone to photosensitive epilepsy, we recommended you do **not** use this software.
-If you still want to try, don't use strobe, lighting or noise modes or high effect speed settings.
+Si sufre de epilepsia fotosensible, le recomendamos que **no** use este software.
+Si aún desea intentarlo, no use modos de estrobo, iluminación o ruido o configuraciones de velocidad de efecto alto.
-As per the EUPL license, I assume no liability for any damage to you or any other person or equipment.
+De conformidad con la licencia EUPL, no asumo responsabilidad alguna por daños a usted o cualquier otra persona o equipo.
diff --git a/test/README b/test/README
index df5066e64d..a72cf384df 100644
--- a/test/README
+++ b/test/README
@@ -1,11 +1,10 @@
-This directory is intended for PIO Unit Testing and project tests.
+Este directorio está destinado para las Pruebas Unitarias de PIO y pruebas del proyecto.
-Unit Testing is a software testing method by which individual units of
-source code, sets of one or more MCU program modules together with associated
-control data, usage procedures, and operating procedures, are tested to
-determine whether they are fit for use. Unit testing finds problems early
-in the development cycle.
+Las Pruebas Unitarias es un método de prueba de software mediante el cual unidades individuales de
+código fuente, conjuntos de uno o más módulos de programa de MCU junto con datos de control asociados,
+procedimientos de uso y procedimientos operativos, se prueban para determinar si son aptos para su uso.
+Las pruebas unitarias encuentran problemas al inicio del ciclo de desarrollo.
-More information about PIO Unit Testing:
+Más información sobre las Pruebas Unitarias de PIO:
- https://docs.platformio.org/page/plus/unit-testing.html
diff --git a/tools/cdata-test.js b/tools/cdata-test.js
index 6f27fb717f..6aa91423d4 100644
--- a/tools/cdata-test.js
+++ b/tools/cdata-test.js
@@ -16,25 +16,25 @@ describe('Function', () => {
const oldFilePath = path.join(testFolderPath, 'oldFile.txt');
const newFilePath = path.join(testFolderPath, 'newFile.txt');
- // Create a temporary file before the test
+ // Crear a temporary archivo before the test
before(() => {
- // Create test folder
+ // Crear test carpeta
if (!fs.existsSync(testFolderPath)) {
fs.mkdirSync(testFolderPath);
}
- // Create an old file
+ // Crear an old archivo
fs.writeFileSync(oldFilePath, 'This is an old file.');
- // Modify the 'mtime' to simulate an old file
+ // Modify the 'mtime' to simulate an old archivo
const oldTime = new Date();
oldTime.setFullYear(oldTime.getFullYear() - 1);
fs.utimesSync(oldFilePath, oldTime, oldTime);
- // Create a new file
+ // Crear a new archivo
fs.writeFileSync(newFilePath, 'This is a new file.');
});
- // delete the temporary files after the test
+ // eliminar the temporary files after the test
after(() => {
fs.rmSync(testFolderPath, { recursive: true });
});
@@ -95,7 +95,7 @@ describe('Script', () => {
fs.renameSync("package.bak.json", "package.json");
});
- // delete all html_*.h files
+ // eliminar all html_*.h files
async function deleteBuiltFiles() {
const files = await fs.promises.readdir(folderPath);
await Promise.all(files.map(file => {
@@ -105,7 +105,7 @@ describe('Script', () => {
}));
}
- // check if html_*.h files were created
+ // verificar if html_*.h files were created
async function checkIfBuiltFilesExist() {
const files = await fs.promises.readdir(folderPath);
const htmlFiles = files.filter(file => file.startsWith('html_') && path.extname(file) === '.h');
@@ -126,9 +126,9 @@ describe('Script', () => {
// run cdata.js to ensure html_*.h files are created
await execPromise('node tools/cdata.js');
- // modify file
+ // modify archivo
fs.appendFileSync(sourceFilePath, ' ');
- // delay for 1 second to ensure the modified time is different
+ // retraso for 1 second to ensure the modified time is different
await new Promise(resolve => setTimeout(resolve, 1000));
// run script cdata.js again and wait for it to finish
@@ -147,7 +147,7 @@ describe('Script', () => {
// run script cdata.js and wait for it to finish
await execPromise('node tools/cdata.js');
- // delete a random html_*.h file
+ // eliminar a random html_*.h archivo
let files = await fs.promises.readdir(folderPath);
let htmlFiles = files.filter(file => file.startsWith('html_') && path.extname(file) === '.h');
const randomFile = htmlFiles[Math.floor(Math.random() * htmlFiles.length)];
@@ -205,7 +205,7 @@ describe('Script', () => {
await execPromise('node tools/cdata.js');
const secondRunTime = Date.now() - startTime;
- // check if second run was faster than the first (must be at least 2x faster)
+ // verificar if second run was faster than the first (must be at least 2x faster)
assert(secondRunTime < firstRunTime / 2, 'html_*.h files were rebuilt');
});
});
diff --git a/tools/cdata.js b/tools/cdata.js
index 759d24c2da..9f5a31027a 100644
--- a/tools/cdata.js
+++ b/tools/cdata.js
@@ -1,18 +1,18 @@
/**
- * Writes compressed C arrays of data files (web interface)
+ * Writes compressed C arrays of datos files (web interfaz)
* How to use it?
*
- * 1) Install Node 20+ and npm
+ * 1) Install Nodo 20+ and npm
* 2) npm install
- * 3) npm run build
+ * 3) npm run compilación
*
- * If you change data folder often, you can run it in monitoring mode (it will recompile and update *.h on every file change)
+ * If you change datos carpeta often, you can run it in monitoring mode (it will recompile and actualizar *.h on every archivo change)
*
* > npm run dev
*
* How it works?
*
- * It uses NodeJS packages to inline, minify and GZIP files. See writeHtmlGzipped and writeChunks invocations at the bottom of the page.
+ * It uses NodeJS packages to en línea, minify and GZIP files. See writeHtmlGzipped and writeChunks invocations at the bottom of the page.
*/
const fs = require("node:fs");
@@ -23,12 +23,12 @@ const CleanCSS = require("clean-css");
const minifyHtml = require("html-minifier-terser").minify;
const packageJson = require("../package.json");
-// Export functions for testing
+// Exportar functions for testing
module.exports = { isFileNewerThan, isAnyFileInFolderNewerThan };
const output = ["wled00/html_ui.h", "wled00/html_pixart.h", "wled00/html_cpal.h", "wled00/html_edit.h", "wled00/html_pxmagic.h", "wled00/html_settings.h", "wled00/html_other.h"]
-// \x1b[34m is blue, \x1b[36m is cyan, \x1b[0m is reset
+// \x1b[34m is blue, \x1b[36m is cyan, \x1b[0m is restablecer
const wledBanner = `
\t\x1b[34m ## ## ## ###### ######
\t\x1b[34m## ## ## ## ## ## ##
@@ -38,30 +38,30 @@ const wledBanner = `
\t\t\x1b[36m build script for web UI
\x1b[0m`;
-// Generate build timestamp as UNIX timestamp (seconds since epoch)
+// Generate compilación timestamp as UNIX timestamp (seconds since epoch)
function generateBuildTime() {
return Math.floor(Date.now() / 1000);
}
const singleHeader = `/*
- * Binary array for the Web UI.
- * gzip is used for smaller size and improved speeds.
+ * Binary matriz for the Web UI.
+ * gzip is used for smaller tamaño and improved speeds.
*
- * Please see https://kno.wled.ge/advanced/custom-features/#changing-web-ui
- * to find out how to easily modify the web UI source!
+ * Please see https://kno.WLED.ge/advanced/custom-features/#changing-web-ui
+ * to encontrar out how to easily modify the web UI source!
*/
-// Automatically generated build time for cache busting (UNIX timestamp)
+// Automatically generated compilación time for caché busting (UNIX timestamp)
#define WEB_BUILD_TIME ${generateBuildTime()}
`;
const multiHeader = `/*
* More web UI HTML source arrays.
- * This file is auto generated, please don't make any changes manually.
+ * This archivo is auto generated, please don't make any changes manually.
*
- * Instead, see https://kno.wled.ge/advanced/custom-features/#changing-web-ui
- * to find out how to easily modify the web UI source!
+ * Instead, see https://kno.WLED.ge/advanced/custom-features/#changing-web-ui
+ * to encontrar out how to easily modify the web UI source!
*/
`;
@@ -200,13 +200,13 @@ async function writeChunks(srcDir, specs, resultFile) {
fs.writeFileSync(resultFile, src);
}
-// Check if a file is newer than a given time
+// Verificar if a archivo is newer than a given time
function isFileNewerThan(filePath, time) {
const stats = fs.statSync(filePath);
return stats.mtimeMs > time;
}
-// Check if any file in a folder (or its subfolders) is newer than a given time
+// Verificar if any archivo in a carpeta (or its subfolders) is newer than a given time
function isAnyFileInFolderNewerThan(folderPath, time) {
const files = fs.readdirSync(folderPath, { withFileTypes: true });
for (const file of files) {
@@ -221,7 +221,7 @@ function isAnyFileInFolderNewerThan(folderPath, time) {
return false;
}
-// Check if the web UI is already built
+// Verificar if the web UI is already built
function isAlreadyBuilt(webUIPath, packageJsonPath = "package.json") {
let lastBuildTime = Infinity;
@@ -252,9 +252,9 @@ if (isAlreadyBuilt("wled00/data") && process.argv[2] !== '--force' && process.ar
writeHtmlGzipped("wled00/data/index.htm", "wled00/html_ui.h", 'index');
writeHtmlGzipped("wled00/data/pixart/pixart.htm", "wled00/html_pixart.h", 'pixart');
-//writeHtmlGzipped("wled00/data/cpal/cpal.htm", "wled00/html_cpal.h", 'cpal');
+//writeHtmlGzipped("wled00/datos/cpal/cpal.htm", "wled00/html_cpal.h", 'cpal');
writeHtmlGzipped("wled00/data/pxmagic/pxmagic.htm", "wled00/html_pxmagic.h", 'pxmagic');
-//writeHtmlGzipped("wled00/data/edit.htm", "wled00/html_edit.h", 'edit');
+//writeHtmlGzipped("wled00/datos/edit.htm", "wled00/html_edit.h", 'edit');
writeChunks(
diff --git a/tools/check-translations.js b/tools/check-translations.js
new file mode 100644
index 0000000000..b544e1dc79
--- /dev/null
+++ b/tools/check-translations.js
@@ -0,0 +1,573 @@
+const fs = require('fs');
+const path = require('path');
+
+// Diccionario de traducciones mejorado
+const dictionary = {
+ 'main': 'principal',
+ 'setup': 'configuración',
+ 'loop': 'bucle',
+ 'initialize': 'inicializar',
+ 'update': 'actualizar',
+ 'render': 'renderizar',
+ 'draw': 'dibujar',
+ 'paint': 'pintar',
+ 'clear': 'limpiar',
+ 'reset': 'restablecer',
+ 'enable': 'habilitar',
+ 'disable': 'deshabilitar',
+ 'start': 'iniciar',
+ 'stop': 'detener',
+ 'pause': 'pausar',
+ 'resume': 'reanudar',
+ 'save': 'guardar',
+ 'load': 'cargar',
+ 'delete': 'eliminar',
+ 'create': 'crear',
+ 'destroy': 'destruir',
+ 'allocate': 'asignar',
+ 'deallocate': 'desasignar',
+ 'check': 'verificar',
+ 'validate': 'validar',
+ 'convert': 'convertir',
+ 'parse': 'analizar',
+ 'format': 'formato',
+ 'configure': 'configurar',
+ 'connect': 'conectar',
+ 'disconnect': 'desconectar',
+ 'send': 'enviar',
+ 'receive': 'recibir',
+ 'read': 'leer',
+ 'write': 'escribir',
+ 'append': 'añadir',
+ 'prepend': 'anteponer',
+ 'insert': 'insertar',
+ 'remove': 'eliminar',
+ 'replace': 'reemplazar',
+ 'swap': 'intercambiar',
+ 'sort': 'ordenar',
+ 'reverse': 'invertir',
+ 'rotate': 'rotar',
+ 'shift': 'desplazar',
+ 'push': 'empujar',
+ 'pop': 'extraer',
+ 'peek': 'mirar',
+ 'map': 'mapear',
+ 'filter': 'filtrar',
+ 'reduce': 'reducir',
+ 'fold': 'plegar',
+ 'scan': 'escanear',
+ 'search': 'buscar',
+ 'find': 'encontrar',
+ 'locate': 'localizar',
+ 'match': 'coincidir',
+ 'compare': 'comparar',
+ 'equal': 'igual',
+ 'greater': 'mayor',
+ 'less': 'menor',
+ 'minimum': 'mínimo',
+ 'maximum': 'máximo',
+ 'average': 'promedio',
+ 'sum': 'suma',
+ 'count': 'conteo',
+ 'index': 'índice',
+ 'offset': 'desplazamiento',
+ 'position': 'posición',
+ 'location': 'ubicación',
+ 'address': 'dirección',
+ 'pointer': 'puntero',
+ 'reference': 'referencia',
+ 'value': 'valor',
+ 'variable': 'variable',
+ 'constant': 'constante',
+ 'parameter': 'parámetro',
+ 'argument': 'argumento',
+ 'return': 'retorno',
+ 'result': 'resultado',
+ 'error': 'error',
+ 'warning': 'advertencia',
+ 'info': 'información',
+ 'debug': 'depuración',
+ 'trace': 'rastreo',
+ 'log': 'registro',
+ 'print': 'imprimir',
+ 'output': 'salida',
+ 'input': 'entrada',
+ 'buffer': 'búfer',
+ 'array': 'matriz',
+ 'list': 'lista',
+ 'queue': 'cola',
+ 'stack': 'pila',
+ 'tree': 'árbol',
+ 'graph': 'gráfico',
+ 'node': 'nodo',
+ 'edge': 'arista',
+ 'link': 'enlace',
+ 'connection': 'conexión',
+ 'network': 'red',
+ 'server': 'servidor',
+ 'client': 'cliente',
+ 'request': 'solicitud',
+ 'response': 'respuesta',
+ 'status': 'estado',
+ 'state': 'estado',
+ 'code': 'código',
+ 'message': 'mensaje',
+ 'data': 'datos',
+ 'payload': 'carga útil',
+ 'header': 'encabezado',
+ 'footer': 'pie de página',
+ 'body': 'cuerpo',
+ 'content': 'contenido',
+ 'text': 'texto',
+ 'html': 'HTML',
+ 'xml': 'XML',
+ 'json': 'JSON',
+ 'css': 'CSS',
+ 'javascript': 'JavaScript',
+ 'function': 'función',
+ 'method': 'método',
+ 'procedure': 'procedimiento',
+ 'routine': 'rutina',
+ 'handler': 'manejador',
+ 'listener': 'escuchador',
+ 'callback': 'devolución de llamada',
+ 'event': 'evento',
+ 'trigger': 'disparador',
+ 'action': 'acción',
+ 'effect': 'efecto',
+ 'animation': 'animación',
+ 'transition': 'transición',
+ 'color': 'color',
+ 'brightness': 'brillo',
+ 'intensity': 'intensidad',
+ 'speed': 'velocidad',
+ 'duration': 'duración',
+ 'delay': 'retraso',
+ 'timeout': 'tiempo de espera',
+ 'interval': 'intervalo',
+ 'frequency': 'frecuencia',
+ 'period': 'período',
+ 'cycle': 'ciclo',
+ 'frame': 'fotograma',
+ 'pixel': 'píxel',
+ 'led': 'LED',
+ 'strip': 'tira',
+ 'segment': 'segmento',
+ 'range': 'rango',
+ 'boundary': 'límite',
+ 'limit': 'límite',
+ 'threshold': 'umbral',
+ 'tolerance': 'tolerancia',
+ 'precision': 'precisión',
+ 'accuracy': 'precisión',
+ 'performance': 'rendimiento',
+ 'optimization': 'optimización',
+ 'memory': 'memoria',
+ 'storage': 'almacenamiento',
+ 'cache': 'caché',
+ 'heap': 'montón',
+ 'stack': 'pila',
+ 'thread': 'hilo',
+ 'process': 'proceso',
+ 'task': 'tarea',
+ 'job': 'trabajo',
+ 'queue': 'cola',
+ 'scheduler': 'planificador',
+ 'timer': 'temporizador',
+ 'interrupt': 'interrupción',
+ 'signal': 'señal',
+ 'handler': 'manejador',
+ 'trap': 'trampa',
+ 'exception': 'excepción',
+ 'fault': 'fallo',
+ 'panic': 'pánico',
+ 'crash': 'bloqueo',
+ 'freeze': 'congelación',
+ 'hang': 'cuelgue',
+ 'deadlock': 'bloqueo mutuo',
+ 'race': 'condición de carrera',
+ 'condition': 'condición',
+ 'mutex': 'mutex',
+ 'semaphore': 'semáforo',
+ 'lock': 'bloqueo',
+ 'unlock': 'desbloqueo',
+ 'atomic': 'atómico',
+ 'volatile': 'volátil',
+ 'synchronized': 'sincronizado',
+ 'asynchronous': 'asíncrono',
+ 'synchronous': 'síncrono',
+ 'blocking': 'bloqueante',
+ 'non-blocking': 'no bloqueante',
+ 'promise': 'promesa',
+ 'future': 'futuro',
+ 'await': 'esperar',
+ 'async': 'asíncrono',
+ 'generator': 'generador',
+ 'iterator': 'iterador',
+ 'enumeration': 'enumeración',
+ 'flag': 'bandera',
+ 'bit': 'bit',
+ 'byte': 'byte',
+ 'word': 'palabra',
+ 'integer': 'entero',
+ 'float': 'flotante',
+ 'double': 'doble',
+ 'string': 'cadena',
+ 'character': 'carácter',
+ 'boolean': 'booleano',
+ 'true': 'verdadero',
+ 'false': 'falso',
+ 'null': 'nulo',
+ 'undefined': 'indefinido',
+ 'nan': 'NaN',
+ 'infinity': 'infinito',
+ 'overflow': 'desbordamiento',
+ 'underflow': 'subdesbordamiento',
+ 'truncate': 'truncar',
+ 'round': 'redondear',
+ 'ceil': 'techo',
+ 'floor': 'piso',
+ 'absolute': 'absoluto',
+ 'sign': 'signo',
+ 'magnitude': 'magnitud',
+ 'scale': 'escala',
+ 'normalize': 'normalizar',
+ 'denormalize': 'desnormalizar',
+ 'quantize': 'cuantizar',
+ 'dither': 'difuminación',
+ 'interpolate': 'interpolar',
+ 'extrapolate': 'extrapolar',
+ 'blend': 'mezcla',
+ 'combine': 'combinar',
+ 'merge': 'fusionar',
+ 'split': 'dividir',
+ 'chunk': 'fragmento',
+ 'segment': 'segmento',
+ 'partition': 'partición',
+ 'distribute': 'distribuir',
+ 'balance': 'equilibrio',
+ 'load': 'carga',
+ 'capacity': 'capacidad',
+ 'utilization': 'utilización',
+ 'efficiency': 'eficiencia',
+ 'latency': 'latencia',
+ 'throughput': 'rendimiento',
+ 'bandwidth': 'ancho de banda',
+ 'jitter': 'inestabilidad',
+ 'skew': 'sesgo',
+ 'bias': 'sesgo',
+ 'variance': 'varianza',
+ 'deviation': 'desviación',
+ 'standard': 'estándar',
+ 'specification': 'especificación',
+ 'requirement': 'requisito',
+ 'constraint': 'restricción',
+ 'dependency': 'dependencia',
+ 'relationship': 'relación',
+ 'association': 'asociación',
+ 'aggregation': 'agregación',
+ 'composition': 'composición',
+ 'inheritance': 'herencia',
+ 'polymorphism': 'polimorfismo',
+ 'abstraction': 'abstracción',
+ 'encapsulation': 'encapsulamiento',
+ 'interface': 'interfaz',
+ 'implementation': 'implementación',
+ 'contract': 'contrato',
+ 'protocol': 'protocolo',
+ 'api': 'API',
+ 'sdk': 'SDK',
+ 'framework': 'marco de trabajo',
+ 'library': 'biblioteca',
+ 'module': 'módulo',
+ 'package': 'paquete',
+ 'component': 'componente',
+ 'subsystem': 'subsistema',
+ 'system': 'sistema',
+ 'platform': 'plataforma',
+ 'application': 'aplicación',
+ 'service': 'servicio',
+ 'middleware': 'middleware',
+ 'layer': 'capa',
+ 'tier': 'nivel',
+ 'level': 'nivel',
+ 'hierarchy': 'jerarquía',
+ 'topology': 'topología',
+ 'architecture': 'arquitectura',
+ 'design': 'diseño',
+ 'pattern': 'patrón',
+ 'template': 'plantilla',
+ 'strategy': 'estrategia',
+ 'algorithm': 'algoritmo',
+ 'heuristic': 'heurística',
+ 'approximation': 'aproximación',
+ 'estimation': 'estimación',
+ 'calculation': 'cálculo',
+ 'computation': 'computación',
+ 'evaluation': 'evaluación',
+ 'assessment': 'evaluación',
+ 'analysis': 'análisis',
+ 'synthesis': 'síntesis',
+ 'modeling': 'modelado',
+ 'simulation': 'simulación',
+ 'emulation': 'emulación',
+ 'virtualization': 'virtualización',
+ 'containerization': 'containerización',
+ 'deployment': 'implementación',
+ 'installation': 'instalación',
+ 'configuration': 'configuración',
+ 'customization': 'personalización',
+ 'extension': 'extensión',
+ 'plugin': 'complemento',
+ 'addon': 'complemento',
+ 'usermod': 'usermod',
+ 'firmware': 'firmware',
+ 'bootloader': 'bootloader',
+ 'kernel': 'kernel',
+ 'driver': 'controlador',
+ 'device': 'dispositivo',
+ 'hardware': 'hardware',
+ 'software': 'software',
+ 'interface': 'interfaz',
+ 'port': 'puerto',
+ 'socket': 'socket',
+ 'endpoint': 'extremo',
+ 'gateway': 'puerta de enlace',
+ 'proxy': 'proxy',
+ 'router': 'enrutador',
+ 'switch': 'conmutador',
+ 'firewall': 'cortafuegos',
+ 'encryption': 'cifrado',
+ 'decryption': 'descifrado',
+ 'hash': 'hash',
+ 'digest': 'resumen',
+ 'signature': 'firma',
+ 'certificate': 'certificado',
+ 'authentication': 'autenticación',
+ 'authorization': 'autorización',
+ 'access': 'acceso',
+ 'permission': 'permiso',
+ 'privilege': 'privilegio',
+ 'role': 'rol',
+ 'user': 'usuario',
+ 'admin': 'administrador',
+ 'owner': 'propietario',
+ 'group': 'grupo',
+ 'domain': 'dominio',
+ 'realm': 'reino',
+ 'zone': 'zona',
+ 'context': 'contexto',
+ 'scope': 'alcance',
+ 'namespace': 'espacio de nombres',
+ 'module': 'módulo',
+ 'package': 'paquete',
+ 'version': 'versión',
+ 'release': 'lanzamiento',
+ 'build': 'compilación',
+ 'patch': 'parche',
+ 'update': 'actualización',
+ 'upgrade': 'mejora',
+ 'downgrade': 'degradación',
+ 'migration': 'migración',
+ 'rollback': 'reversión',
+ 'commit': 'confirmación',
+ 'revert': 'revertir',
+ 'merge': 'fusión',
+ 'branch': 'rama',
+ 'tag': 'etiqueta',
+ 'cherry-pick': 'seleccionar',
+ 'rebase': 'cambiar base',
+ 'squash': 'comprimir',
+ 'stash': 'almacenar',
+ 'index': 'índice',
+ 'staging': 'área de preparación',
+ 'working': 'funcionamiento',
+ 'repository': 'repositorio',
+ 'fork': 'bifurcación',
+ 'clone': 'clon',
+ 'pull': 'extraer',
+ 'push': 'enviar',
+ 'fetch': 'obtener',
+ 'sync': 'sincronizar',
+ 'conflict': 'conflicto',
+ 'resolution': 'resolución',
+ 'diff': 'diferencia',
+ 'patch': 'parche',
+ 'blame': 'culpa',
+ 'history': 'historial',
+ 'log': 'registro',
+ 'stats': 'estadísticas',
+ 'metric': 'métrica',
+ 'benchmark': 'punto de referencia',
+ 'profile': 'perfil',
+ 'trace': 'rastreo',
+ 'breakpoint': 'punto de ruptura',
+ 'watchpoint': 'punto de observación',
+ 'step': 'paso',
+ 'continue': 'continuar',
+ 'break': 'ruptura',
+ 'exit': 'salida',
+ 'quit': 'salir',
+ 'abort': 'abortar',
+ 'retry': 'reintentar',
+ 'skip': 'omitir',
+ 'ignore': 'ignorar',
+ 'suppress': 'suprimir',
+ 'filter': 'filtro',
+ 'regex': 'expresión regular',
+ 'pattern': 'patrón',
+ 'wildcard': 'comodín',
+ 'glob': 'glob',
+ 'path': 'ruta',
+ 'directory': 'directorio',
+ 'folder': 'carpeta',
+ 'file': 'archivo',
+ 'extension': 'extensión',
+ 'permission': 'permiso',
+ 'owner': 'propietario',
+ 'group': 'grupo',
+ 'mode': 'modo',
+ 'attribute': 'atributo',
+ 'property': 'propiedad',
+ 'field': 'campo',
+ 'member': 'miembro',
+ 'static': 'estático',
+ 'instance': 'instancia',
+ 'class': 'clase',
+ 'struct': 'estructura',
+ 'union': 'unión',
+ 'enum': 'enumeración',
+ 'typedef': 'definición de tipo',
+ 'macro': 'macro',
+ 'define': 'definir',
+ 'ifdef': 'si está definido',
+ 'ifndef': 'si no está definido',
+ 'endif': 'fin si',
+ 'include': 'incluir',
+ 'import': 'importar',
+ 'export': 'exportar',
+ 'namespace': 'espacio de nombres',
+ 'using': 'usando',
+ 'extern': 'externo',
+ 'static': 'estático',
+ 'const': 'constante',
+ 'volatile': 'volátil',
+ 'mutable': 'mutable',
+ 'inline': 'en línea',
+ 'virtual': 'virtual',
+ 'override': 'anular',
+ 'final': 'final',
+ 'operator': 'operador',
+ 'overload': 'sobrecarga',
+ 'template': 'plantilla',
+ 'typename': 'nombre de tipo',
+ 'specialization': 'especialización',
+ 'instantiation': 'instanciación',
+ 'generic': 'genérico',
+ 'type': 'tipo',
+ 'cast': 'conversión',
+ 'coercion': 'coerción',
+ 'conversion': 'conversión',
+ 'promotion': 'promoción',
+ 'demotion': 'degradación',
+ 'widening': 'ampliación',
+ 'narrowing': 'reducción',
+};
+
+// Traducir un comentario
+function translateComment(text) {
+ let result = text;
+ Object.entries(dictionary).forEach(([en, es]) => {
+ const regex = new RegExp(`\\b${en}\\b`, 'gi');
+ result = result.replace(regex, (match) => {
+ return match[0].toUpperCase() === match[0] ? es.charAt(0).toUpperCase() + es.slice(1) : es;
+ });
+ });
+ return result;
+}
+
+// Procesar archivo
+function processFile(filePath) {
+ const ext = path.extname(filePath).toLowerCase();
+ if (!['.cpp', '.h', '.js', '.html', '.css', '.md', '.txt'].includes(ext)) {
+ return { processed: false, translated: false };
+ }
+
+ try {
+ let content = fs.readFileSync(filePath, 'utf-8');
+ const original = content;
+
+ // Comentarios de bloque /* */
+ content = content.replace(/\/\*([\s\S]*?)\*\//g, (match) => {
+ return '/*' + translateComment(coincidir.slice(2, -2)) + '*/';
+ });
+
+ // Comentarios de línea //
+ content = content.replace(/^(\s*)\/\/(.*)$/gm, (match, indent, comment) => {
+ return indent + '//' + translateComment(comment);
+ });
+
+ // Comentarios HTML
+ content = content.replace(//g, (match) => {
+ return '';
+ });
+
+ const translated = content !== original;
+ if (translated) {
+ fs.writeFileSync(filePath, content, 'utf-8');
+ }
+
+ return { processed: true, translated };
+ } catch (error) {
+ console.error(`Error processing ${filePath}:`, error.message);
+ return { processed: false, translated: false };
+ }
+}
+
+// Escanear directorio
+function scanDirectory(dir) {
+ const files = [];
+ const excluded = ['node_modules', '.git', '.next', 'dist', 'build', 'coverage'];
+
+ try {
+ const items = fs.readdirSync(dir);
+ items.forEach(item => {
+ const filePath = path.join(dir, item);
+ const stat = fs.statSync(filePath);
+
+ if (stat.isDirectory()) {
+ if (!excluded.some(e => filePath.includes(e))) {
+ files.push(...scanDirectory(filePath));
+ }
+ } else {
+ files.push(filePath);
+ }
+ });
+ } catch (error) {
+ console.error(`Error scanning ${dir}:`, error.message);
+ }
+
+ return files;
+}
+
+// Principal
+console.log('Escaneando archivos para traducir...\n');
+const files = scanDirectory('/workspaces/WLED');
+
+let totalProcessed = 0;
+let totalTranslated = 0;
+
+files.forEach(file => {
+ const result = processFile(file);
+ if (result.processed) {
+ totalProcessed++;
+ if (result.translated) {
+ totalTranslated++;
+ console.log(`✓ ${file}`);
+ }
+ }
+});
+
+console.log(`\n✓ Proceso completado`);
+console.log(` Archivos procesados: ${totalProcessed}`);
+console.log(` Archivos traducidos: ${totalTranslated}`);
diff --git a/tools/translate-all-comments.js b/tools/translate-all-comments.js
new file mode 100644
index 0000000000..f42179bd67
--- /dev/null
+++ b/tools/translate-all-comments.js
@@ -0,0 +1,242 @@
+const fs = require('fs');
+const path = require('path');
+
+// Diccionario técnico completo español-inglés
+const dictionary = {
+ 'WLED': 'WLED', 'LED': 'LED', 'WiFi': 'WiFi', 'API': 'API', 'JSON': 'JSON',
+ 'WebSocket': 'WebSocket', 'MQTT': 'MQTT', 'UDP': 'UDP', 'HTTP': 'HTTP',
+ 'E1.31': 'E1.31', 'NeoPixel': 'NeoPixel', 'WS2812B': 'WS2812B', 'SK6812': 'SK6812',
+ 'SPI': 'SPI', 'I2C': 'I2C', 'UART': 'UART', 'GPIO': 'GPIO', 'EEPROM': 'EEPROM',
+ 'RAM': 'RAM', 'ROM': 'ROM', 'CPU': 'CPU', 'SSID': 'SSID', 'BSSID': 'BSSID',
+ 'main': 'principal', 'setup': 'configuración', 'loop': 'bucle',
+ 'initialize': 'inicializar', 'update': 'actualizar', 'render': 'renderizar',
+ 'draw': 'dibujar', 'paint': 'pintar', 'clear': 'limpiar', 'reset': 'restablecer',
+ 'enable': 'habilitar', 'disable': 'deshabilitar', 'start': 'iniciar',
+ 'stop': 'detener', 'pause': 'pausar', 'resume': 'reanudar', 'save': 'guardar',
+ 'load': 'cargar', 'delete': 'eliminar', 'create': 'crear', 'destroy': 'destruir',
+ 'check': 'verificar', 'validate': 'validar', 'convert': 'convertir',
+ 'parse': 'analizar', 'format': 'formato', 'configure': 'configurar',
+ 'connect': 'conectar', 'disconnect': 'desconectar', 'send': 'enviar',
+ 'receive': 'recibir', 'read': 'leer', 'write': 'escribir', 'append': 'añadir',
+ 'insert': 'insertar', 'remove': 'eliminar', 'replace': 'reemplazar',
+ 'search': 'buscar', 'find': 'encontrar', 'match': 'coincidir', 'compare': 'comparar',
+ 'index': 'índice', 'offset': 'desplazamiento', 'position': 'posición',
+ 'size': 'tamaño', 'length': 'longitud', 'count': 'conteo', 'value': 'valor',
+ 'variable': 'variable', 'constant': 'constante', 'parameter': 'parámetro',
+ 'argument': 'argumento', 'return': 'retorno', 'result': 'resultado',
+ 'error': 'error', 'warning': 'advertencia', 'info': 'información',
+ 'debug': 'depuración', 'trace': 'rastreo', 'log': 'registro', 'print': 'imprimir',
+ 'output': 'salida', 'input': 'entrada', 'buffer': 'búfer', 'array': 'matriz',
+ 'list': 'lista', 'queue': 'cola', 'stack': 'pila', 'tree': 'árbol',
+ 'node': 'nodo', 'link': 'enlace', 'connection': 'conexión', 'network': 'red',
+ 'server': 'servidor', 'client': 'cliente', 'request': 'solicitud',
+ 'response': 'respuesta', 'status': 'estado', 'state': 'estado', 'code': 'código',
+ 'message': 'mensaje', 'data': 'datos', 'payload': 'carga útil', 'header': 'encabezado',
+ 'body': 'cuerpo', 'content': 'contenido', 'text': 'texto', 'html': 'HTML',
+ 'xml': 'XML', 'css': 'CSS', 'javascript': 'JavaScript', 'function': 'función',
+ 'method': 'método', 'procedure': 'procedimiento', 'routine': 'rutina',
+ 'handler': 'manejador', 'listener': 'escuchador', 'callback': 'devolución de llamada',
+ 'event': 'evento', 'trigger': 'disparador', 'action': 'acción', 'effect': 'efecto',
+ 'animation': 'animación', 'transition': 'transición', 'color': 'color',
+ 'brightness': 'brillo', 'intensity': 'intensidad', 'speed': 'velocidad',
+ 'duration': 'duración', 'delay': 'retraso', 'timeout': 'tiempo de espera',
+ 'interval': 'intervalo', 'frequency': 'frecuencia', 'period': 'período',
+ 'pixel': 'píxel', 'strip': 'tira', 'segment': 'segmento', 'range': 'rango',
+ 'limit': 'límite', 'threshold': 'umbral', 'tolerance': 'tolerancia',
+ 'precision': 'precisión', 'performance': 'rendimiento', 'optimization': 'optimización',
+ 'memory': 'memoria', 'storage': 'almacenamiento', 'cache': 'caché',
+ 'heap': 'montón', 'thread': 'hilo', 'process': 'proceso', 'task': 'tarea',
+ 'job': 'trabajo', 'scheduler': 'planificador', 'timer': 'temporizador',
+ 'interrupt': 'interrupción', 'signal': 'señal', 'exception': 'excepción',
+ 'fault': 'fallo', 'crash': 'bloqueo', 'deadlock': 'bloqueo mutuo',
+ 'race': 'condición de carrera', 'condition': 'condición', 'mutex': 'mutex',
+ 'semaphore': 'semáforo', 'lock': 'bloqueo', 'unlock': 'desbloqueo',
+ 'atomic': 'atómico', 'volatile': 'volátil', 'synchronous': 'síncrono',
+ 'asynchronous': 'asíncrono', 'blocking': 'bloqueante', 'non-blocking': 'no bloqueante',
+ 'promise': 'promesa', 'future': 'futuro', 'await': 'esperar', 'async': 'asíncrono',
+ 'generator': 'generador', 'iterator': 'iterador', 'enumeration': 'enumeración',
+ 'flag': 'bandera', 'bit': 'bit', 'byte': 'byte', 'word': 'palabra',
+ 'integer': 'entero', 'float': 'flotante', 'double': 'doble', 'string': 'cadena',
+ 'character': 'carácter', 'boolean': 'booleano', 'true': 'verdadero',
+ 'false': 'falso', 'null': 'nulo', 'undefined': 'indefinido', 'nan': 'NaN',
+ 'infinity': 'infinito', 'overflow': 'desbordamiento', 'underflow': 'subdesbordamiento',
+ 'truncate': 'truncar', 'round': 'redondear', 'ceil': 'techo', 'floor': 'piso',
+ 'absolute': 'absoluto', 'sign': 'signo', 'magnitude': 'magnitud', 'scale': 'escala',
+ 'normalize': 'normalizar', 'interpolate': 'interpolar', 'extrapolate': 'extrapolar',
+ 'blend': 'mezcla', 'combine': 'combinar', 'merge': 'fusionar', 'split': 'dividir',
+ 'chunk': 'fragmento', 'partition': 'partición', 'distribute': 'distribuir',
+ 'balance': 'equilibrio', 'load': 'carga', 'capacity': 'capacidad',
+ 'utilization': 'utilización', 'efficiency': 'eficiencia', 'latency': 'latencia',
+ 'throughput': 'rendimiento', 'bandwidth': 'ancho de banda', 'jitter': 'inestabilidad',
+ 'skew': 'sesgo', 'bias': 'sesgo', 'variance': 'varianza', 'deviation': 'desviación',
+ 'standard': 'estándar', 'specification': 'especificación', 'requirement': 'requisito',
+ 'constraint': 'restricción', 'dependency': 'dependencia', 'relationship': 'relación',
+ 'association': 'asociación', 'aggregation': 'agregación', 'composition': 'composición',
+ 'inheritance': 'herencia', 'polymorphism': 'polimorfismo', 'abstraction': 'abstracción',
+ 'encapsulation': 'encapsulamiento', 'interface': 'interfaz', 'implementation': 'implementación',
+ 'contract': 'contrato', 'protocol': 'protocolo', 'sdk': 'SDK',
+ 'framework': 'marco de trabajo', 'library': 'biblioteca', 'module': 'módulo',
+ 'package': 'paquete', 'component': 'componente', 'subsystem': 'subsistema',
+ 'system': 'sistema', 'platform': 'plataforma', 'application': 'aplicación',
+ 'service': 'servicio', 'middleware': 'middleware', 'layer': 'capa',
+ 'tier': 'nivel', 'level': 'nivel', 'hierarchy': 'jerarquía', 'topology': 'topología',
+ 'architecture': 'arquitectura', 'design': 'diseño', 'pattern': 'patrón',
+ 'template': 'plantilla', 'strategy': 'estrategia', 'algorithm': 'algoritmo',
+ 'heuristic': 'heurística', 'estimation': 'estimación', 'calculation': 'cálculo',
+ 'computation': 'computación', 'evaluation': 'evaluación', 'assessment': 'evaluación',
+ 'analysis': 'análisis', 'synthesis': 'síntesis', 'modeling': 'modelado',
+ 'simulation': 'simulación', 'emulation': 'emulación', 'virtualization': 'virtualización',
+ 'deployment': 'implementación', 'installation': 'instalación',
+ 'customization': 'personalización', 'extension': 'extensión', 'plugin': 'complemento',
+ 'addon': 'complemento', 'usermod': 'usermod', 'firmware': 'firmware',
+ 'bootloader': 'bootloader', 'kernel': 'kernel', 'driver': 'controlador',
+ 'device': 'dispositivo', 'hardware': 'hardware', 'software': 'software',
+ 'port': 'puerto', 'socket': 'socket', 'endpoint': 'extremo',
+ 'gateway': 'puerta de enlace', 'proxy': 'proxy', 'router': 'enrutador',
+ 'switch': 'conmutador', 'firewall': 'cortafuegos', 'encryption': 'cifrado',
+ 'decryption': 'descifrado', 'hash': 'hash', 'digest': 'resumen', 'signature': 'firma',
+ 'certificate': 'certificado', 'authentication': 'autenticación',
+ 'authorization': 'autorización', 'access': 'acceso', 'permission': 'permiso',
+ 'privilege': 'privilegio', 'role': 'rol', 'user': 'usuario', 'admin': 'administrador',
+ 'owner': 'propietario', 'group': 'grupo', 'domain': 'dominio', 'realm': 'reino',
+ 'zone': 'zona', 'context': 'contexto', 'scope': 'alcance', 'namespace': 'espacio de nombres',
+ 'version': 'versión', 'release': 'lanzamiento', 'build': 'compilación',
+ 'patch': 'parche', 'upgrade': 'mejora', 'downgrade': 'degradación',
+ 'migration': 'migración', 'rollback': 'reversión', 'commit': 'confirmación',
+ 'revert': 'revertir', 'merge': 'fusión', 'branch': 'rama', 'tag': 'etiqueta',
+ 'rebase': 'cambiar base', 'squash': 'comprimir', 'stash': 'almacenar',
+ 'staging': 'área de preparación', 'working': 'funcionamiento', 'repository': 'repositorio',
+ 'fork': 'bifurcación', 'clone': 'clon', 'pull': 'extraer', 'push': 'enviar',
+ 'fetch': 'obtener', 'sync': 'sincronizar', 'conflict': 'conflicto',
+ 'resolution': 'resolución', 'diff': 'diferencia', 'blame': 'culpa',
+ 'history': 'historial', 'stats': 'estadísticas', 'metric': 'métrica',
+ 'benchmark': 'punto de referencia', 'profile': 'perfil', 'breakpoint': 'punto de ruptura',
+ 'watchpoint': 'punto de observación', 'step': 'paso', 'continue': 'continuar',
+ 'break': 'ruptura', 'exit': 'salida', 'quit': 'salir', 'abort': 'abortar',
+ 'retry': 'reintentar', 'skip': 'omitir', 'ignore': 'ignorar', 'suppress': 'suprimir',
+ 'filter': 'filtro', 'regex': 'expresión regular', 'wildcard': 'comodín',
+ 'glob': 'glob', 'path': 'ruta', 'directory': 'directorio', 'folder': 'carpeta',
+ 'file': 'archivo', 'attribute': 'atributo', 'property': 'propiedad',
+ 'field': 'campo', 'member': 'miembro', 'static': 'estático', 'instance': 'instancia',
+ 'class': 'clase', 'struct': 'estructura', 'union': 'unión', 'typedef': 'definición de tipo',
+ 'macro': 'macro', 'define': 'definir', 'ifdef': 'si está definido',
+ 'ifndef': 'si no está definido', 'endif': 'fin si', 'include': 'incluir',
+ 'import': 'importar', 'export': 'exportar', 'using': 'usando', 'extern': 'externo',
+ 'const': 'constante', 'mutable': 'mutable', 'inline': 'en línea',
+ 'virtual': 'virtual', 'override': 'anular', 'final': 'final', 'operator': 'operador',
+ 'overload': 'sobrecarga', 'typename': 'nombre de tipo', 'specialization': 'especialización',
+ 'instantiation': 'instanciación', 'generic': 'genérico', 'type': 'tipo',
+ 'cast': 'conversión', 'coercion': 'coerción', 'promotion': 'promoción',
+ 'demotion': 'degradación', 'widening': 'ampliación', 'narrowing': 'reducción',
+};
+
+function translateComment(text) {
+ if (!text) return text;
+ let result = text;
+
+ Object.entries(dictionary).forEach(([en, es]) => {
+ const regex = new RegExp(`\\b${en}\\b`, 'gi');
+ result = result.replace(regex, (match) => {
+ if (match === match.toUpperCase() && match.length > 1) {
+ return es.toUpperCase();
+ }
+ if (match[0] === match[0].toUpperCase()) {
+ return es.charAt(0).toUpperCase() + es.slice(1);
+ }
+ return es;
+ });
+ });
+
+ return result;
+}
+
+function processFile(filePath) {
+ const ext = path.extname(filePath).toLowerCase();
+ const allowedExts = ['.cpp', '.h', '.js', '.html', '.css', '.md'];
+
+ if (!allowedExts.includes(ext)) {
+ return { success: false, translated: false };
+ }
+
+ try {
+ let content = fs.readFileSync(filePath, 'utf-8');
+ const original = content;
+
+ // Comentarios de bloque /* */
+ content = content.replace(/\/\*[\s\S]*?\*\//g, (match) => {
+ const inner = match.slice(2, -2);
+ const translated = translateComment(inner);
+ return '/*' + translated + '*/';
+ });
+
+ // Comentarios de línea //
+ content = content.replace(/^(\s*)\/\/(.*)$/gm, (match, indent, comment) => {
+ return indent + '//' + translateComment(comment);
+ });
+
+ // Comentarios HTML
+ content = content.replace(//g, (match) => {
+ const inner = match.slice(4, -3);
+ const translated = translateComment(inner);
+ return '';
+ });
+
+ const translated = content !== original;
+ if (translated) {
+ fs.writeFileSync(filePath, content, 'utf-8');
+ return { success: true, translated: true, path: filePath };
+ }
+
+ return { success: true, translated: false };
+ } catch (error) {
+ return { success: false, translated: false };
+ }
+}
+
+function scanDirectory(dir) {
+ const files = [];
+ const excluded = ['node_modules', '.git', '.next', 'dist', 'build', 'coverage', '.vscode', 'html_'];
+
+ try {
+ const items = fs.readdirSync(dir);
+ items.forEach(item => {
+ const filePath = path.join(dir, item);
+ try {
+ const stat = fs.statSync(filePath);
+
+ if (stat.isDirectory()) {
+ if (!excluded.some(e => filePath.includes(e))) {
+ files.push(...scanDirectory(filePath));
+ }
+ } else {
+ files.push(filePath);
+ }
+ } catch (e) {
+ // Ignorar
+ }
+ });
+ } catch (error) {
+ // Ignorar
+ }
+
+ return files;
+}
+
+// Ejecutar traducción
+const startTime = Date.now();
+console.log('🔄 FASE 1: Escaneando archivos C++ principales...\n');
+
+const files = scanDirectory('/workspaces/WLED');
+const results = [];
+
+files.forEach((file, index) => {
+ const result = processFile(file);
+ if (result.success && result.translated) {
+ results.push(result.path);
+ console.log(`✓ ${result.path}`);
+ }
+});
+
+const duration = ((Date.now() - startTime) / 1000).toFixed(2);
+console.log(`\n✅ Traducción completada en ${duration}s`);
+console.log(`📊 Archivos traducidos: ${results.length}`);
diff --git a/tools/translate-comments.js b/tools/translate-comments.js
new file mode 100644
index 0000000000..049964bebc
--- /dev/null
+++ b/tools/translate-comments.js
@@ -0,0 +1,235 @@
+const fs = require('fs');
+const path = require('path');
+
+// Diccionario técnico español-inglés
+const dictionary = {
+ 'WLED': 'WLED', 'LED': 'LED', 'WiFi': 'WiFi', 'API': 'API', 'JSON': 'JSON',
+ 'WebSocket': 'WebSocket', 'MQTT': 'MQTT', 'UDP': 'UDP', 'HTTP': 'HTTP',
+ 'E1.31': 'E1.31', 'NeoPixel': 'NeoPixel', 'WS2812B': 'WS2812B', 'SK6812': 'SK6812',
+ 'SPI': 'SPI', 'I2C': 'I2C', 'UART': 'UART', 'GPIO': 'GPIO', 'EEPROM': 'EEPROM',
+ 'main': 'principal', 'setup': 'configuración', 'loop': 'bucle',
+ 'initialize': 'inicializar', 'update': 'actualizar', 'render': 'renderizar',
+ 'draw': 'dibujar', 'paint': 'pintar', 'clear': 'limpiar', 'reset': 'restablecer',
+ 'enable': 'habilitar', 'disable': 'deshabilitar', 'start': 'iniciar',
+ 'stop': 'detener', 'pause': 'pausar', 'resume': 'reanudar', 'save': 'guardar',
+ 'load': 'cargar', 'delete': 'eliminar', 'create': 'crear', 'destroy': 'destruir',
+ 'check': 'verificar', 'validate': 'validar', 'convert': 'convertir',
+ 'parse': 'analizar', 'format': 'formato', 'configure': 'configurar',
+ 'connect': 'conectar', 'disconnect': 'desconectar', 'send': 'enviar',
+ 'receive': 'recibir', 'read': 'leer', 'write': 'escribir', 'append': 'añadir',
+ 'insert': 'insertar', 'remove': 'eliminar', 'replace': 'reemplazar',
+ 'search': 'buscar', 'find': 'encontrar', 'match': 'coincidir', 'compare': 'comparar',
+ 'index': 'índice', 'offset': 'desplazamiento', 'position': 'posición',
+ 'size': 'tamaño', 'length': 'longitud', 'count': 'conteo', 'value': 'valor',
+ 'variable': 'variable', 'constant': 'constante', 'parameter': 'parámetro',
+ 'argument': 'argumento', 'return': 'retorno', 'result': 'resultado',
+ 'error': 'error', 'warning': 'advertencia', 'info': 'información',
+ 'debug': 'depuración', 'trace': 'rastreo', 'log': 'registro', 'print': 'imprimir',
+ 'output': 'salida', 'input': 'entrada', 'buffer': 'búfer', 'array': 'matriz',
+ 'list': 'lista', 'queue': 'cola', 'stack': 'pila', 'tree': 'árbol',
+ 'node': 'nodo', 'link': 'enlace', 'connection': 'conexión', 'network': 'red',
+ 'server': 'servidor', 'client': 'cliente', 'request': 'solicitud',
+ 'response': 'respuesta', 'status': 'estado', 'state': 'estado', 'code': 'código',
+ 'message': 'mensaje', 'data': 'datos', 'payload': 'carga útil', 'header': 'encabezado',
+ 'body': 'cuerpo', 'content': 'contenido', 'text': 'texto', 'html': 'HTML',
+ 'xml': 'XML', 'css': 'CSS', 'javascript': 'JavaScript', 'function': 'función',
+ 'method': 'método', 'procedure': 'procedimiento', 'routine': 'rutina',
+ 'handler': 'manejador', 'listener': 'escuchador', 'callback': 'devolución de llamada',
+ 'event': 'evento', 'trigger': 'disparador', 'action': 'acción', 'effect': 'efecto',
+ 'animation': 'animación', 'transition': 'transición', 'color': 'color',
+ 'brightness': 'brillo', 'intensity': 'intensidad', 'speed': 'velocidad',
+ 'duration': 'duración', 'delay': 'retraso', 'timeout': 'tiempo de espera',
+ 'interval': 'intervalo', 'frequency': 'frecuencia', 'pixel': 'píxel',
+ 'strip': 'tira', 'segment': 'segmento', 'range': 'rango', 'limit': 'límite',
+ 'threshold': 'umbral', 'tolerance': 'tolerancia', 'precision': 'precisión',
+ 'performance': 'rendimiento', 'optimization': 'optimización', 'memory': 'memoria',
+ 'storage': 'almacenamiento', 'cache': 'caché', 'heap': 'montón', 'thread': 'hilo',
+ 'process': 'proceso', 'task': 'tarea', 'job': 'trabajo', 'scheduler': 'planificador',
+ 'timer': 'temporizador', 'interrupt': 'interrupción', 'signal': 'señal',
+ 'exception': 'excepción', 'fault': 'fallo', 'crash': 'bloqueo',
+ 'deadlock': 'bloqueo mutuo', 'race': 'condición de carrera', 'condition': 'condición',
+ 'mutex': 'mutex', 'semaphore': 'semáforo', 'lock': 'bloqueo', 'unlock': 'desbloqueo',
+ 'atomic': 'atómico', 'volatile': 'volátil', 'synchronous': 'síncrono',
+ 'asynchronous': 'asíncrono', 'blocking': 'bloqueante', 'non-blocking': 'no bloqueante',
+ 'promise': 'promesa', 'future': 'futuro', 'await': 'esperar', 'async': 'asíncrono',
+ 'generator': 'generador', 'iterator': 'iterador', 'enumeration': 'enumeración',
+ 'flag': 'bandera', 'bit': 'bit', 'byte': 'byte', 'word': 'palabra',
+ 'integer': 'entero', 'float': 'flotante', 'double': 'doble', 'string': 'cadena',
+ 'character': 'carácter', 'boolean': 'booleano', 'true': 'verdadero',
+ 'false': 'falso', 'null': 'nulo', 'undefined': 'indefinido', 'overflow': 'desbordamiento',
+ 'underflow': 'subdesbordamiento', 'truncate': 'truncar', 'round': 'redondear',
+ 'ceil': 'techo', 'floor': 'piso', 'absolute': 'absoluto', 'sign': 'signo',
+ 'magnitude': 'magnitud', 'scale': 'escala', 'normalize': 'normalizar',
+ 'interpolate': 'interpolar', 'extrapolate': 'extrapolar', 'blend': 'mezcla',
+ 'combine': 'combinar', 'merge': 'fusionar', 'split': 'dividir', 'chunk': 'fragmento',
+ 'partition': 'partición', 'distribute': 'distribuir', 'balance': 'equilibrio',
+ 'load': 'carga', 'capacity': 'capacidad', 'utilization': 'utilización',
+ 'efficiency': 'eficiencia', 'latency': 'latencia', 'throughput': 'rendimiento',
+ 'bandwidth': 'ancho de banda', 'jitter': 'inestabilidad', 'skew': 'sesgo',
+ 'bias': 'sesgo', 'variance': 'varianza', 'deviation': 'desviación',
+ 'standard': 'estándar', 'specification': 'especificación', 'requirement': 'requisito',
+ 'constraint': 'restricción', 'dependency': 'dependencia', 'relationship': 'relación',
+ 'association': 'asociación', 'aggregation': 'agregación', 'composition': 'composición',
+ 'inheritance': 'herencia', 'polymorphism': 'polimorfismo', 'abstraction': 'abstracción',
+ 'encapsulation': 'encapsulamiento', 'interface': 'interfaz', 'implementation': 'implementación',
+ 'contract': 'contrato', 'protocol': 'protocolo', 'sdk': 'SDK',
+ 'framework': 'marco de trabajo', 'library': 'biblioteca', 'module': 'módulo',
+ 'package': 'paquete', 'component': 'componente', 'subsystem': 'subsistema',
+ 'system': 'sistema', 'platform': 'plataforma', 'application': 'aplicación',
+ 'service': 'servicio', 'middleware': 'middleware', 'layer': 'capa',
+ 'tier': 'nivel', 'level': 'nivel', 'hierarchy': 'jerarquía', 'topology': 'topología',
+ 'architecture': 'arquitectura', 'design': 'diseño', 'pattern': 'patrón',
+ 'template': 'plantilla', 'strategy': 'estrategia', 'algorithm': 'algoritmo',
+ 'heuristic': 'heurística', 'estimation': 'estimación', 'calculation': 'cálculo',
+ 'computation': 'computación', 'evaluation': 'evaluación', 'assessment': 'evaluación',
+ 'analysis': 'análisis', 'synthesis': 'síntesis', 'modeling': 'modelado',
+ 'simulation': 'simulación', 'emulation': 'emulación', 'virtualization': 'virtualización',
+ 'deployment': 'implementación', 'installation': 'instalación',
+ 'customization': 'personalización', 'extension': 'extensión', 'plugin': 'complemento',
+ 'addon': 'complemento', 'usermod': 'usermod', 'firmware': 'firmware',
+ 'bootloader': 'bootloader', 'kernel': 'kernel', 'driver': 'controlador',
+ 'device': 'dispositivo', 'hardware': 'hardware', 'software': 'software',
+ 'port': 'puerto', 'socket': 'socket', 'endpoint': 'extremo',
+ 'gateway': 'puerta de enlace', 'proxy': 'proxy', 'router': 'enrutador',
+ 'switch': 'conmutador', 'firewall': 'cortafuegos', 'encryption': 'cifrado',
+ 'decryption': 'descifrado', 'hash': 'hash', 'digest': 'resumen', 'signature': 'firma',
+ 'certificate': 'certificado', 'authentication': 'autenticación',
+ 'authorization': 'autorización', 'access': 'acceso', 'permission': 'permiso',
+ 'privilege': 'privilegio', 'role': 'rol', 'user': 'usuario', 'admin': 'administrador',
+ 'owner': 'propietario', 'group': 'grupo', 'domain': 'dominio', 'realm': 'reino',
+ 'zone': 'zona', 'context': 'contexto', 'scope': 'alcance', 'namespace': 'espacio de nombres',
+ 'version': 'versión', 'release': 'lanzamiento', 'build': 'compilación',
+ 'patch': 'parche', 'upgrade': 'mejora', 'downgrade': 'degradación',
+ 'migration': 'migración', 'rollback': 'reversión', 'commit': 'confirmación',
+ 'revert': 'revertir', 'merge': 'fusión', 'branch': 'rama', 'tag': 'etiqueta',
+ 'rebase': 'cambiar base', 'squash': 'comprimir', 'stash': 'almacenar',
+ 'staging': 'área de preparación', 'working': 'funcionamiento', 'repository': 'repositorio',
+ 'fork': 'bifurcación', 'clone': 'clon', 'pull': 'extraer', 'push': 'enviar',
+ 'fetch': 'obtener', 'sync': 'sincronizar', 'conflict': 'conflicto',
+ 'resolution': 'resolución', 'diff': 'diferencia', 'blame': 'culpa',
+ 'history': 'historial', 'stats': 'estadísticas', 'metric': 'métrica',
+ 'benchmark': 'punto de referencia', 'profile': 'perfil', 'breakpoint': 'punto de ruptura',
+ 'watchpoint': 'punto de observación', 'step': 'paso', 'continue': 'continuar',
+ 'break': 'ruptura', 'exit': 'salida', 'quit': 'salir', 'abort': 'abortar',
+ 'retry': 'reintentar', 'skip': 'omitir', 'ignore': 'ignorar', 'suppress': 'suprimir',
+ 'filter': 'filtro', 'regex': 'expresión regular', 'wildcard': 'comodín',
+ 'glob': 'glob', 'path': 'ruta', 'directory': 'directorio', 'folder': 'carpeta',
+ 'file': 'archivo', 'attribute': 'atributo', 'property': 'propiedad',
+ 'field': 'campo', 'member': 'miembro', 'static': 'estático', 'instance': 'instancia',
+ 'class': 'clase', 'struct': 'estructura', 'union': 'unión', 'typedef': 'definición de tipo',
+ 'macro': 'macro', 'define': 'definir', 'ifdef': 'si está definido',
+ 'ifndef': 'si no está definido', 'endif': 'fin si', 'include': 'incluir',
+ 'import': 'importar', 'export': 'exportar', 'using': 'usando', 'extern': 'externo',
+ 'const': 'constante', 'mutable': 'mutable', 'inline': 'en línea',
+ 'virtual': 'virtual', 'override': 'anular', 'final': 'final', 'operator': 'operador',
+ 'overload': 'sobrecarga', 'typename': 'nombre de tipo', 'specialization': 'especialización',
+ 'instantiation': 'instanciación', 'generic': 'genérico', 'type': 'tipo',
+ 'cast': 'conversión', 'coercion': 'coerción', 'promotion': 'promoción',
+ 'demotion': 'degradación', 'widening': 'ampliación', 'narrowing': 'reducción',
+};
+
+function translateComment(text) {
+ if (!text) return text;
+ let result = text;
+
+ Object.entries(dictionary).forEach(([en, es]) => {
+ const regex = new RegExp(`\\b${en}\\b`, 'gi');
+ result = result.replace(regex, (match) => {
+ if (match === match.toUpperCase() && match.length > 1) {
+ return es.toUpperCase();
+ }
+ if (match[0] === match[0].toUpperCase()) {
+ return es.charAt(0).toUpperCase() + es.slice(1);
+ }
+ return es;
+ });
+ });
+
+ return result;
+}
+
+function processFile(filePath) {
+ const ext = path.extname(filePath).toLowerCase();
+ const allowedExts = ['.cpp', '.h', '.js', '.html', '.css'];
+
+ if (!allowedExts.includes(ext)) {
+ return { success: false, translated: false };
+ }
+
+ try {
+ let content = fs.readFileSync(filePath, 'utf-8');
+ const original = content;
+
+ // Comentarios de bloque /* */
+ content = content.replace(/\/\*[\s\S]*?\*\//g, (match) => {
+ const inner = match.slice(2, -2);
+ const translated = translateComment(inner);
+ return '/*' + translated + '*/';
+ });
+
+ // Comentarios de línea //
+ content = content.replace(/^(\s*)\/\/(.*)$/gm, (match, indent, comment) => {
+ return indent + '//' + translateComment(comment);
+ });
+
+ // Comentarios HTML
+ content = content.replace(//g, (match) => {
+ const inner = match.slice(4, -3);
+ const translated = translateComment(inner);
+ return '';
+ });
+
+ const translated = content !== original;
+ if (translated) {
+ fs.writeFileSync(filePath, content, 'utf-8');
+ return { success: true, translated: true, path: filePath };
+ }
+
+ return { success: true, translated: false };
+ } catch (error) {
+ return { success: false, translated: false };
+ }
+}
+
+function scanDirectory(dir) {
+ const files = [];
+ const excluded = ['node_modules', '.git', '.next', 'dist', 'build', 'coverage', '.vscode'];
+
+ try {
+ const items = fs.readdirSync(dir);
+ items.forEach(item => {
+ const filePath = path.join(dir, item);
+ try {
+ const stat = fs.statSync(filePath);
+
+ if (stat.isDirectory()) {
+ if (!excluded.some(e => filePath.includes(e))) {
+ files.push(...scanDirectory(filePath));
+ }
+ } else {
+ files.push(filePath);
+ }
+ } catch (e) {
+ // Ignorar
+ }
+ });
+ } catch (error) {
+ // Ignorar
+ }
+
+ return files;
+}
+
+// Ejecutar
+const files = scanDirectory('/workspaces/WLED');
+let translated = 0;
+
+files.forEach((file) => {
+ const result = processFile(file);
+ if (result.translated) {
+ translated++;
+ console.log(`✓ ${file}`);
+ }
+});
+
+console.log(`\n✅ Traducción completada: ${translated} archivos`);
diff --git a/usermods/ADS1115_v2/ADS1115_v2.cpp b/usermods/ADS1115_v2/ADS1115_v2.cpp
index bbf457f486..0e16135e92 100644
--- a/usermods/ADS1115_v2/ADS1115_v2.cpp
+++ b/usermods/ADS1115_v2/ADS1115_v2.cpp
@@ -31,7 +31,7 @@ class ADS1115Usermod : public Usermod {
if (isEnabled && millis() - lastTime > loopInterval) {
lastTime = millis();
- // If we don't have new data, skip this iteration.
+ // If we don't have new datos, omitir this iteration.
if (!ads.conversionComplete()) {
return;
}
diff --git a/usermods/AHT10_v2/AHT10_v2.cpp b/usermods/AHT10_v2/AHT10_v2.cpp
index f88bee1daa..7764a14474 100644
--- a/usermods/AHT10_v2/AHT10_v2.cpp
+++ b/usermods/AHT10_v2/AHT10_v2.cpp
@@ -16,7 +16,7 @@ class UsermodAHT10 : public Usermod
bool _mqttHomeAssistant : 1; // Enable Home Assistant docs
bool _initDone : 1; // Initialization is done
- // Settings. Some of these are stored in a different format than they're user settings - so we don't have to convert at runtime
+ // Settings. Some of these are stored in a different formato than they're usuario settings - so we don't have to convertir at runtime
uint8_t _i2cAddress = AHT10_ADDRESS_0X38;
ASAIR_I2C_SENSOR _ahtType = AHT10_SENSOR;
uint16_t _checkInterval = 60000; // milliseconds, user settings is in seconds
@@ -55,7 +55,7 @@ class UsermodAHT10 : public Usermod
#ifndef WLED_DISABLE_MQTT
void mqttInitialize()
{
- // This is a generic "setup mqtt" function, So we must abort if we're not to do mqtt
+ // This is a genérico "configuración MQTT" función, So we must abortar if we're not to do MQTT
if (!WLED_MQTT_CONNECTED || !_mqttPublish || !_mqttHomeAssistant)
return;
@@ -69,8 +69,8 @@ class UsermodAHT10 : public Usermod
void mqttPublishIfChanged(const __FlashStringHelper *topic, float &lastState, float state, float minChange)
{
- // Check if MQTT Connected, otherwise it will crash the 8266
- // Only report if the change is larger than the required diff
+ // Verificar if MQTT Connected, otherwise it will bloqueo the 8266
+ // Only report if the change is larger than the required diferencia
if (WLED_MQTT_CONNECTED && _mqttPublish && (_mqttPublishAlways || fabsf(lastState - state) > minChange))
{
char subuf[128];
@@ -81,7 +81,7 @@ class UsermodAHT10 : public Usermod
}
}
- // Create an MQTT Sensor for Home Assistant Discovery purposes, this includes a pointer to the topic that is published to in the Loop.
+ // Crear an MQTT Sensor for Home Assistant Discovery purposes, this includes a pointer to the topic that is published to in the Bucle.
void mqttCreateHassSensor(const String &name, const String &topic, const String &deviceClass, const String &unitOfMeasurement)
{
String t = String(F("homeassistant/sensor/")) + mqttClientID + "/" + name + F("/config");
@@ -121,8 +121,8 @@ class UsermodAHT10 : public Usermod
void loop()
{
- // if usermod is disabled or called during strip updating just exit
- // NOTE: on very long strips strip.isUpdating() may always return true so update accordingly
+ // if usermod is disabled or called during tira updating just salida
+ // NOTE: on very long strips tira.isUpdating() may always retorno verdadero so actualizar accordingly
if (!_settingEnabled || strip.isUpdating())
return;
@@ -137,7 +137,7 @@ class UsermodAHT10 : public Usermod
if (_lastStatus == AHT10_ERROR)
{
- // Perform softReset and retry
+ // Perform softReset and reintentar
DEBUG_PRINTLN(F("AHTxx returned error, doing softReset"));
if (!_aht->softReset())
{
@@ -154,9 +154,9 @@ class UsermodAHT10 : public Usermod
float humidity = truncateDecimals(_aht->readHumidity(AHT10_USE_READ_DATA));
#ifndef WLED_DISABLE_MQTT
- // Push to MQTT
+ // Enviar to MQTT
- // We can avoid reporting if the change is insignificant. The threshold chosen is below the level of accuracy, but way above 0.01 which is the precision of the value provided.
+ // We can avoid reporting if the change is insignificant. The umbral chosen is below the nivel of accuracy, but way above 0.01 which is the precisión of the valor provided.
// The AHT10/15/20 has an accuracy of 0.3C in the temperature readings
mqttPublishIfChanged(F("temperature"), _lastTemperatureSent, temperature, 0.1f);
@@ -184,7 +184,7 @@ class UsermodAHT10 : public Usermod
void addToJsonInfo(JsonObject &root) override
{
- // if "u" object does not exist yet wee need to create it
+ // if "u" object does not exist yet wee need to crear it
JsonObject user = root["u"];
if (user.isNull())
user = root.createNestedObject("u");
@@ -241,8 +241,8 @@ class UsermodAHT10 : public Usermod
bool readFromConfig(JsonObject &root) override
{
- // default settings values could be set here (or below using the 3-argument getJsonValue()) instead of in the class definition or constructor
- // setting them inside readFromConfig() is slightly more robust, handling the rare but plausible use case of single value being missing after boot (e.g. if the cfg.json was manually edited and a value was removed)
+ // default settings values could be set here (or below usando the 3-argumento getJsonValue()) instead of in the clase definition or constructor
+ // setting them inside readFromConfig() is slightly more robust, handling the rare but plausible use case of single valor being missing after boot (e.g. if the cfg.JSON was manually edited and a valor was removed)
JsonObject top = root[FPSTR(_name)];
@@ -262,7 +262,7 @@ class UsermodAHT10 : public Usermod
if (1 <= _checkInterval && _checkInterval <= 600)
_checkInterval *= 1000;
else
- // Invalid input
+ // Invalid entrada
_checkInterval = 60000;
}
@@ -272,7 +272,7 @@ class UsermodAHT10 : public Usermod
if (0 <= _decimalFactor && _decimalFactor <= 5)
_decimalFactor = pow10f(_decimalFactor);
else
- // Invalid input
+ // Invalid entrada
_decimalFactor = 100;
}
@@ -283,7 +283,7 @@ class UsermodAHT10 : public Usermod
if (0 <= tmpAhtType && tmpAhtType <= 2)
_ahtType = static_cast(tmpAhtType);
else
- // Invalid input
+ // Invalid entrada
_ahtType = ASAIR_I2C_SENSOR::AHT10_SENSOR;
}
diff --git a/usermods/Animated_Staircase/Animated_Staircase.cpp b/usermods/Animated_Staircase/Animated_Staircase.cpp
index 2d2d27cf43..4234f8a116 100644
--- a/usermods/Animated_Staircase/Animated_Staircase.cpp
+++ b/usermods/Animated_Staircase/Animated_Staircase.cpp
@@ -2,10 +2,10 @@
* Usermod for detecting people entering/leaving a staircase and switching the
* staircase on/off.
*
- * Edit the Animated_Staircase_config.h file to compile this usermod for your
+ * Edit the Animated_Staircase_config.h archivo to compile this usermod for your
* specific configuration.
*
- * See the accompanying README.md file for more info.
+ * See the accompanying README.md archivo for more información.
*/
#include "wled.h"
@@ -29,14 +29,14 @@ class Animated_Staircase : public Usermod {
/* runtime variables */
bool initDone = false;
- // Time between checking of the sensors
+ // Hora between checking of the sensors
const unsigned int scanDelay = 100;
// Lights on or off.
- // Flipping this will start a transition.
+ // Flipping this will iniciar a transición.
bool on = false;
- // Swipe direction for current transition
+ // Swipe direction for current transición
#define SWIPE_UP true
#define SWIPE_DOWN false
bool swipe = SWIPE_UP;
@@ -47,28 +47,28 @@ class Animated_Staircase : public Usermod {
#define UPPER true
bool lastSensor = LOWER;
- // Time of the last transition action
+ // Hora of the last transición acción
unsigned long lastTime = 0;
- // Time of the last sensor check
+ // Hora of the last sensor verificar
unsigned long lastScanTime = 0;
// Last time the lights were switched on or off
unsigned long lastSwitchTime = 0;
- // segment id between onIndex and offIndex are on.
+ // segmento id between onIndex and offIndex are on.
// controll the swipe by setting/moving these indices around.
// onIndex must be less than or equal to offIndex
byte onIndex = 0;
byte offIndex = 0;
// The maximum number of configured segments.
- // Dynamically updated based on user configuration.
+ // Dynamically updated based on usuario configuration.
byte maxSegmentId = 1;
byte minSegmentId = 0;
- // These values are used by the API to read the
- // last sensor state, or trigger a sensor
+ // These values are used by the API to leer the
+ // last sensor estado, or disparador a sensor
// through the API
bool topSensorRead = false;
bool topSensorWrite = false;
@@ -77,7 +77,7 @@ class Animated_Staircase : public Usermod {
bool topSensorState = false;
bool bottomSensorState = false;
- // strings to reduce flash memory usage (used more than twice)
+ // strings to reduce flash memoria usage (used more than twice)
static const char _name[];
static const char _enabled[];
static const char _segmentDelay[];
@@ -94,7 +94,7 @@ class Animated_Staircase : public Usermod {
void publishMqtt(bool bottom, const char* state) {
#ifndef WLED_DISABLE_MQTT
- //Check if MQTT Connected, otherwise it will crash the 8266
+ //Verificar if MQTT Connected, otherwise it will bloqueo the 8266
if (WLED_MQTT_CONNECTED){
char subuf[64];
sprintf_P(subuf, PSTR("%s/motion/%d"), mqttDeviceTopic, (int)bottom);
@@ -109,7 +109,7 @@ class Animated_Staircase : public Usermod {
if (!seg.isActive()) continue; // skip gaps
if (i >= onIndex && i < offIndex) {
seg.setOption(SEG_OPTION_ON, true);
- // We may need to copy mode and colors from segment 0 to make sure
+ // We may need to copy mode and colors from segmento 0 to make sure
// changes are propagated even when the config is changed during a wipe
// seg.setMode(mainsegment.mode);
// seg.setColor(0, mainsegment.colors[0]);
@@ -117,7 +117,7 @@ class Animated_Staircase : public Usermod {
seg.setOption(SEG_OPTION_ON, false);
}
// Always mark segments as "transitional", we are animating the staircase
- //seg.setOption(SEG_OPTION_TRANSITIONAL, true); // not needed anymore as setOption() does it
+ //seg.setOption(SEG_OPTION_TRANSITIONAL, verdadero); // not needed anymore as setOption() does it
}
strip.trigger(); // force strip refresh
stateChanged = true; // inform external devices/UI of change
@@ -125,14 +125,14 @@ class Animated_Staircase : public Usermod {
}
/*
- * Detects if an object is within ultrasound range.
+ * Detects if an object is within ultrasound rango.
* signalPin: The pin where the pulse is sent
* echoPin: The pin where the echo is received
- * maxTimeUs: Detection timeout in microseconds. If an echo is
+ * maxTimeUs: Detection tiempo de espera in microseconds. If an echo is
* received within this time, an object is detected
- * and the function will return true.
+ * and the función will retorno verdadero.
*
- * The speed of sound is 343 meters per second at 20 degrees Celsius.
+ * The velocidad of sound is 343 meters per second at 20 degrees Celsius.
* Since the sound has to travel back and forth, the detection
* distance for the sensor in cm is (0.0343 * maxTimeUs) / 2.
*
@@ -187,7 +187,7 @@ class Animated_Staircase : public Usermod {
DEBUG_PRINTLN(F("Top sensor changed."));
}
- // Values read, reset the flags for next API call
+ // Values leer, restablecer the flags for next API call
topSensorWrite = false;
bottomSensorWrite = false;
@@ -205,7 +205,7 @@ class Animated_Staircase : public Usermod {
DEBUG_PRINTLN(swipe ? F("up.") : F("down."));
if (onIndex == offIndex) {
- // Position the indices for a correct on-swipe
+ // Posición the indices for a correct on-swipe
if (swipe == SWIPE_UP) {
onIndex = minSegmentId;
} else {
@@ -258,7 +258,7 @@ class Animated_Staircase : public Usermod {
}
}
- // send sensor values to JSON API
+ // enviar sensor values to JSON API
void writeSensorsToJson(JsonObject& staircase) {
staircase[F("top-sensor")] = topSensorRead;
staircase[F("bottom-sensor")] = bottomSensorRead;
@@ -295,13 +295,13 @@ class Animated_Staircase : public Usermod {
onIndex = minSegmentId = strip.getMainSegmentId(); // it may not be the best idea to start with main segment as it may not be the first one
offIndex = maxSegmentId = strip.getLastActiveSegmentId() + 1;
- // shorten the strip transition time to be equal or shorter than segment delay
+ // shorten the tira transición time to be equal or shorter than segmento retraso
transitionDelay = segment_delay_ms;
strip.setTransition(segment_delay_ms);
strip.trigger();
} else {
if (togglePower && !on && offMode) toggleOnOff(); // toggle power on if off
- // Restore segment options
+ // Restore segmento options
for (int i = 0; i <= strip.getLastActiveSegmentId(); i++) {
Segment &seg = strip.getSegment(i);
if (!seg.isActive()) continue; // skip vector gaps
@@ -329,8 +329,8 @@ class Animated_Staircase : public Usermod {
{ bottomPIRorTriggerPin, useUSSensorBottom },
{ bottomEchoPin, false },
};
- // NOTE: this *WILL* return TRUE if all the pins are set to -1.
- // this is *BY DESIGN*.
+ // NOTE: this *WILL* retorno VERDADERO if all the pins are set to -1.
+ // this is *BY DISEÑO*.
if (!PinManager::allocateMultiplePins(pins, 4, PinOwner::UM_AnimatedStaircase)) {
topPIRorTriggerPin = -1;
topEchoPin = -1;
@@ -355,8 +355,8 @@ class Animated_Staircase : public Usermod {
#ifndef WLED_DISABLE_MQTT
/**
- * handling of MQTT message
- * topic only contains stripped topic (part after /wled/MAC)
+ * handling of MQTT mensaje
+ * topic only contains stripped topic (part after /WLED/MAC)
* topic should look like: /swipe with amessage of [up|down]
*/
bool onMqttMessage(char* topic, char* payload) {
@@ -403,7 +403,7 @@ class Animated_Staircase : public Usermod {
}
/*
- * Reads configuration settings from the json API.
+ * Reads configuration settings from the JSON API.
* See void addToJsonState(JsonObject& root)
*/
void readFromJsonState(JsonObject& root) {
@@ -425,14 +425,14 @@ class Animated_Staircase : public Usermod {
void appendConfigData() {
//oappend(F("dd=addDropdown('staircase','selectfield');"));
- //oappend(F("addOption(dd,'1st value',0);"));
- //oappend(F("addOption(dd,'2nd value',1);"));
- //oappend(F("addInfo('staircase:selectfield',1,'additional info');")); // 0 is field type, 1 is actual field
+ //oappend(F("addOption(dd,'1st valor',0);"));
+ //oappend(F("addOption(dd,'2nd valor',1);"));
+ //oappend(F("addInfo('staircase:selectfield',1,'additional información');")); // 0 is campo tipo, 1 is actual campo
}
/*
- * Writes the configuration to internal flash memory.
+ * Writes the configuration to internal flash memoria.
*/
void addToConfig(JsonObject& root) {
JsonObject staircase = root[FPSTR(_name)];
@@ -455,9 +455,9 @@ class Animated_Staircase : public Usermod {
}
/*
- * Reads the configuration to internal flash memory before setup() is called.
+ * Reads the configuration to internal flash memoria before configuración() is called.
*
- * The function should return true if configuration was successfully loaded or false if there was no configuration.
+ * The función should retorno verdadero if configuration was successfully loaded or falso if there was no configuration.
*/
bool readFromConfig(JsonObject& root) {
bool oldUseUSSensorTop = useUSSensorTop;
@@ -499,7 +499,7 @@ class Animated_Staircase : public Usermod {
DEBUG_PRINT(FPSTR(_name));
if (!initDone) {
- // first run: reading from cfg.json
+ // first run: reading from cfg.JSON
DEBUG_PRINTLN(F(" config loaded."));
} else {
// changing parameters from settings page
@@ -519,12 +519,12 @@ class Animated_Staircase : public Usermod {
}
if (changed) setup();
}
- // use "return !top["newestParameter"].isNull();" when updating Usermod with new features
+ // use "retorno !top["newestParameter"].isNull();" when updating Usermod with new features
return !top[FPSTR(_togglePower)].isNull();
}
/*
- * Shows the delay between steps and power-off time in the "info"
+ * Shows the retraso between steps and power-off time in the "información"
* tab of the web-UI.
*/
void addToJsonInfo(JsonObject& root) {
@@ -547,7 +547,7 @@ class Animated_Staircase : public Usermod {
}
};
-// strings to reduce flash memory usage (used more than twice)
+// strings to reduce flash memoria usage (used more than twice)
const char Animated_Staircase::_name[] PROGMEM = "staircase";
const char Animated_Staircase::_enabled[] PROGMEM = "enabled";
const char Animated_Staircase::_segmentDelay[] PROGMEM = "segment-delay-ms";
diff --git a/usermods/Artemis_reciever/usermod.cpp b/usermods/Artemis_reciever/usermod.cpp
index 5f230dfd88..322c78b42f 100644
--- a/usermods/Artemis_reciever/usermod.cpp
+++ b/usermods/Artemis_reciever/usermod.cpp
@@ -1,7 +1,7 @@
/*
* RGB.NET (artemis) receiver
*
- * This works via the UDP, http is not supported apart from reporting LED count
+ * This works via the UDP, HTTP is not supported apart from reporting LED conteo
*
*
*/
@@ -19,11 +19,11 @@ void RGBNET_readValues() {
int RGBNET_packetSize = UDP.parsePacket();
if (RGBNET_packetSize) {
- // receive incoming UDP packets
+ // recibir incoming UDP packets
int sequenceNumber = UDP.read();
int channel = UDP.read();
- //channel data is not used we only supports one channel
+ //channel datos is not used we only supports one channel
int len = UDP.read(RGBNET_packet, strip.getLengthTotal()*3);
if(len==0){
return;
@@ -32,17 +32,17 @@ void RGBNET_readValues() {
for (int i = 0; i < len; i=i+3) {
strip.setPixelColor(i/3, RGBNET_packet[i], RGBNET_packet[i+1], RGBNET_packet[i+2], 0);
}
- //strip.show();
+ //tira.show();
}
}
-//update LED strip
+//actualizar LED tira
void RGBNET_show() {
strip.show();
lastTime = millis();
}
-//This function provides a json with info on the number of LEDs connected
+//This función provides a JSON with información on the number of LEDs connected
// it is needed by artemis to know how many LEDs to display on the surface
void handleConfig(AsyncWebServerRequest *request)
{
@@ -79,7 +79,7 @@ void userSetup()
void userConnected()
{
- // new wifi, who dis?
+ // new WiFi, who dis?
UDP.begin(RGBNET_localUdpPort);
isRGBNETUDPEnabled = true;
}
diff --git a/usermods/BH1750_v2/BH1750_v2.cpp b/usermods/BH1750_v2/BH1750_v2.cpp
index 3800e915d6..3ed19665d7 100644
--- a/usermods/BH1750_v2/BH1750_v2.cpp
+++ b/usermods/BH1750_v2/BH1750_v2.cpp
@@ -1,4 +1,4 @@
-// force the compiler to show a warning to confirm that this file is included
+// force the compiler to show a advertencia to confirm that this archivo is included
#warning **** Included USERMOD_BH1750 ****
#include "wled.h"
@@ -20,7 +20,7 @@ void Usermod_BH1750::_mqttInitialize()
if (HomeAssistantDiscovery) _createMqttSensor(F("Brightness"), mqttLuminanceTopic, F("Illuminance"), F(" lx"));
}
-// Create an MQTT Sensor for Home Assistant Discovery purposes, this includes a pointer to the topic that is published to in the Loop.
+// Crear an MQTT Sensor for Home Assistant Discovery purposes, this includes a pointer to the topic that is published to in the Bucle.
void Usermod_BH1750::_createMqttSensor(const String &name, const String &topic, const String &deviceClass, const String &unitOfMeasurement)
{
String t = String(F("homeassistant/sensor/")) + mqttClientID + F("/") + name + F("/config");
@@ -65,7 +65,7 @@ void Usermod_BH1750::loop()
unsigned long now = millis();
- // check to see if we are due for taking a measurement
+ // verificar to see if we are due for taking a measurement
// lastMeasurement will not be updated until the conversion
// is complete the the reading is finished
if (now - lastMeasurement < minReadingInterval)
@@ -116,7 +116,7 @@ void Usermod_BH1750::addToJsonInfo(JsonObject &root)
lux_json.add(F("BH1750 "));
lux_json.add(F("Not Found"));
} else if (!getLuminanceComplete) {
- // if we haven't read the sensor yet, let the user know
+ // if we haven't leer the sensor yet, let the usuario know
// that we are still waiting for the first measurement
lux_json.add((USERMOD_BH1750_FIRST_MEASUREMENT_AT - millis()) / 1000);
lux_json.add(F(" sec until read"));
@@ -127,7 +127,7 @@ void Usermod_BH1750::addToJsonInfo(JsonObject &root)
}
}
-// (called from set.cpp) stores persistent properties to cfg.json
+// (called from set.cpp) stores persistent properties to cfg.JSON
void Usermod_BH1750::addToConfig(JsonObject &root)
{
// we add JSON object.
@@ -141,7 +141,7 @@ void Usermod_BH1750::addToConfig(JsonObject &root)
DEBUG_PRINTLN(F("BH1750 config saved."));
}
-// called before setup() to populate properties from values stored in cfg.json
+// called before configuración() to populate properties from values stored in cfg.JSON
bool Usermod_BH1750::readFromConfig(JsonObject &root)
{
// we look for JSON object.
@@ -173,7 +173,7 @@ bool Usermod_BH1750::readFromConfig(JsonObject &root)
}
-// strings to reduce flash memory usage (used more than twice)
+// strings to reduce flash memoria usage (used more than twice)
const char Usermod_BH1750::_name[] PROGMEM = "BH1750";
const char Usermod_BH1750::_enabled[] PROGMEM = "enabled";
const char Usermod_BH1750::_maxReadInterval[] PROGMEM = "max-read-interval-ms";
diff --git a/usermods/BH1750_v2/BH1750_v2.h b/usermods/BH1750_v2/BH1750_v2.h
index 22f51ce9ba..c6e6d0bd37 100644
--- a/usermods/BH1750_v2/BH1750_v2.h
+++ b/usermods/BH1750_v2/BH1750_v2.h
@@ -7,12 +7,12 @@
#error "This user mod requires MQTT to be enabled."
#endif
-// the max frequency to check photoresistor, 10 seconds
+// the max frecuencia to verificar photoresistor, 10 seconds
#ifndef USERMOD_BH1750_MAX_MEASUREMENT_INTERVAL
#define USERMOD_BH1750_MAX_MEASUREMENT_INTERVAL 10000
#endif
-// the min frequency to check photoresistor, 500 ms
+// the min frecuencia to verificar photoresistor, 500 ms
#ifndef USERMOD_BH1750_MIN_MEASUREMENT_INTERVAL
#define USERMOD_BH1750_MIN_MEASUREMENT_INTERVAL 500
#endif
@@ -22,7 +22,7 @@
#define USERMOD_BH1750_FIRST_MEASUREMENT_AT 10000
#endif
-// only report if difference grater than offset value
+// only report if difference grater than desplazamiento valor
#ifndef USERMOD_BH1750_OFFSET_VALUE
#define USERMOD_BH1750_OFFSET_VALUE 1
#endif
@@ -36,15 +36,15 @@ class Usermod_BH1750 : public Usermod
unsigned long minReadingInterval = USERMOD_BH1750_MIN_MEASUREMENT_INTERVAL;
unsigned long lastMeasurement = UINT32_MAX - (USERMOD_BH1750_MAX_MEASUREMENT_INTERVAL - USERMOD_BH1750_FIRST_MEASUREMENT_AT);
unsigned long lastSend = UINT32_MAX - (USERMOD_BH1750_MAX_MEASUREMENT_INTERVAL - USERMOD_BH1750_FIRST_MEASUREMENT_AT);
- // flag to indicate we have finished the first readLightLevel call
- // allows this library to report to the user how long until the first
+ // bandera to indicate we have finished the first readLightLevel call
+ // allows this biblioteca to report to the usuario how long until the first
// measurement
bool getLuminanceComplete = false;
- // flag set at startup
+ // bandera set at startup
bool enabled = true;
- // strings to reduce flash memory usage (used more than twice)
+ // strings to reduce flash memoria usage (used more than twice)
static const char _name[];
static const char _enabled[];
static const char _maxReadInterval[];
@@ -66,7 +66,7 @@ class Usermod_BH1750 : public Usermod
// set up Home Assistant discovery entries
void _mqttInitialize();
- // Create an MQTT Sensor for Home Assistant Discovery purposes, this includes a pointer to the topic that is published to in the Loop.
+ // Crear an MQTT Sensor for Home Assistant Discovery purposes, this includes a pointer to the topic that is published to in the Bucle.
void _createMqttSensor(const String &name, const String &topic, const String &deviceClass, const String &unitOfMeasurement);
public:
@@ -78,10 +78,10 @@ class Usermod_BH1750 : public Usermod
void addToJsonInfo(JsonObject &root);
- // (called from set.cpp) stores persistent properties to cfg.json
+ // (called from set.cpp) stores persistent properties to cfg.JSON
void addToConfig(JsonObject &root);
- // called before setup() to populate properties from values stored in cfg.json
+ // called before configuración() to populate properties from values stored in cfg.JSON
bool readFromConfig(JsonObject &root);
inline uint16_t getId()
diff --git a/usermods/BME280_v2/BME280_v2.cpp b/usermods/BME280_v2/BME280_v2.cpp
index dd58590448..9a557dd7fa 100644
--- a/usermods/BME280_v2/BME280_v2.cpp
+++ b/usermods/BME280_v2/BME280_v2.cpp
@@ -1,4 +1,4 @@
-// force the compiler to show a warning to confirm that this file is included
+// force the compiler to show a advertencia to confirm that this archivo is included
#warning **** Included USERMOD_BME280 version 2.0 ****
#include "wled.h"
@@ -14,8 +14,8 @@ class UsermodBME280 : public Usermod
{
private:
- // NOTE: Do not implement any compile-time variables, anything the user needs to configure
- // should be configurable from the Usermod menu using the methods below
+ // NOTE: Do not implement any compile-time variables, anything the usuario needs to configurar
+ // should be configurable from the Usermod menu usando the methods below
// key settings set via usermod menu
uint8_t TemperatureDecimals = 0; // Number of decimal places in published temperaure values
uint8_t HumidityDecimals = 0; // Number of decimal places in published humidity values
@@ -28,7 +28,7 @@ class UsermodBME280 : public Usermod
bool HomeAssistantDiscovery = false; // Publish Home Assistant Device Information
bool enabled = true;
- // set the default pins based on the architecture, these get overridden by Usermod menu settings
+ // set the default pins based on the arquitectura, these get overridden by Usermod menu settings
#ifdef ESP8266
//uint8_t RST_PIN = 16; // Un-comment for Heltec WiFi-Kit-8
#endif
@@ -60,11 +60,11 @@ class UsermodBME280 : public Usermod
// MQTT topic strings for publishing Home Assistant discovery topics
bool mqttInitialized = false;
- // strings to reduce flash memory usage (used more than twice)
+ // strings to reduce flash memoria usage (used more than twice)
static const char _name[];
static const char _enabled[];
- // Read the BME280/BMP280 Sensor (which one runs depends on whether Celsius or Fahrenheit being set in Usermod Menu)
+ // Leer the BME280/BMP280 Sensor (which one runs depends on whether Celsius or Fahrenheit being set in Usermod Menu)
void UpdateBME280Data(int SensorType)
{
float _temperature, _humidity, _pressure;
@@ -104,7 +104,7 @@ class UsermodBME280 : public Usermod
}
}
- // Procedure to define all MQTT discovery Topics
+ // Procedimiento to definir all MQTT discovery Topics
void _mqttInitialize()
{
char mqttTemperatureTopic[128];
@@ -127,7 +127,7 @@ class UsermodBME280 : public Usermod
}
}
- // Create an MQTT Sensor for Home Assistant Discovery purposes, this includes a pointer to the topic that is published to in the Loop.
+ // Crear an MQTT Sensor for Home Assistant Discovery purposes, this includes a pointer to the topic that is published to in the Bucle.
void _createMqttSensor(const String &name, const String &topic, const String &deviceClass, const String &unitOfMeasurement)
{
String t = String(F("homeassistant/sensor/")) + mqttClientID + F("/") + name + F("/config");
@@ -159,7 +159,7 @@ class UsermodBME280 : public Usermod
}
void publishMqtt(const char *topic, const char* state) {
- //Check if MQTT Connected, otherwise it will crash the 8266
+ //Verificar if MQTT Connected, otherwise it will bloqueo the 8266
if (WLED_MQTT_CONNECTED){
char subuf[128];
snprintf_P(subuf, 127, PSTR("%s/%s"), mqttDeviceTopic, topic);
@@ -220,10 +220,10 @@ class UsermodBME280 : public Usermod
if (!enabled || strip.isUpdating()) return;
// BME280 sensor MQTT publishing
- // Check if sensor present and Connected, otherwise it will crash the MCU
+ // Verificar if sensor present and Connected, otherwise it will bloqueo the MCU
if (sensorType != 0)
{
- // Timer to fetch new temperature, humidity and pressure data at intervals
+ // Temporizador to obtener new temperature, humidity and pressure datos at intervals
timer = millis();
if (timer - lastTemperatureMeasure >= TemperatureInterval * 1000)
@@ -235,8 +235,8 @@ class UsermodBME280 : public Usermod
float temperature = roundf(sensorTemperature * powf(10, TemperatureDecimals)) / powf(10, TemperatureDecimals);
float humidity, heatIndex, dewPoint;
- // If temperature has changed since last measure, create string populated with device topic
- // from the UI and values read from sensor, then publish to broker
+ // If temperature has changed since last measure, crear cadena populated with dispositivo topic
+ // from the UI and values leer from sensor, then publish to broker
if (temperature != lastTemperature || PublishAlways)
{
publishMqtt("temperature", String(temperature, (unsigned) TemperatureDecimals).c_str());
@@ -297,7 +297,7 @@ class UsermodBME280 : public Usermod
}
/*
- * API calls te enable data exchange between WLED modules
+ * API calls te habilitar datos exchange between WLED modules
*/
inline float getTemperatureC() {
if (UseCelsius) {
@@ -355,7 +355,7 @@ class UsermodBME280 : public Usermod
}
}
- // Publish Sensor Information to Info Page
+ // Publish Sensor Information to Información Page
void addToJsonInfo(JsonObject &root)
{
JsonObject user = root[F("u")];
@@ -363,7 +363,7 @@ class UsermodBME280 : public Usermod
if (sensorType==0) //No Sensor
{
- // if we sensor not detected, let the user know
+ // if we sensor not detected, let the usuario know
JsonArray temperature_json = user.createNestedArray(F("BME/BMP280 Sensor"));
temperature_json.add(F("Not Found"));
}
@@ -397,7 +397,7 @@ class UsermodBME280 : public Usermod
return;
}
- // Save Usermod Config Settings
+ // Guardar Usermod Configuración Settings
void addToConfig(JsonObject& root)
{
JsonObject top = root.createNestedObject(FPSTR(_name));
@@ -414,11 +414,11 @@ class UsermodBME280 : public Usermod
DEBUG_PRINTLN(F("BME280 config saved."));
}
- // Read Usermod Config Settings
+ // Leer Usermod Configuración Settings
bool readFromConfig(JsonObject& root)
{
- // default settings values could be set here (or below using the 3-argument getJsonValue()) instead of in the class definition or constructor
- // setting them inside readFromConfig() is slightly more robust, handling the rare but plausible use case of single value being missing after boot (e.g. if the cfg.json was manually edited and a value was removed)
+ // default settings values could be set here (or below usando the 3-argumento getJsonValue()) instead of in the clase definition or constructor
+ // setting them inside readFromConfig() is slightly more robust, handling the rare but plausible use case of single valor being missing after boot (e.g. if the cfg.JSON was manually edited and a valor was removed)
JsonObject top = root[FPSTR(_name)];
if (top.isNull()) {
@@ -429,7 +429,7 @@ class UsermodBME280 : public Usermod
bool configComplete = !top.isNull();
configComplete &= getJsonValue(top[FPSTR(_enabled)], enabled);
- // A 3-argument getJsonValue() assigns the 3rd argument as a default value if the Json value is missing
+ // A 3-argumento getJsonValue() assigns the 3rd argumento as a default valor if the JSON valor is missing
uint8_t tmpI2cAddress;
configComplete &= getJsonValue(top[F("I2CAddress")], tmpI2cAddress, 0x76);
I2CAddress = static_cast(tmpI2cAddress);
@@ -445,13 +445,13 @@ class UsermodBME280 : public Usermod
DEBUG_PRINT(FPSTR(_name));
if (!initDone) {
- // first run: reading from cfg.json
+ // first run: reading from cfg.JSON
DEBUG_PRINTLN(F(" config loaded."));
} else {
// changing parameters from settings page
DEBUG_PRINTLN(F(" config (re)loaded."));
- // Reset all known values
+ // Restablecer all known values
sensorType = 0;
sensorTemperature = 0;
sensorHumidity = 0;
diff --git a/usermods/BME68X_v2/BME68X_v2.cpp b/usermods/BME68X_v2/BME68X_v2.cpp
index 63bada5af0..1804b0ab97 100644
--- a/usermods/BME68X_v2/BME68X_v2.cpp
+++ b/usermods/BME68X_v2/BME68X_v2.cpp
@@ -1,8 +1,8 @@
/**
- * @file usermod_BMW68X.cpp
+ * @archivo usermod_BMW68X.cpp
* @author Gabriel A. Sieben (GeoGab)
* @brief Usermod for WLED to implement the BME680/BME688 sensor
- * @version 1.0.2
+ * @versión 1.0.2
* @date 28 March 2025
*/
@@ -28,7 +28,7 @@
#define ESC_FGCOLOR_WHITE ESC_CSI "37m"
#define ESC_FGCOLOR_DEFAULT ESC_CSI "39m"
- /* Debug Print Special Text */
+ /* Depuración Imprimir Special Texto */
#define INFO_COLUMN ESC_CURSOR_COLUMN(60)
#define GOGAB_OK INFO_COLUMN "[" ESC_FGCOLOR_GREEN "OK" ESC_STYLE_RESET "]"
#define GOGAB_FAIL INFO_COLUMN "[" ESC_FGCOLOR_RED "FAIL" ESC_STYLE_RESET "]"
@@ -39,11 +39,11 @@
#include "wled.h"
#include
- /* UsermodBME68X class definition */
+ /* UsermodBME68X clase definition */
class UsermodBME68X : public Usermod {
public:
- /* Public: Functions */
+ /* Público: Functions */
uint16_t getId();
void loop(); // Loop of the user module called by wled main in loop
void setup(); // Setup of the user module called by wled main
@@ -52,7 +52,7 @@
bool readFromConfig(JsonObject& root); // Reads config values
void addToJsonInfo(JsonObject& root); // Adds user module info to the weld info page
- /* Wled internal functions which can be used by the core or other user mods */
+ /* WLED internal functions which can be used by the core or other usuario mods */
inline float getTemperature(); // Get Temperature in the selected scale of °C or °F
inline float getHumidity(); // ...
inline float getPressure();
@@ -73,7 +73,7 @@
inline bool getRunInStatus();
private:
- /* Private: Functions */
+ /* Privado: Functions */
void HomeAssistantDiscovery();
void MQTT_PublishHASensor(const String& name, const String& deviceClass, const String& unitOfMeasurement, const int8_t& digs, const uint8_t& option = 0);
void MQTT_publish(const char* topic, const float& value, const int8_t& dig);
@@ -86,7 +86,7 @@
void getValues();
/*** V A R I A B L E s & C O N S T A N T s ***/
- /* Private: Settings of Usermod BME68X */
+ /* Privado: Settings of Usermod BME68X */
struct settings_t {
bool enabled; // true if user module is active
byte I2cadress; // Depending on the manufacturer, the BME680 has the address 0x76 or 0x77
@@ -119,7 +119,7 @@
} decimals;
} settings;
- /* Private: Flags */
+ /* Privado: Flags */
struct flags_t {
bool InitSuccessful = false; // Initialation was un-/successful
bool MqttInitialized = false; // MQTT Initialation done flag (first MQTT Connect)
@@ -127,13 +127,13 @@
bool DeleteCaibration = false; // If set the calib file will be deleted on the next round
} flags;
- /* Private: Measurement timers */
+ /* Privado: Measurement timers */
struct timer_t {
long actual; // Actual time stamp
long lastRun; // Last measurement time stamp
} timer;
- /* Private: Various variables */
+ /* Privado: Various variables */
String stringbuff; // General string stringbuff buffer
char charbuffer[128]; // General char stringbuff buffer
String InfoPageStatusLine; // Shown on the info page of WLED
@@ -143,7 +143,7 @@
static const uint8_t bsec_config_iaq[]; // Calibration Buffer
Bsec iaqSensor; // Sensor variable
- /* Private: Sensor values */
+ /* Privado: Sensor values */
struct values_t {
float temperature; // Temp [°C] (Sensor-compensated)
float humidity; // Relative humidity [%] (Sensor-compensated)
@@ -171,7 +171,7 @@
} cvalues;
- /* Private: Sensor settings */
+ /* Privado: Sensor settings */
bsec_virtual_sensor_t sensorList[13] = {
BSEC_OUTPUT_IAQ, // Index for Air Quality estimate [0-500] Index for Air Quality (IAQ) gives an indication of the relative change in ambient TVOCs detected by BME680.
BSEC_OUTPUT_STATIC_IAQ, // Unscaled Index for Air Quality estimate
@@ -189,11 +189,11 @@
};
/*** V A R I A B L E s & C O N S T A N T s ***/
- /* Public: strings to reduce flash memory usage (used more than twice) */
+ /* Público: strings to reduce flash memoria usage (used more than twice) */
static const char _enabled[];
static const char _hadtopic[];
- /* Public: Settings Strings*/
+ /* Público: Settings Strings*/
static const char _nameI2CAdr[];
static const char _nameInterval[];
static const char _nameMaxAge[];
@@ -206,7 +206,7 @@
static const char _nameHADisc[];
static const char _nameDelCalib[];
- /* Public: Sensor names / Sensor short names */
+ /* Público: Sensor names / Sensor short names */
static const char _nameTemp[];
static const char _nameHum[];
static const char _namePress[];
@@ -231,7 +231,7 @@
static const char _nameStabStatus[];
static const char _nameRunInStatus[];
- /* Public: Sensor Units */
+ /* Público: Sensor Units */
static const char _unitTemp[];
static const char _unitHum[];
static const char _unitPress[];
@@ -250,7 +250,7 @@
}; // UsermodBME68X class definition End
/*** Setting C O N S T A N T S ***/
- /* Private: Settings Strings*/
+ /* Privado: Settings Strings*/
const char UsermodBME68X::_enabled[] PROGMEM = "Enabled";
const char UsermodBME68X::_hadtopic[] PROGMEM = "homeassistant/sensor/";
@@ -267,7 +267,7 @@
const char UsermodBME68X::_nameDelCalib[] PROGMEM = "Del Calibration Hist";
const char UsermodBME68X::_namePauseOnActWL[] PROGMEM = "Pause while WLED active";
- /* Private: Sensor names / Sensor short name */
+ /* Privado: Sensor names / Sensor short name */
const char UsermodBME68X::_nameTemp[] PROGMEM = "Temperature";
const char UsermodBME68X::_nameHum[] PROGMEM = "Humidity";
const char UsermodBME68X::_namePress[] PROGMEM = "Pressure";
@@ -289,7 +289,7 @@
const char UsermodBME68X::_nameStabStatus[] PROGMEM = "Stab-Status";
const char UsermodBME68X::_nameRunInStatus[] PROGMEM = "Run-In-Status";
- /* Private Units */
+ /* Privado Units */
const char UsermodBME68X::_unitTemp[] PROGMEM = " "; // NOTE - Is set with the selectable temperature unit
const char UsermodBME68X::_unitHum[] PROGMEM = "%";
const char UsermodBME68X::_unitPress[] PROGMEM = "hPa";
@@ -306,7 +306,7 @@
const char UsermodBME68X::_unitCelsius[] PROGMEM = "°C"; // Symbol for Celsius
const char UsermodBME68X::_unitFahrenheit[] PROGMEM = "°F"; // Symbol for Fahrenheit
- /* Load Sensor Settings */
+ /* Cargar Sensor Settings */
const uint8_t UsermodBME68X::bsec_config_iaq[] = {
#include "config/generic_33v_3s_28d/bsec_iaq.txt" // Allow 28 days for calibration because the WLED module normally stays in the same place anyway
};
@@ -317,12 +317,12 @@
/************************************************************************************************************/
/**
- * @brief Called by WLED: Setup of the usermod
+ * @brief Called by WLED: Configuración of the usermod
*/
void UsermodBME68X::setup() {
DEBUG_PRINTLN(F(UMOD_DEBUG_NAME ESC_FGCOLOR_CYAN "Initialize" ESC_STYLE_RESET));
- /* Check, if i2c is activated */
+ /* Verificar, if I2C is activated */
if (i2c_scl < 0 || i2c_sda < 0) {
settings.enabled = false; // Disable usermod once i2c is not running
DEBUG_PRINTLN(F(UMOD_DEBUG_NAME "I2C is not activated. Please activate I2C first." GOGAB_FAIL));
@@ -331,11 +331,11 @@
flags.InitSuccessful = true; // Will be set to false on need
- /* Set data structure pointers */
+ /* Set datos structure pointers */
ValuesPtr = &valuesA;
PrevValuesPtr = &valuesB;
- /* Init Library*/
+ /* Init Biblioteca*/
iaqSensor.begin(settings.I2cadress, Wire); // BME68X_I2C_ADDR_LOW
stringbuff = "BSEC library version " + String(iaqSensor.version.major) + "." + String(iaqSensor.version.minor) + "." + String(iaqSensor.version.major_bugfix) + "." + String(iaqSensor.version.minor_bugfix);
DEBUG_PRINT(F(UMOD_NAME));
@@ -353,7 +353,7 @@
}
/**
- * @brief Called by WLED: Main loop called by WLED
+ * @brief Called by WLED: Principal bucle called by WLED
*
*/
void UsermodBME68X::loop() {
@@ -435,11 +435,11 @@
if (settings.pubAcc) MQTT_publish(_nameGasPerAc, ValuesPtr->gasPercAccuracy, 0);
}
- /**** Publish Sensor State Entrys *****/
+ /**** Publish Sensor Estado Entrys *****/
if ((ValuesPtr->stabStatus != PrevValuesPtr->stabStatus || !settings.PublischChange) && settings.publishSensorState) MQTT_publish(_nameStabStatus, ValuesPtr->stabStatus, 0);
if ((ValuesPtr->runInStatus != PrevValuesPtr->runInStatus || !settings.PublischChange) && settings.publishSensorState) MQTT_publish(_nameRunInStatus, ValuesPtr->runInStatus, 0);
- /* Check accuracies - if accurasy level 3 is reached -> save calibration data */
+ /* Verificar accuracies - if accurasy nivel 3 is reached -> guardar calibration datos */
if ((ValuesPtr->iaqAccuracy != PrevValuesPtr->iaqAccuracy) && ValuesPtr->iaqAccuracy == 3) flags.SaveState = true; // Save after calibration / recalibration
if ((ValuesPtr->staticIaqAccuracy != PrevValuesPtr->staticIaqAccuracy) && ValuesPtr->staticIaqAccuracy == 3) flags.SaveState = true;
if ((ValuesPtr->co2Accuracy != PrevValuesPtr->co2Accuracy) && ValuesPtr->co2Accuracy == 3) flags.SaveState = true;
@@ -452,16 +452,16 @@
}
/**
- * @brief Retrieves the sensor data and truncates it to the requested decimal places
+ * @brief Retrieves the sensor datos and truncates it to the requested decimal places
*
*/
void UsermodBME68X::getValues() {
- /* Swap the point to the data structures */
+ /* Swap the point to the datos structures */
swap = PrevValuesPtr;
PrevValuesPtr = ValuesPtr;
ValuesPtr = swap;
- /* Float Values */
+ /* Flotante Values */
ValuesPtr->temperature = roundf(iaqSensor.temperature * powf(10, settings.decimals.temperature)) / powf(10, settings.decimals.temperature);
ValuesPtr->humidity = roundf(iaqSensor.humidity * powf(10, settings.decimals.humidity)) / powf(10, settings.decimals.humidity);
ValuesPtr->pressure = roundf(iaqSensor.pressure * powf(10, settings.decimals.pressure)) / powf(10, settings.decimals.pressure) /100; // Pa 2 hPa
@@ -472,7 +472,7 @@
ValuesPtr->Voc = roundf(iaqSensor.breathVocEquivalent * powf(10, settings.decimals.Voc)) / powf(10, settings.decimals.Voc);
ValuesPtr->gasPerc = roundf(iaqSensor.gasPercentage * powf(10, settings.decimals.gasPerc)) / powf(10, settings.decimals.gasPerc);
- /* Calculate Absolute Humidity [g/m³] */
+ /* Calculate Absoluto Humidity [g/m³] */
if (settings.decimals.absHumidity>-1) {
const float mw = 18.01534; // molar mass of water g/mol
const float r = 8.31447215; // Universal gas constant J/mol/K
@@ -483,13 +483,13 @@
ValuesPtr->drewPoint = (243.5 * (log( ValuesPtr->humidity / 100) + ((17.67 * ValuesPtr->temperature) / (243.5 + ValuesPtr->temperature))) / (17.67 - log(ValuesPtr->humidity / 100) - ((17.67 * ValuesPtr->temperature) / (243.5 + ValuesPtr->temperature))));
}
- /* Convert to Fahrenheit when selected */
+ /* Convertir to Fahrenheit when selected */
if (settings.tempScale) { // settings.tempScale = 0 => Celsius, = 1 => Fahrenheit
ValuesPtr->temperature = ValuesPtr->temperature * 1.8 + 32; // Value stored in Fahrenheit
ValuesPtr->drewPoint = ValuesPtr->drewPoint * 1.8 + 32;
}
- /* Integer Values */
+ /* Entero Values */
ValuesPtr->iaqAccuracy = iaqSensor.iaqAccuracy;
ValuesPtr->staticIaqAccuracy = iaqSensor.staticIaqAccuracy;
ValuesPtr->co2Accuracy = iaqSensor.co2Accuracy;
@@ -501,9 +501,9 @@
/**
- * @brief Sends the current sensor data via MQTT
- * @param topic Suptopic of the sensor as const char
- * @param value Current sensor value as float
+ * @brief Sends the current sensor datos via MQTT
+ * @param topic Suptopic of the sensor as constante char
+ * @param valor Current sensor valor as flotante
*/
void UsermodBME68X::MQTT_publish(const char* topic, const float& value, const int8_t& dig) {
if (dig<0) return;
@@ -514,7 +514,7 @@
}
/**
- * @brief Called by WLED: Initialize the MQTT parts when the connection to the MQTT server is established.
+ * @brief Called by WLED: Inicializar the MQTT parts when the conexión to the MQTT servidor is established.
* @param bool Session Present
*/
void UsermodBME68X::onMqttConnect(bool sessionPresent) {
@@ -529,7 +529,7 @@
/**
- * @brief MQTT initialization to generate the mqtt topic strings. This initialization also creates the HomeAssistat device configuration (HA Discovery), which home assinstant automatically evaluates to create a device.
+ * @brief MQTT initialization to generate the MQTT topic strings. This initialization also creates the HomeAssistat dispositivo configuration (HA Discovery), which home assinstant automatically evaluates to crear a dispositivo.
*/
void UsermodBME68X::HomeAssistantDiscovery() {
if (!settings.HomeAssistantDiscovery || !flags.InitSuccessful || !settings.enabled) return; // Leave once HomeAssistant Discovery is inactive
@@ -551,7 +551,7 @@
MQTT_PublishHASensor(_nameVoc, "VOLATILE_ORGANIC_COMPOUNDS", _unitVoc, settings.decimals.Voc ); // VOC
MQTT_PublishHASensor(_nameGasPer, "AQI", _unitGasPer, settings.decimals.gasPerc ); // Gas %
- /* Accuracys - switched off once publishAccuracy=0 or the main value is switched of by digs set to a negative number */
+ /* Accuracys - switched off once publishAccuracy=0 or the principal valor is switched of by digs set to a negative number */
MQTT_PublishHASensor(_nameIaqAc, "AQI", _unitNone, settings.pubAcc - 1 + settings.decimals.iaq * settings.pubAcc, 1); // Option 1: Diagnostics Sektion
MQTT_PublishHASensor(_nameStaticIaqAc, "", _unitNone, settings.pubAcc - 1 + settings.decimals.staticIaq * settings.pubAcc, 1);
MQTT_PublishHASensor(_nameCo2Ac, "", _unitNone, settings.pubAcc - 1 + settings.decimals.co2 * settings.pubAcc, 1);
@@ -565,15 +565,15 @@
}
/**
- * @brief These MQTT entries are responsible for the Home Assistant Discovery of the sensors. HA is shown here where to look for the sensor data. This entry therefore only needs to be sent once.
- * Important note: In order to find everything that is sent from this device to Home Assistant via MQTT under the same device name, the "device/identifiers" entry must be the same.
- * I use the MQTT device name here. If other user mods also use the HA Discovery, it is recommended to set the identifier the same. Otherwise you would have several devices,
- * even though it is one device. I therefore only use the MQTT client name set in WLED here.
+ * @brief These MQTT entries are responsible for the Home Assistant Discovery of the sensors. HA is shown here where to look for the sensor datos. This entry therefore only needs to be sent once.
+ * Important note: In order to encontrar everything that is sent from this dispositivo to Home Assistant via MQTT under the same dispositivo name, the "dispositivo/identifiers" entry must be the same.
+ * I use the MQTT dispositivo name here. If other usuario mods also use the HA Discovery, it is recommended to set the identifier the same. Otherwise you would have several devices,
+ * even though it is one dispositivo. I therefore only use the MQTT cliente name set in WLED here.
* @param name Name of the sensor
- * @param topic Topic of the live sensor data
- * @param unitOfMeasurement Unit of the measurment
+ * @param topic Topic of the live sensor datos
+ * @param unitOfMeasurement Unidad of the measurment
* @param digs Number of decimal places
- * @param option Set to true if the sensor is part of diagnostics (dafault 0)
+ * @param option Set to verdadero if the sensor is part of diagnostics (dafault 0)
*/
void UsermodBME68X::MQTT_PublishHASensor(const String& name, const String& deviceClass, const String& unitOfMeasurement, const int8_t& digs, const uint8_t& option) {
DEBUG_PRINT(UMOD_DEBUG_NAME "\t" + name);
@@ -582,15 +582,15 @@
String basetopic = String(_hadtopic) + mqttClientID + F("/") + name + F("/config"); // This is the place where Home Assinstant Discovery will check for new devices
if (digs < 0) { // if digs are set to -1 -> entry deactivated
- /* Delete MQTT Entry */
+ /* Eliminar MQTT Entry */
if (WLED_MQTT_CONNECTED) {
mqtt->publish(basetopic.c_str(), 0, true, ""); // Send emty entry to delete
DEBUG_PRINTLN(INFO_COLUMN "deleted");
}
} else {
- /* Create all the necessary HAD MQTT entrys - see: https://www.home-assistant.io/integrations/sensor.mqtt/#configuration-variables */
+ /* Crear all the necessary HAD MQTT entrys - see: https://www.home-assistant.io/integrations/sensor.MQTT/#configuration-variables */
DynamicJsonDocument jdoc(700); // json document
- // See: https://www.home-assistant.io/integrations/mqtt/
+ // See: https://www.home-assistant.io/integrations/MQTT/
JsonObject avail = jdoc.createNestedObject(F("avty")); // 'avty': 'availability'
avail[F("topic")] = mqttDeviceTopic + String("/status"); // An MQTT topic subscribed to receive availability (online/offline) updates.
avail[F("payload_available")] = "online";
@@ -626,18 +626,18 @@
}
/**
- * @brief Called by WLED: Publish Sensor Information to Info Page
- * @param JsonObject Pointer
+ * @brief Called by WLED: Publish Sensor Information to Información Page
+ * @param JsonObject Puntero
*/
void UsermodBME68X::addToJsonInfo(JsonObject& root) {
- //DEBUG_PRINTLN(F(UMOD_DEBUG_NAME "Add to info event"));
+ //DEBUG_PRINTLN(F(UMOD_DEBUG_NAME "Add to información evento"));
JsonObject user = root[F("u")];
if (user.isNull())
user = root.createNestedObject(F("u"));
if (!flags.InitSuccessful) {
- // Init was not seccessful - let the user know
+ // Init was not seccessful - let the usuario know
JsonArray temperature_json = user.createNestedArray(F("BME68X Sensor"));
temperature_json.add(F("not found"));
JsonArray humidity_json = user.createNestedArray(F("BMW68x Reason"));
@@ -678,12 +678,12 @@
}
/**
- * @brief Info Page helper function
+ * @brief Información Page helper función
* @param root JSON object
* @param name Name of the sensor as char
- * @param sensorvalue Value of the sensor as float
- * @param decimals Decimal places of the value
- * @param unit Unit of the sensor
+ * @param sensorvalue Valor of the sensor as flotante
+ * @param decimals Decimal places of the valor
+ * @param unit Unidad of the sensor
*/
void UsermodBME68X::InfoHelper(JsonObject& root, const char* name, const float& sensorvalue, const int8_t& decimals, const char* unit) {
if (decimals > -1) {
@@ -694,11 +694,11 @@
}
/**
- * @brief Info Page helper function (overload)
+ * @brief Información Page helper función (sobrecarga)
* @param root JSON object
* @param name Name of the sensor
- * @param sensorvalue Value of the sensor as string
- * @param status Status of the value (active/inactive)
+ * @param sensorvalue Valor of the sensor as cadena
+ * @param estado Estado of the valor (active/inactive)
*/
void UsermodBME68X::InfoHelper(JsonObject& root, const char* name, const String& sensorvalue, const bool& status) {
if (status) {
@@ -708,8 +708,8 @@
}
/**
- * @brief Called by WLED: Adds the usermodul neends on the config page for user modules
- * @param JsonObject Pointer
+ * @brief Called by WLED: Adds the usermodul neends on the config page for usuario modules
+ * @param JsonObject Puntero
*
* @see Usermod::addToConfig()
* @see UsermodManager::addToConfig()
@@ -756,9 +756,9 @@
* @see UsermodManager::appendConfigData()
*/
void UsermodBME68X::appendConfigData() {
- // snprintf_P(charbuffer, 127, PSTR("addInfo('%s:%s',1,'read interval [seconds]');"), UMOD_NAME, _nameInterval); oappend(charbuffer);
- // snprintf_P(charbuffer, 127, PSTR("addInfo('%s:%s',1,'only if value changes');"), UMOD_NAME, _namePublishChange); oappend(charbuffer);
- // snprintf_P(charbuffer, 127, PSTR("addInfo('%s:%s',1,'maximum age of a message in seconds');"), UMOD_NAME, _nameMaxAge); oappend(charbuffer);
+ // snprintf_P(charbuffer, 127, PSTR("addInfo('%s:%s',1,'leer intervalo [seconds]');"), UMOD_NAME, _nameInterval); oappend(charbuffer);
+ // snprintf_P(charbuffer, 127, PSTR("addInfo('%s:%s',1,'only if valor changes');"), UMOD_NAME, _namePublishChange); oappend(charbuffer);
+ // snprintf_P(charbuffer, 127, PSTR("addInfo('%s:%s',1,'maximum age of a mensaje in seconds');"), UMOD_NAME, _nameMaxAge); oappend(charbuffer);
// snprintf_P(charbuffer, 127, PSTR("addInfo('%s:%s',1,'Gas related values are only published after the gas sensor has been calibrated');"), UMOD_NAME, _namePubAfterCalib); oappend(charbuffer);
// snprintf_P(charbuffer, 127, PSTR("addInfo('%s:%s',1,'*) Set to minus to deactivate (all sensors)');"), UMOD_NAME, _nameTemp); oappend(charbuffer);
@@ -782,15 +782,15 @@
}
/**
- * @brief Called by WLED: Read Usermod Config Settings default settings values could be set here (or below using the 3-argument getJsonValue())
- * instead of in the class definition or constructor setting them inside readFromConfig() is slightly more robust, handling the rare but
- * plausible use case of single value being missing after boot (e.g. if the cfg.json was manually edited and a value was removed)
- * This is called whenever WLED boots and loads cfg.json, or when the UM config
- * page is saved. Will properly re-instantiate the SHT class upon type change and
+ * @brief Called by WLED: Leer Usermod Configuración Settings default settings values could be set here (or below usando the 3-argumento getJsonValue())
+ * instead of in the clase definition or constructor setting them inside readFromConfig() is slightly more robust, handling the rare but
+ * plausible use case of single valor being missing after boot (e.g. if the cfg.JSON was manually edited and a valor was removed)
+ * This is called whenever WLED boots and loads cfg.JSON, or when the UM config
+ * page is saved. Will properly re-instantiate the SHT clase upon tipo change and
* publish HA discovery after enabling.
- * NOTE: Here are the default settings of the user module
- * @param JsonObject Pointer
- * @return bool
+ * NOTE: Here are the default settings of the usuario módulo
+ * @param JsonObject Puntero
+ * @retorno bool
* @see Usermod::readFromConfig()
* @see UsermodManager::readFromConfig()
*/
@@ -856,9 +856,9 @@
}
/**
- * @brief Called by WLED: Retunrs the user modul id number
+ * @brief Called by WLED: Retunrs the usuario modul id number
*
- * @return uint16_t User module number
+ * @retorno uint16_t Usuario módulo number
*/
uint16_t UsermodBME68X::getId() {
return USERMOD_ID_BME68X;
@@ -866,8 +866,8 @@
/**
- * @brief Returns the current temperature in the scale which is choosen in settings
- * @return Temperature value (°C or °F as choosen in settings)
+ * @brief Returns the current temperature in the escala which is choosen in settings
+ * @retorno Temperature valor (°C or °F as choosen in settings)
*/
inline float UsermodBME68X::getTemperature() {
return ValuesPtr->temperature;
@@ -875,7 +875,7 @@
/**
* @brief Returns the current humidity
- * @return Humididty value (%)
+ * @retorno Humididty valor (%)
*/
inline float UsermodBME68X::getHumidity() {
return ValuesPtr->humidity;
@@ -883,7 +883,7 @@
/**
* @brief Returns the current pressure
- * @return Pressure value (hPa)
+ * @retorno Pressure valor (hPa)
*/
inline float UsermodBME68X::getPressure() {
return ValuesPtr->pressure;
@@ -891,15 +891,15 @@
/**
* @brief Returns the current gas resistance
- * @return Gas resistance value (kΩ)
+ * @retorno Gas resistance valor (kΩ)
*/
inline float UsermodBME68X::getGasResistance() {
return ValuesPtr->gasResistance;
}
/**
- * @brief Returns the current absolute humidity
- * @return Absolute humidity value (g/m³)
+ * @brief Returns the current absoluto humidity
+ * @retorno Absoluto humidity valor (g/m³)
*/
inline float UsermodBME68X::getAbsoluteHumidity() {
return ValuesPtr->absHumidity;
@@ -907,7 +907,7 @@
/**
* @brief Returns the current dew point
- * @return Dew point (°C or °F as choosen in settings)
+ * @retorno Dew point (°C or °F as choosen in settings)
*/
inline float UsermodBME68X::getDewPoint() {
return ValuesPtr->drewPoint;
@@ -915,15 +915,15 @@
/**
* @brief Returns the current iaq (Indoor Air Quallity)
- * @return Iaq value (0-500)
+ * @retorno Iaq valor (0-500)
*/
inline float UsermodBME68X::getIaq() {
return ValuesPtr->iaq;
}
/**
- * @brief Returns the current static iaq (Indoor Air Quallity) (NOTE: Static iaq is the better choice than iaq for fixed devices such as the wled module)
- * @return Static iaq value (float)
+ * @brief Returns the current estático iaq (Indoor Air Quallity) (NOTE: Estático iaq is the better choice than iaq for fixed devices such as the WLED módulo)
+ * @retorno Estático iaq valor (flotante)
*/
inline float UsermodBME68X::getStaticIaq() {
return ValuesPtr->staticIaq;
@@ -931,7 +931,7 @@
/**
* @brief Returns the current co2
- * @return Co2 value (ppm)
+ * @retorno Co2 valor (ppm)
*/
inline float UsermodBME68X::getCo2() {
return ValuesPtr->co2;
@@ -939,7 +939,7 @@
/**
* @brief Returns the current voc (Breath VOC concentration estimate [ppm])
- * @return Voc value (ppm)
+ * @retorno Voc valor (ppm)
*/
inline float UsermodBME68X::getVoc() {
return ValuesPtr->Voc;
@@ -947,7 +947,7 @@
/**
* @brief Returns the current gas percentage
- * @return Gas percentage value (%)
+ * @retorno Gas percentage valor (%)
*/
inline float UsermodBME68X::getGasPerc() {
return ValuesPtr->gasPerc;
@@ -955,15 +955,15 @@
/**
* @brief Returns the current iaq accuracy (0 = not calibrated, 2 = being calibrated, 3 = calibrated)
- * @return Iaq accuracy value (0-3)
+ * @retorno Iaq accuracy valor (0-3)
*/
inline uint8_t UsermodBME68X::getIaqAccuracy() {
return ValuesPtr->iaqAccuracy ;
}
/**
- * @brief Returns the current static iaq accuracy accuracy (0 = not calibrated, 2 = being calibrated, 3 = calibrated)
- * @return Static iaq accuracy value (0-3)
+ * @brief Returns the current estático iaq accuracy accuracy (0 = not calibrated, 2 = being calibrated, 3 = calibrated)
+ * @retorno Estático iaq accuracy valor (0-3)
*/
inline uint8_t UsermodBME68X::getStaticIaqAccuracy() {
return ValuesPtr->staticIaqAccuracy;
@@ -971,7 +971,7 @@
/**
* @brief Returns the current co2 accuracy (0 = not calibrated, 2 = being calibrated, 3 = calibrated)
- * @return Co2 accuracy value (0-3)
+ * @retorno Co2 accuracy valor (0-3)
*/
inline uint8_t UsermodBME68X::getCo2Accuracy() {
return ValuesPtr->co2Accuracy;
@@ -979,7 +979,7 @@
/**
* @brief Returns the current voc accuracy (0 = not calibrated, 2 = being calibrated, 3 = calibrated)
- * @return Voc accuracy value (0-3)
+ * @retorno Voc accuracy valor (0-3)
*/
inline uint8_t UsermodBME68X::getVocAccuracy() {
return ValuesPtr->VocAccuracy;
@@ -987,25 +987,25 @@
/**
* @brief Returns the current gas percentage accuracy (0 = not calibrated, 2 = being calibrated, 3 = calibrated)
- * @return Gas percentage accuracy value (0-3)
+ * @retorno Gas percentage accuracy valor (0-3)
*/
inline uint8_t UsermodBME68X::getGasPercAccuracy() {
return ValuesPtr->gasPercAccuracy;
}
/**
- * @brief Returns the current stab status.
- * Indicates when the sensor is ready after after switch-on
- * @return stab status value (0 = switched on / 1 = stabilized)
+ * @brief Returns the current stab estado.
+ * Indicates when the sensor is ready after after conmutador-on
+ * @retorno stab estado valor (0 = switched on / 1 = stabilized)
*/
inline bool UsermodBME68X::getStabStatus() {
return ValuesPtr->stabStatus;
}
/**
- * @brief Returns the current run in status.
+ * @brief Returns the current run in estado.
* Indicates if the sensor is undergoing initial stabilization during its first use after production
- * @return Tun status accuracy value (0 = switched on first time / 1 = stabilized)
+ * @retorno Tun estado accuracy valor (0 = switched on first time / 1 = stabilized)
*/
inline bool UsermodBME68X::getRunInStatus() {
return ValuesPtr->runInStatus;
@@ -1013,7 +1013,7 @@
/**
- * @brief Checks whether the library and the sensor are running.
+ * @brief Checks whether the biblioteca and the sensor are running.
*/
void UsermodBME68X::checkIaqSensorStatus() {
@@ -1053,7 +1053,7 @@
}
/**
- * @brief Loads the calibration data from the file system of the device
+ * @brief Loads the calibration datos from the archivo sistema of the dispositivo
*/
void UsermodBME68X::loadState() {
if (WLED_FS.exists(CALIB_FILE_NAME)) {
@@ -1075,7 +1075,7 @@
}
/**
- * @brief Saves the calibration data from the file system of the device
+ * @brief Saves the calibration datos from the archivo sistema of the dispositivo
*/
void UsermodBME68X::saveState() {
DEBUG_PRINT(F(UMOD_DEBUG_NAME "Write the calibration file "));
@@ -1093,7 +1093,7 @@
char contbuffer[30];
- /* Timestamp */
+ /* Marca de tiempo */
time_t curr_time;
tm* curr_tm;
time(&curr_time);
diff --git a/usermods/Battery/Battery.cpp b/usermods/Battery/Battery.cpp
index 5572f55024..1fcd0a4402 100644
--- a/usermods/Battery/Battery.cpp
+++ b/usermods/Battery/Battery.cpp
@@ -20,15 +20,15 @@ class UsermodBattery : public Usermod
UMBattery* bat = new UnkownUMBattery();
batteryConfig cfg;
- // Initial delay before first reading to allow voltage stabilization
+ // Initial retraso before first reading to allow voltage stabilization
unsigned long initialDelay = USERMOD_BATTERY_INITIAL_DELAY;
bool initialDelayComplete = false;
bool isFirstVoltageReading = true;
- // how often to read the battery voltage
+ // how often to leer the battery voltage
unsigned long readingInterval = USERMOD_BATTERY_MEASUREMENT_INTERVAL;
unsigned long nextReadTime = 0;
unsigned long lastReadTime = 0;
- // between 0 and 1, to control strength of voltage smoothing filter
+ // between 0 and 1, to control strength of voltage smoothing filtro
float alpha = USERMOD_BATTERY_AVERAGING_ALPHA;
// auto shutdown/shutoff/master off feature
@@ -50,7 +50,7 @@ class UsermodBattery : public Usermod
bool initializing = true;
bool HomeAssistantDiscovery = false;
- // strings to reduce flash memory usage (used more than twice)
+ // strings to reduce flash memoria usage (used more than twice)
static const char _name[];
static const char _readInterval[];
static const char _enabled[];
@@ -70,7 +70,7 @@ class UsermodBattery : public Usermod
}
/**
- * Helper for converting a string to lowercase
+ * Helper for converting a cadena to lowercase
*/
String stringToLower(String str)
{
@@ -113,15 +113,15 @@ class UsermodBattery : public Usermod
}
/**
- * read the battery voltage in different ways depending on the architecture
+ * leer the battery voltage in different ways depending on the arquitectura
*/
float readVoltage()
{
#ifdef ARDUINO_ARCH_ESP32
- // use calibrated millivolts analogread on esp32 (150 mV ~ 2450 mV default attentuation) and divide by 1000 to get from milivolts to volts and multiply by voltage multiplier and apply calibration value
+ // use calibrated millivolts analogread on esp32 (150 mV ~ 2450 mV default attentuation) and divide by 1000 to get from milivolts to volts and multiply by voltage multiplier and apply calibration valor
return (analogReadMilliVolts(batteryPin) / 1000.0f) * bat->getVoltageMultiplier() + bat->getCalibration();
#else
- // use analog read on esp8266 ( 0V ~ 1V no attenuation options) and divide by ADC precision 1023 and multiply by voltage multiplier and apply calibration value
+ // use analog leer on esp8266 ( 0V ~ 1V no attenuation options) and divide by ADC precisión 1023 and multiply by voltage multiplier and apply calibration valor
return (analogRead(batteryPin) / 1023.0f) * bat->getVoltageMultiplier() + bat->getCalibration();
#endif
}
@@ -179,19 +179,19 @@ class UsermodBattery : public Usermod
//Functions called by WLED
/**
- * setup() is called once at boot. WiFi is not yet connected at this point.
- * You can use it to initialize variables, sensors or similar.
+ * `configuración()` se llama una vez al arrancar. En este punto WiFi aún no está conectado.
+ * Úsalo para inicializar variables, sensores o similares.
*/
void setup()
{
- // plug in the right battery type
+ // plug in the right battery tipo
if(cfg.type == (batteryType)lipo) {
bat = new LipoUMBattery();
} else if(cfg.type == (batteryType)lion) {
bat = new LionUMBattery();
}
- // update the choosen battery type with configured values
+ // actualizar the choosen battery tipo with configured values
bat->update(cfg);
#ifdef ARDUINO_ARCH_ESP32
@@ -223,16 +223,16 @@ class UsermodBattery : public Usermod
/**
* connected() is called every time the WiFi is (re)connected
- * Use it to initialize network interfaces
+ * Use it to inicializar red interfaces
*/
void connected()
{
- //Serial.println("Connected to WiFi!");
+ //Serie.println("Connected to WiFi!");
}
/*
- * loop() is called continuously. Here you can check for events, read sensors, etc.
+ * bucle() is called continuously. Here you can verificar for events, leer sensors, etc.
*
*/
void loop()
@@ -241,26 +241,26 @@ class UsermodBattery : public Usermod
lowPowerIndicator();
- // Handling the initial delay
+ // Handling the initial retraso
if (!initialDelayComplete && millis() < nextReadTime)
return; // Continue to return until the initial delay is over
- // Once the initial delay is over, set it as complete
+ // Once the initial retraso is over, set it as complete
if (!initialDelayComplete)
{
initialDelayComplete = true;
- // Set the regular interval after initial delay
+ // Set the regular intervalo after initial retraso
nextReadTime = millis() + readingInterval;
}
- // Make the first voltage reading after the initial delay has elapsed
+ // Make the first voltage reading after the initial retraso has elapsed
if (isFirstVoltageReading)
{
bat->setVoltage(readVoltage());
isFirstVoltageReading = false;
}
- // check the battery level every USERMOD_BATTERY_MEASUREMENT_INTERVAL (ms)
+ // verificar the battery nivel every USERMOD_BATTERY_MEASUREMENT_INTERVAL (ms)
if (millis() < nextReadTime) return;
nextReadTime = millis() + readingInterval;
@@ -271,7 +271,7 @@ class UsermodBattery : public Usermod
initializing = false;
float rawValue = readVoltage();
- // filter with exponential smoothing because ADC in esp32 is fluctuating too much for a good single readout
+ // filtro with exponential smoothing because ADC in esp32 is fluctuating too much for a good single readout
float filteredVoltage = bat->getVoltage() + alpha * (rawValue - bat->getVoltage());
bat->setVoltage(filteredVoltage);
@@ -290,9 +290,9 @@ class UsermodBattery : public Usermod
}
/**
- * addToJsonInfo() can be used to add custom entries to the /json/info part of the JSON API.
- * Creating an "u" object allows you to add custom key/value pairs to the Info section of the WLED web UI.
- * Below it is shown how this could be used for e.g. a light sensor
+ * `addToJsonInfo()` puede usarse para añadir entradas personalizadas a /JSON/información de la API JSON.
+ * Crear un objeto "u" permite añadir pares clave/valor a la sección Información de la UI web de WLED.
+ * A continuación se muestra un ejemplo.
*/
void addToJsonInfo(JsonObject& root)
{
@@ -306,7 +306,7 @@ class UsermodBattery : public Usermod
return; // no GPIO - nothing to report
}
- // info modal display names
+ // información modal display names
JsonArray infoPercentage = user.createNestedArray(F("Battery level"));
JsonArray infoVoltage = user.createNestedArray(F("Battery voltage"));
JsonArray infoNextUpdate = user.createNestedArray(F("Next update"));
@@ -382,8 +382,8 @@ class UsermodBattery : public Usermod
}
/**
- * addToJsonState() can be used to add custom entries to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * addToJsonState() can be used to add custom entries to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
void addToJsonState(JsonObject& root)
{
@@ -399,57 +399,57 @@ class UsermodBattery : public Usermod
/**
- * readFromJsonState() can be used to receive data clients send to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * readFromJsonState() can be used to recibir datos clients enviar to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
/*
void readFromJsonState(JsonObject& root)
{
- if (!initDone) return; // prevent crash on boot applyPreset()
+ if (!initDone) retorno; // prevent bloqueo on boot applyPreset()
JsonObject battery = root[FPSTR(_name)];
if (!battery.isNull()) {
getUsermodConfigFromJsonObject(battery);
- DEBUG_PRINTLN(F("Battery state read from JSON API."));
+ DEBUG_PRINTLN(F("Battery estado leer from JSON API."));
}
}
*/
/**
- * addToConfig() can be used to add custom persistent settings to the cfg.json file in the "um" (usermod) object.
+ * addToConfig() can be used to add custom persistent settings to the cfg.JSON archivo in the "um" (usermod) object.
* It will be called by WLED when settings are actually saved (for example, LED settings are saved)
- * If you want to force saving the current state, use serializeConfig() in your loop().
+ * If you want to force saving the current estado, use serializeConfig() in your bucle().
*
- * CAUTION: serializeConfig() will initiate a filesystem write operation.
+ * CAUTION: serializeConfig() will initiate a filesystem escribir operation.
* It might cause the LEDs to stutter and will cause flash wear if called too often.
- * Use it sparingly and always in the loop, never in network callbacks!
+ * Use it sparingly and always in the bucle, never in red callbacks!
*
* addToConfig() will make your settings editable through the Usermod Settings page automatically.
*
* Usermod Settings Overview:
* - Numeric values are treated as floats in the browser.
- * - If the numeric value entered into the browser contains a decimal point, it will be parsed as a C float
- * before being returned to the Usermod. The float data type has only 6-7 decimal digits of precision, and
- * doubles are not supported, numbers will be rounded to the nearest float value when being parsed.
- * The range accepted by the input field is +/- 1.175494351e-38 to +/- 3.402823466e+38.
- * - If the numeric value entered into the browser doesn't contain a decimal point, it will be parsed as a
- * C int32_t (range: -2147483648 to 2147483647) before being returned to the usermod.
- * Overflows or underflows are truncated to the max/min value for an int32_t, and again truncated to the type
- * used in the Usermod when reading the value from ArduinoJson.
- * - Pin values can be treated differently from an integer value by using the key name "pin"
- * - "pin" can contain a single or array of integer values
+ * - If the numeric valor entered into the browser contains a decimal point, it will be parsed as a C flotante
+ * before being returned to the Usermod. The flotante datos tipo has only 6-7 decimal digits of precisión, and
+ * doubles are not supported, numbers will be rounded to the nearest flotante valor when being parsed.
+ * The rango accepted by the entrada campo is +/- 1.175494351e-38 to +/- 3.402823466e+38.
+ * - If the numeric valor entered into the browser doesn't contain a decimal point, it will be parsed as a
+ * C int32_t (rango: -2147483648 to 2147483647) before being returned to the usermod.
+ * Overflows or underflows are truncated to the max/min valor for an int32_t, and again truncated to the tipo
+ * used in the Usermod when reading the valor from ArduinoJson.
+ * - Pin values can be treated differently from an entero valor by usando the key name "pin"
+ * - "pin" can contain a single or matriz of entero values
* - On the Usermod Settings page there is simple checking for pin conflicts and warnings for special pins
- * - Red color indicates a conflict. Yellow color indicates a pin with a warning (e.g. an input-only pin)
- * - Tip: use int8_t to store the pin value in the Usermod, so a -1 value (pin not set) can be used
+ * - Red color indicates a conflicto. Yellow color indicates a pin with a advertencia (e.g. an entrada-only pin)
+ * - Tip: use int8_t to store the pin valor in the Usermod, so a -1 valor (pin not set) can be used
*
* See usermod_v2_auto_save.h for an example that saves Flash space by reusing ArduinoJson key name strings
*
* If you need a dedicated settings page with custom layout for your Usermod, that takes a lot more work.
- * You will have to add the setting to the HTML, xml.cpp and set.cpp manually.
- * See the WLED Soundreactive fork (code and wiki) for reference. https://github.com/atuline/WLED
+ * You will have to add the setting to the HTML, XML.cpp and set.cpp manually.
+ * See the WLED Soundreactive bifurcación (código and wiki) for reference. https://github.com/atuline/WLED
*
* I highly recommend checking out the basics of ArduinoJson serialization and deserialization in order to use custom settings!
*/
@@ -467,7 +467,7 @@ class UsermodBattery : public Usermod
addBatteryToJsonObject(battery, false);
- // read voltage in case calibration or voltage multiplier changed to see immediate effect
+ // leer voltage in case calibration or voltage multiplier changed to see immediate efecto
bat->setVoltage(readVoltage());
DEBUG_PRINTLN(F("Battery config saved."));
@@ -489,10 +489,10 @@ class UsermodBattery : public Usermod
oappend(F("addInfo('Battery:indicator:threshold',1,'%');")); // 46 Bytes
oappend(F("addInfo('Battery:indicator:duration',1,'s');")); // 45 Bytes
- // this option list would exeed the oappend() buffer
- // a list of all presets to select one from
+ // this option lista would exeed the oappend() búfer
+ // a lista of all presets to select one from
// oappend(F("bd=addDropdown('Battery:low-power-indicator', 'preset');"));
- // the loop generates: oappend(F("addOption(bd, 'preset name', preset id);"));
+ // the bucle generates: oappend(F("addOption(bd, 'preset name', preset id);"));
// for(int8_t i=1; i < 42; i++) {
// oappend(F("addOption(bd, 'Preset#"));
// oappendi(i);
@@ -504,19 +504,19 @@ class UsermodBattery : public Usermod
/**
- * readFromConfig() can be used to read back the custom settings you added with addToConfig().
+ * readFromConfig() can be used to leer back the custom settings you added with addToConfig().
* This is called by WLED when settings are loaded (currently this only happens immediately after boot, or after saving on the Usermod Settings page)
*
- * readFromConfig() is called BEFORE setup(). This means you can use your persistent values in setup() (e.g. pin assignments, buffer sizes),
- * but also that if you want to write persistent values to a dynamic buffer, you'd need to allocate it here instead of in setup.
+ * readFromConfig() is called BEFORE configuración(). This means you can use your persistent values in configuración() (e.g. pin assignments, búfer sizes),
+ * but also that if you want to escribir persistent values to a dynamic búfer, you'd need to allocate it here instead of in configuración.
* If you don't know what that is, don't fret. It most likely doesn't affect your use case :)
*
- * Return true in case the config values returned from Usermod Settings were complete, or false if you'd like WLED to save your defaults to disk (so any missing values are editable in Usermod Settings)
+ * Retorno verdadero in case the config values returned from Usermod Settings were complete, or falso if you'd like WLED to guardar your defaults to disk (so any missing values are editable in Usermod Settings)
*
- * getJsonValue() returns false if the value is missing, or copies the value into the variable provided and returns true if the value is present
- * The configComplete variable is true only if the "exampleUsermod" object and all values are present. If any values are missing, WLED will know to call addToConfig() to save them
+ * getJsonValue() returns falso if the valor is missing, or copies the valor into the variable provided and returns verdadero if the valor is present
+ * The configComplete variable is verdadero only if the "exampleUsermod" object and all values are present. If any values are missing, WLED will know to call addToConfig() to guardar them
*
- * This function is guaranteed to be called on boot, but could also be called every time settings are updated
+ * This función is guaranteed to be called on boot, but could also be called every time settings are updated
*/
bool readFromConfig(JsonObject& root)
{
@@ -547,7 +547,7 @@ class UsermodBattery : public Usermod
#ifdef ARDUINO_ARCH_ESP32
if (!initDone)
{
- // first run: reading from cfg.json
+ // first run: reading from cfg.JSON
batteryPin = newBatteryPin;
DEBUG_PRINTLN(F(" config loaded."));
}
@@ -591,13 +591,13 @@ class UsermodBattery : public Usermod
/*
*
- * Getter and Setter. Just in case some other usermod wants to interact with this in the future
+ * Getter and Setter. Just in case some other usermod wants to interact with this in the futuro
*
*/
/**
- * getId() allows you to optionally give your V2 usermod an unique ID (please define it in const.h!).
- * This could be used in the future for the system to determine whether your usermod is installed.
+ * getId() allows you to optionally give your V2 usermod an unique ID (please definir it in constante.h!).
+ * This could be used in the futuro for the sistema to determine whether your usermod is installed.
*/
uint16_t getId()
{
@@ -605,7 +605,7 @@ class UsermodBattery : public Usermod
}
/**
- * get currently active battery type
+ * get currently active battery tipo
*/
batteryType getBatteryType()
{
@@ -665,7 +665,7 @@ class UsermodBattery : public Usermod
/**
* Get the calculated voltage
- * formula: (adc pin value / adc precision * max voltage) + calibration
+ * formula: (adc pin valor / adc precisión * max voltage) + calibration
*/
float getVoltage()
{
@@ -673,8 +673,8 @@ class UsermodBattery : public Usermod
}
/**
- * Get the mapped battery level (0 - 100) based on voltage
- * important: voltage can drop when a load is applied, so its only an estimate
+ * Get the mapped battery nivel (0 - 100) based on voltage
+ * important: voltage can drop when a carga is applied, so its only an estimate
*/
int8_t getBatteryLevel()
{
@@ -682,8 +682,8 @@ class UsermodBattery : public Usermod
}
/**
- * Get the configured calibration value
- * a offset value to fine-tune the calculated voltage.
+ * Get the configured calibration valor
+ * a desplazamiento valor to fine-tune the calculated voltage.
*/
float getCalibration()
{
@@ -691,8 +691,8 @@ class UsermodBattery : public Usermod
}
/**
- * Set the voltage calibration offset value
- * a offset value to fine-tune the calculated voltage.
+ * Set the voltage calibration desplazamiento valor
+ * a desplazamiento valor to fine-tune the calculated voltage.
*/
void setCalibration(float offset)
{
@@ -700,7 +700,7 @@ class UsermodBattery : public Usermod
}
/**
- * Set the voltage multiplier value
+ * Set the voltage multiplier valor
* A multiplier that may need adjusting for different voltage divider setups
*/
void setVoltageMultiplier(float multiplier)
@@ -709,7 +709,7 @@ class UsermodBattery : public Usermod
}
/*
- * Get the voltage multiplier value
+ * Get the voltage multiplier valor
* A multiplier that may need adjusting for different voltage divider setups
*/
float getVoltageMultiplier()
@@ -718,8 +718,8 @@ class UsermodBattery : public Usermod
}
/**
- * Get auto-off feature enabled status
- * is auto-off enabled, true/false
+ * Get auto-off feature enabled estado
+ * is auto-off enabled, verdadero/falso
*/
bool getAutoOffEnabled()
{
@@ -727,7 +727,7 @@ class UsermodBattery : public Usermod
}
/**
- * Set auto-off feature status
+ * Set auto-off feature estado
*/
void setAutoOffEnabled(bool enabled)
{
@@ -735,7 +735,7 @@ class UsermodBattery : public Usermod
}
/**
- * Get auto-off threshold in percent (0-100)
+ * Get auto-off umbral in percent (0-100)
*/
int8_t getAutoOffThreshold()
{
@@ -743,18 +743,18 @@ class UsermodBattery : public Usermod
}
/**
- * Set auto-off threshold in percent (0-100)
+ * Set auto-off umbral in percent (0-100)
*/
void setAutoOffThreshold(int8_t threshold)
{
autoOffThreshold = min((int8_t)100, max((int8_t)0, threshold));
- // when low power indicator is enabled the auto-off threshold cannot be above indicator threshold
+ // when low power indicator is enabled the auto-off umbral cannot be above indicator umbral
autoOffThreshold = lowPowerIndicatorEnabled /*&& autoOffEnabled*/ ? min(lowPowerIndicatorThreshold-1, (int)autoOffThreshold) : autoOffThreshold;
}
/**
- * Get low-power-indicator feature enabled status
- * is the low-power-indicator enabled, true/false
+ * Get low-power-indicator feature enabled estado
+ * is the low-power-indicator enabled, verdadero/falso
*/
bool getLowPowerIndicatorEnabled()
{
@@ -762,7 +762,7 @@ class UsermodBattery : public Usermod
}
/**
- * Set low-power-indicator feature status
+ * Set low-power-indicator feature estado
*/
void setLowPowerIndicatorEnabled(bool enabled)
{
@@ -782,13 +782,13 @@ class UsermodBattery : public Usermod
*/
void setLowPowerIndicatorPreset(int8_t presetId)
{
- // String tmp = ""; For what ever reason this doesn't work :(
+ // Cadena tmp = ""; For what ever reason this doesn't work :(
// lowPowerIndicatorPreset = getPresetName(presetId, tmp) ? presetId : lowPowerIndicatorPreset;
lowPowerIndicatorPreset = presetId;
}
/*
- * Get low-power-indicator threshold in percent (0-100)
+ * Get low-power-indicator umbral in percent (0-100)
*/
int8_t getLowPowerIndicatorThreshold()
{
@@ -796,17 +796,17 @@ class UsermodBattery : public Usermod
}
/**
- * Set low-power-indicator threshold in percent (0-100)
+ * Set low-power-indicator umbral in percent (0-100)
*/
void setLowPowerIndicatorThreshold(int8_t threshold)
{
lowPowerIndicatorThreshold = threshold;
- // when auto-off is enabled the indicator threshold cannot be below auto-off threshold
+ // when auto-off is enabled the indicator umbral cannot be below auto-off umbral
lowPowerIndicatorThreshold = autoOffEnabled /*&& lowPowerIndicatorEnabled*/ ? max(autoOffThreshold+1, (int)lowPowerIndicatorThreshold) : max(5, (int)lowPowerIndicatorThreshold);
}
/**
- * Get low-power-indicator duration in seconds
+ * Get low-power-indicator duración in seconds
*/
int8_t getLowPowerIndicatorDuration()
{
@@ -814,7 +814,7 @@ class UsermodBattery : public Usermod
}
/**
- * Set low-power-indicator duration in seconds
+ * Set low-power-indicator duración in seconds
*/
void setLowPowerIndicatorDuration(int8_t duration)
{
@@ -822,7 +822,7 @@ class UsermodBattery : public Usermod
}
/**
- * Get low-power-indicator status when the indication is done this returns true
+ * Get low-power-indicator estado when the indication is done this returns verdadero
*/
bool getLowPowerIndicatorDone()
{
@@ -846,7 +846,7 @@ class UsermodBattery : public Usermod
}
};
-// strings to reduce flash memory usage (used more than twice)
+// strings to reduce flash memoria usage (used more than twice)
const char UsermodBattery::_name[] PROGMEM = "Battery";
const char UsermodBattery::_readInterval[] PROGMEM = "interval";
const char UsermodBattery::_enabled[] PROGMEM = "enabled";
diff --git a/usermods/Battery/UMBattery.h b/usermods/Battery/UMBattery.h
index 8a8ad891e6..a374739b08 100644
--- a/usermods/Battery/UMBattery.h
+++ b/usermods/Battery/UMBattery.h
@@ -4,7 +4,7 @@
#include "battery_defaults.h"
/**
- * Battery base class
+ * Battery base clase
* all other battery classes should inherit from this
*/
class UMBattery
@@ -42,12 +42,12 @@ class UMBattery
/**
* Corresponding battery curves
- * calculates the level in % (0-100) with given voltage and possible voltage range
+ * calculates the nivel in % (0-100) with given voltage and possible voltage rango
*/
virtual float mapVoltage(float v, float min, float max) = 0;
// {
- // example implementation, linear mapping
- // return (v-min) * 100 / (max-min);
+ // example implementación, linear mapping
+ // retorno (v-min) * 100 / (max-min);
// };
virtual void calculateAndSetLevel(float voltage) = 0;
@@ -100,7 +100,7 @@ class UMBattery
}
/**
- * check if voltage is within specified voltage range, allow 10% over/under voltage
+ * verificar if voltage is within specified voltage rango, allow 10% over/under voltage
*/
void setVoltage(float voltage)
{
@@ -121,8 +121,8 @@ class UMBattery
}
/*
- * Get the configured calibration value
- * a offset value to fine-tune the calculated voltage.
+ * Get the configured calibration valor
+ * a desplazamiento valor to fine-tune the calculated voltage.
*/
virtual float getCalibration()
{
@@ -130,8 +130,8 @@ class UMBattery
}
/*
- * Set the voltage calibration offset value
- * a offset value to fine-tune the calculated voltage.
+ * Set the voltage calibration desplazamiento valor
+ * a desplazamiento valor to fine-tune the calculated voltage.
*/
virtual void setCalibration(float offset)
{
@@ -139,8 +139,8 @@ class UMBattery
}
/*
- * Get the configured calibration value
- * a value to set the voltage divider ratio
+ * Get the configured calibration valor
+ * a valor to set the voltage divider ratio
*/
virtual float getVoltageMultiplier()
{
@@ -148,8 +148,8 @@ class UMBattery
}
/*
- * Set the voltage multiplier value
- * a value to set the voltage divider ratio.
+ * Set the voltage multiplier valor
+ * a valor to set the voltage divider ratio.
*/
virtual void setVoltageMultiplier(float multiplier)
{
diff --git a/usermods/Battery/battery_defaults.h b/usermods/Battery/battery_defaults.h
index ddbd114e40..77c8bdcd90 100644
--- a/usermods/Battery/battery_defaults.h
+++ b/usermods/Battery/battery_defaults.h
@@ -5,7 +5,7 @@
// pin defaults
// for the esp32 it is best to use the ADC1: GPIO32 - GPIO39
-// https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/adc.html
+// https://docs.espressif.com/projects/esp-idf/en/latest/esp32/API-reference/peripherals/adc.HTML
#ifndef USERMOD_BATTERY_MEASUREMENT_PIN
#ifdef ARDUINO_ARCH_ESP32
#define USERMOD_BATTERY_MEASUREMENT_PIN 35
@@ -14,19 +14,19 @@
#endif
#endif
-// The initial delay before the first battery voltage reading after power-on.
+// The initial retraso before the first battery voltage reading after power-on.
// This allows the voltage to stabilize before readings are taken, improving accuracy of initial reading.
#ifndef USERMOD_BATTERY_INITIAL_DELAY
#define USERMOD_BATTERY_INITIAL_DELAY 10000 // (milliseconds)
#endif
-// the frequency to check the battery, 30 sec
+// the frecuencia to verificar the battery, 30 sec
#ifndef USERMOD_BATTERY_MEASUREMENT_INTERVAL
#define USERMOD_BATTERY_MEASUREMENT_INTERVAL 30000
#endif
-/* Default Battery Type
+/* Predeterminado Battery Tipo
* 0 = unkown
* 1 = Lipo
* 2 = Lion
@@ -40,7 +40,7 @@
*
*/
#ifndef USERMOD_BATTERY_UNKOWN_MIN_VOLTAGE
- // Extra save defaults
+ // Extra guardar defaults
#define USERMOD_BATTERY_UNKOWN_MIN_VOLTAGE 3.3f
#endif
#ifndef USERMOD_BATTERY_UNKOWN_MAX_VOLTAGE
@@ -86,7 +86,7 @@
#define USERMOD_BATTERY_AVERAGING_ALPHA 0.1f
#endif
-// offset or calibration value to fine tune the calculated voltage
+// desplazamiento or calibration valor to fine tune the calculated voltage
#ifndef USERMOD_BATTERY_CALIBRATION
#define USERMOD_BATTERY_CALIBRATION 0
#endif
diff --git a/usermods/Battery/types/UnkownUMBattery.h b/usermods/Battery/types/UnkownUMBattery.h
index ede5ffd887..d607110eb9 100644
--- a/usermods/Battery/types/UnkownUMBattery.h
+++ b/usermods/Battery/types/UnkownUMBattery.h
@@ -5,7 +5,7 @@
#include "../UMBattery.h"
/**
- * Unkown / Default Battery
+ * Unkown / Predeterminado Battery
*
*/
class UnkownUMBattery : public UMBattery
diff --git a/usermods/Cronixie/Cronixie.cpp b/usermods/Cronixie/Cronixie.cpp
index e0a3bbee7a..362d5ef729 100644
--- a/usermods/Cronixie/Cronixie.cpp
+++ b/usermods/Cronixie/Cronixie.cpp
@@ -7,7 +7,7 @@ class UsermodCronixie : public Usermod {
byte _digitOut[6] = {10,10,10,10,10,10};
byte dP[6] = {255, 255, 255, 255, 255, 255};
- // set your config variables to their boot default value (this can also be done in readFromConfig() or a constructor if you prefer)
+ // set your config variables to their boot default valor (this can also be done in readFromConfig() or a constructor if you prefer)
bool backlight = true;
public:
@@ -50,7 +50,7 @@ class UsermodCronixie : public Usermod {
void setCronixie()
{
/*
- * digit purpose index
+ * digit purpose índice
* 0-9 | 0-9 (incl. random)
* 10 | blank
* 11 | blank, bg off
@@ -124,8 +124,8 @@ class UsermodCronixie : public Usermod {
case '-': dP[i] = 11; break;
case 'r': dP[i] = random(1,7); break; //random btw. 1-6
case 'R': dP[i] = random(0,10); break; //random btw. 0-9
- //case 't': break; //Test upw.
- //case 'T': break; //Test dnw.
+ //case 't': ruptura; //Prueba upw.
+ //case 'T': ruptura; //Prueba dnw.
case 'b': dP[i] = 14 + getSameCodeLength('b',i,cronixieDisplay); i = i+dP[i]-14; break;
case 'B': dP[i] = 14 + getSameCodeLength('B',i,cronixieDisplay); i = i+dP[i]-14; break;
case 'h': dP[i] = 70 + getSameCodeLength('h',i,cronixieDisplay); i = i+dP[i]-70; break;
@@ -140,8 +140,8 @@ class UsermodCronixie : public Usermod {
case 'y': dP[i] = 86 + getSameCodeLength('y',i,cronixieDisplay); i = i+dP[i]-86; break;
case 'I': dP[i] = 39 + getSameCodeLength('I',i,cronixieDisplay); i = i+dP[i]-39; break; //Month. Don't ask me why month and minute both start with M.
case 'i': dP[i] = 89 + getSameCodeLength('i',i,cronixieDisplay); i = i+dP[i]-89; break;
- //case 'W': break;
- //case 'w': break;
+ //case 'W': ruptura;
+ //case 'w': ruptura;
case 'D': dP[i] = 43 + getSameCodeLength('D',i,cronixieDisplay); i = i+dP[i]-43; break;
case 'd': dP[i] = 93 + getSameCodeLength('d',i,cronixieDisplay); i = i+dP[i]-93; break;
case '0': dP[i] = 0; break;
@@ -154,8 +154,8 @@ class UsermodCronixie : public Usermod {
case '7': dP[i] = 7; break;
case '8': dP[i] = 8; break;
case '9': dP[i] = 9; break;
- //case 'V': break; //user var0
- //case 'v': break; //user var1
+ //case 'V': ruptura; //usuario var0
+ //case 'v': ruptura; //usuario var1
}
}
DEBUG_PRINT(F("result "));
@@ -281,8 +281,8 @@ class UsermodCronixie : public Usermod {
bool readFromConfig(JsonObject& root)
{
- // default settings values could be set here (or below using the 3-argument getJsonValue()) instead of in the class definition or constructor
- // setting them inside readFromConfig() is slightly more robust, handling the rare but plausible use case of single value being missing after boot (e.g. if the cfg.json was manually edited and a value was removed)
+ // default settings values could be set here (or below usando the 3-argumento getJsonValue()) instead of in the clase definition or constructor
+ // setting them inside readFromConfig() is slightly more robust, handling the rare but plausible use case of single valor being missing after boot (e.g. if the cfg.JSON was manually edited and a valor was removed)
JsonObject top = root[F("Cronixie")];
diff --git a/usermods/DHT/DHT.cpp b/usermods/DHT/DHT.cpp
index 2ed3dd0ace..f26745b77d 100644
--- a/usermods/DHT/DHT.cpp
+++ b/usermods/DHT/DHT.cpp
@@ -22,14 +22,14 @@
#define DHTTYPE DHT_TYPE_22
#endif
-// Connect pin 1 (on the left) of the sensor to +5V
-// NOTE: If using a board with 3.3V logic like an Arduino Due connect pin 1
+// Conectar pin 1 (on the left) of the sensor to +5V
+// NOTE: If usando a board with 3.3V logic like an Arduino Due conectar pin 1
// to 3.3V instead of 5V!
-// Connect pin 2 of the sensor to whatever your DHTPIN is
+// Conectar pin 2 of the sensor to whatever your DHTPIN is
// NOTE: Pin defaults below are for QuinLed Dig-Uno's Q2 on the board
-// Connect pin 4 (on the right) of the sensor to GROUND
-// NOTE: If using a bare sensor (AM*), Connect a 10K resistor from pin 2
-// (data) to pin 1 (power) of the sensor. DHT* boards have the pullup already
+// Conectar pin 4 (on the right) of the sensor to GROUND
+// NOTE: If usando a bare sensor (AM*), Conectar a 10K resistor from pin 2
+// (datos) to pin 1 (power) of the sensor. DHT* boards have the pullup already
#ifdef USERMOD_DHT_PIN
#define DHTPIN USERMOD_DHT_PIN
@@ -41,13 +41,13 @@
#endif
#endif
-// the frequency to check sensor, 1 minute
+// the frecuencia to verificar sensor, 1 minute
#ifndef USERMOD_DHT_MEASUREMENT_INTERVAL
#define USERMOD_DHT_MEASUREMENT_INTERVAL 60000
#endif
// how many seconds after boot to take first measurement, 90 seconds
-// 90 gives enough time to OTA update firmware if this crashes
+// 90 gives enough time to OTA actualizar firmware if this crashes
#ifndef USERMOD_DHT_FIRST_MEASUREMENT_AT
#define USERMOD_DHT_FIRST_MEASUREMENT_AT 90000
#endif
@@ -121,7 +121,7 @@ class UsermodDHT : public Usermod {
#endif
#ifdef USERMOD_DHT_MQTT
- // 10^n where n is number of decimal places to display in mqtt message. Please adjust buff size together with this constant
+ // 10^n where n is number of decimal places to display in MQTT mensaje. Please adjust buff tamaño together with this constante
#define FLOAT_PREC 100
if (WLED_MQTT_CONNECTED) {
char buff[10];
@@ -217,7 +217,7 @@ class UsermodDHT : public Usermod {
#endif
if (initializing) {
- // if we haven't read the sensor yet, let the user know
+ // if we haven't leer the sensor yet, let the usuario know
// that we are still waiting for the first measurement
temp.add((nextReadTime - millis()) / 1000);
temp.add(" sec until read");
diff --git a/usermods/EXAMPLE/readme.md b/usermods/EXAMPLE/readme.md
index ee8a2282a0..b874e040e9 100644
--- a/usermods/EXAMPLE/readme.md
+++ b/usermods/EXAMPLE/readme.md
@@ -1,9 +1,9 @@
-# Usermods API v2 example usermod
+# Usermod de ejemplo API v2
-In this usermod file you can find the documentation on how to take advantage of the new version 2 usermods!
+En este archivo de usermod puedes encontrar documentación sobre cómo aprovechar los nuevos usermods versión 2!
-## Installation
+## Instalación
-Add `EXAMPLE` to `custom_usermods` in your PlatformIO environment and compile!
-_(You shouldn't need to actually install this, it does nothing useful)_
+¡Agrega `EXAMPLE` a `custom_usermods` en tu entorno PlatformIO y compila!
+_(No deberías necesitar instalar esto realmente, no hace nada útil)_
diff --git a/usermods/EXAMPLE/usermod_v2_example.cpp b/usermods/EXAMPLE/usermod_v2_example.cpp
index 02e399fe08..1e0b83d0c8 100644
--- a/usermods/EXAMPLE/usermod_v2_example.cpp
+++ b/usermods/EXAMPLE/usermod_v2_example.cpp
@@ -2,33 +2,33 @@
/*
* Usermods allow you to add own functionality to WLED more easily
- * See: https://github.com/wled-dev/WLED/wiki/Add-own-functionality
+ * See: https://github.com/WLED-dev/WLED/wiki/Add-own-functionality
*
* This is an example for a v2 usermod.
- * v2 usermods are class inheritance based and can (but don't have to) implement more functions, each of them is shown in this example.
+ * v2 usermods are clase herencia based and can (but don't have to) implement more functions, each of them is shown in this example.
* Multiple v2 usermods can be added to one compilation easily.
*
* Creating a usermod:
- * This file serves as an example. If you want to create a usermod, it is recommended to use usermod_v2_empty.h from the usermods folder as a template.
- * Please remember to rename the class and file to a descriptive name.
+ * This archivo serves as an example. If you want to crear a usermod, it is recommended to use usermod_v2_empty.h from the usermods carpeta as a plantilla.
+ * Please remember to rename the clase and archivo to a descriptive name.
* You may also use multiple .h and .cpp files.
*
- * Using a usermod:
- * 1. Copy the usermod into the sketch folder (same folder as wled00.ino)
- * 2. Register the usermod by adding #include "usermod_filename.h" in the top and registerUsermod(new MyUsermodClass()) in the bottom of usermods_list.cpp
+ * Usando a usermod:
+ * 1. Copy the usermod into the sketch carpeta (same carpeta as wled00.ino)
+ * 2. Register the usermod by adding #incluir "usermod_filename.h" in the top and registerUsermod(new MyUsermodClass()) in the bottom of usermods_list.cpp
*/
-//class name. Use something descriptive and leave the ": public Usermod" part :)
+//clase name. Use something descriptive and leave the ": public Usermod" part :)
class MyExampleUsermod : public Usermod {
private:
- // Private class members. You can declare variables and functions only accessible to your usermod here
+ // Privado clase members. You can declare variables and functions only accessible to your usermod here
bool enabled = false;
bool initDone = false;
unsigned long lastTime = 0;
- // set your config variables to their boot default value (this can also be done in readFromConfig() or a constructor if you prefer)
+ // set your config variables to their boot default valor (this can also be done in readFromConfig() or a constructor if you prefer)
bool testBool = false;
unsigned long testULong = 42424242;
float testFloat = 42.42;
@@ -39,109 +39,109 @@ class MyExampleUsermod : public Usermod {
long testLong;
int8_t testPins[2];
- // string that are used multiple time (this will save some flash memory)
+ // cadena that are used multiple time (this will guardar some flash memoria)
static const char _name[];
static const char _enabled[];
- // any private methods should go here (non-inline method should be defined out of class)
+ // any private methods should go here (non-en línea método should be defined out of clase)
void publishMqtt(const char* state, bool retain = false); // example for publishing MQTT message
public:
- // non WLED related methods, may be used for data exchange between usermods (non-inline methods should be defined out of class)
+ // non WLED related methods, may be used for datos exchange between usermods (non-en línea methods should be defined out of clase)
/**
- * Enable/Disable the usermod
+ * Habilitar/Deshabilitar the usermod
*/
inline void enable(bool enable) { enabled = enable; }
/**
- * Get usermod enabled/disabled state
+ * Get usermod enabled/disabled estado
*/
inline bool isEnabled() { return enabled; }
// in such case add the following to another usermod:
// in private vars:
- // #ifdef USERMOD_EXAMPLE
+ // #si está definido USERMOD_EXAMPLE
// MyExampleUsermod* UM;
- // #endif
- // in setup()
- // #ifdef USERMOD_EXAMPLE
+ // #fin si
+ // in configuración()
+ // #si está definido USERMOD_EXAMPLE
// UM = (MyExampleUsermod*) UsermodManager::lookup(USERMOD_ID_EXAMPLE);
- // #endif
- // somewhere in loop() or other member method
- // #ifdef USERMOD_EXAMPLE
+ // #fin si
+ // somewhere in bucle() or other miembro método
+ // #si está definido USERMOD_EXAMPLE
// if (UM != nullptr) isExampleEnabled = UM->isEnabled();
- // if (!isExampleEnabled) UM->enable(true);
- // #endif
+ // if (!isExampleEnabled) UM->habilitar(verdadero);
+ // #fin si
- // methods called by WLED (can be inlined as they are called only once but if you call them explicitly define them out of class)
+ // methods called by WLED (can be inlined as they are called only once but if you call them explicitly definir them out of clase)
/*
- * setup() is called once at boot. WiFi is not yet connected at this point.
- * readFromConfig() is called prior to setup()
- * You can use it to initialize variables, sensors or similar.
+ * `configuración()` se llama una vez al arrancar. En este punto WiFi aún no está conectado.
+ * `readFromConfig()` se llama antes de `configuración()`.
+ * Úsalo para inicializar variables, sensores o similares.
*/
void setup() override {
// do your set-up here
- //Serial.println("Hello from my usermod!");
+ //Serie.println("Hello from my usermod!");
initDone = true;
}
/*
- * connected() is called every time the WiFi is (re)connected
- * Use it to initialize network interfaces
+ * `connected()` se llama cada vez que el WiFi se (re)conecta.
+ * Úsalo para inicializar interfaces de red.
*/
void connected() override {
- //Serial.println("Connected to WiFi!");
+ //Serie.println("Connected to WiFi!");
}
/*
- * loop() is called continuously. Here you can check for events, read sensors, etc.
- *
- * Tips:
- * 1. You can use "if (WLED_CONNECTED)" to check for a successful network connection.
- * Additionally, "if (WLED_MQTT_CONNECTED)" is available to check for a connection to an MQTT broker.
- *
- * 2. Try to avoid using the delay() function. NEVER use delays longer than 10 milliseconds.
- * Instead, use a timer check as shown here.
+ * `bucle()` se llama de forma continua. Aquí puedes comprobar eventos, leer sensores, etc.
+ *
+ * Consejos:
+ * 1. Puedes usar "if (WLED_CONNECTED)" para comprobar una conexión de red.
+ * Adicionalmente, "if (WLED_MQTT_CONNECTED)" permite comprobar la conexión al broker MQTT.
+ *
+ * 2. Evita usar `retraso()`; NUNCA uses delays mayores a 10 ms.
+ * En su lugar usa comprobaciones temporizadas como en este ejemplo.
*/
void loop() override {
- // if usermod is disabled or called during strip updating just exit
- // NOTE: on very long strips strip.isUpdating() may always return true so update accordingly
+ // if usermod is disabled or called during tira updating just salida
+ // NOTE: on very long strips tira.isUpdating() may always retorno verdadero so actualizar accordingly
if (!enabled || strip.isUpdating()) return;
// do your magic here
if (millis() - lastTime > 1000) {
- //Serial.println("I'm alive!");
+ //Serie.println("I'm alive!");
lastTime = millis();
}
}
/*
- * addToJsonInfo() can be used to add custom entries to the /json/info part of the JSON API.
- * Creating an "u" object allows you to add custom key/value pairs to the Info section of the WLED web UI.
- * Below it is shown how this could be used for e.g. a light sensor
+ * `addToJsonInfo()` puede usarse para añadir entradas personalizadas a /JSON/información de la API JSON.
+ * Crear un objeto "u" permite añadir pares clave/valor a la sección Información de la UI web de WLED.
+ * A continuación se muestra un ejemplo (p. ej. para un sensor de luz).
*/
void addToJsonInfo(JsonObject& root) override
{
- // if "u" object does not exist yet wee need to create it
+ // if "u" object does not exist yet wee need to crear it
JsonObject user = root["u"];
if (user.isNull()) user = root.createNestedObject("u");
- //this code adds "u":{"ExampleUsermod":[20," lux"]} to the info object
+ //this código adds "u":{"ExampleUsermod":[20," lux"]} to the información object
//int reading = 20;
- //JsonArray lightArr = user.createNestedArray(FPSTR(_name))); //name
- //lightArr.add(reading); //value
+ //JsonArray lightArr = usuario.createNestedArray(FPSTR(_name))); //name
+ //lightArr.add(reading); //valor
//lightArr.add(F(" lux")); //unit
- // if you are implementing a sensor usermod, you may publish sensor data
+ // if you are implementing a sensor usermod, you may publish sensor datos
//JsonObject sensor = root[F("sensor")];
//if (sensor.isNull()) sensor = root.createNestedObject(F("sensor"));
//temp = sensor.createNestedArray(F("light"));
@@ -151,8 +151,8 @@ class MyExampleUsermod : public Usermod {
/*
- * addToJsonState() can be used to add custom entries to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * addToJsonState() can be used to add custom entries to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
void addToJsonState(JsonObject& root) override
{
@@ -166,8 +166,8 @@ class MyExampleUsermod : public Usermod {
/*
- * readFromJsonState() can be used to receive data clients send to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * readFromJsonState() can be used to recibir datos clients enviar to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
void readFromJsonState(JsonObject& root) override
{
@@ -175,46 +175,46 @@ class MyExampleUsermod : public Usermod {
JsonObject usermod = root[FPSTR(_name)];
if (!usermod.isNull()) {
- // expect JSON usermod data in usermod name object: {"ExampleUsermod:{"user0":10}"}
+ // expect JSON usermod datos in usermod name object: {"ExampleUsermod:{"user0":10}"}
userVar0 = usermod["user0"] | userVar0; //if "user0" key exists in JSON, update, else keep old value
}
- // you can as well check WLED state JSON keys
- //if (root["bri"] == 255) Serial.println(F("Don't burn down your garage!"));
+ // you can as well verificar WLED estado JSON keys
+ //if (root["bri"] == 255) Serie.println(F("Don't burn down your garage!"));
}
/*
- * addToConfig() can be used to add custom persistent settings to the cfg.json file in the "um" (usermod) object.
+ * addToConfig() can be used to add custom persistent settings to the cfg.JSON archivo in the "um" (usermod) object.
* It will be called by WLED when settings are actually saved (for example, LED settings are saved)
- * If you want to force saving the current state, use serializeConfig() in your loop().
+ * If you want to force saving the current estado, use serializeConfig() in your bucle().
*
- * CAUTION: serializeConfig() will initiate a filesystem write operation.
+ * CAUTION: serializeConfig() will initiate a filesystem escribir operation.
* It might cause the LEDs to stutter and will cause flash wear if called too often.
- * Use it sparingly and always in the loop, never in network callbacks!
+ * Use it sparingly and always in the bucle, never in red callbacks!
*
* addToConfig() will make your settings editable through the Usermod Settings page automatically.
*
* Usermod Settings Overview:
* - Numeric values are treated as floats in the browser.
- * - If the numeric value entered into the browser contains a decimal point, it will be parsed as a C float
- * before being returned to the Usermod. The float data type has only 6-7 decimal digits of precision, and
- * doubles are not supported, numbers will be rounded to the nearest float value when being parsed.
- * The range accepted by the input field is +/- 1.175494351e-38 to +/- 3.402823466e+38.
- * - If the numeric value entered into the browser doesn't contain a decimal point, it will be parsed as a
- * C int32_t (range: -2147483648 to 2147483647) before being returned to the usermod.
- * Overflows or underflows are truncated to the max/min value for an int32_t, and again truncated to the type
- * used in the Usermod when reading the value from ArduinoJson.
- * - Pin values can be treated differently from an integer value by using the key name "pin"
- * - "pin" can contain a single or array of integer values
+ * - If the numeric valor entered into the browser contains a decimal point, it will be parsed as a C flotante
+ * before being returned to the Usermod. The flotante datos tipo has only 6-7 decimal digits of precisión, and
+ * doubles are not supported, numbers will be rounded to the nearest flotante valor when being parsed.
+ * The rango accepted by the entrada campo is +/- 1.175494351e-38 to +/- 3.402823466e+38.
+ * - If the numeric valor entered into the browser doesn't contain a decimal point, it will be parsed as a
+ * C int32_t (rango: -2147483648 to 2147483647) before being returned to the usermod.
+ * Overflows or underflows are truncated to the max/min valor for an int32_t, and again truncated to the tipo
+ * used in the Usermod when reading the valor from ArduinoJson.
+ * - Pin values can be treated differently from an entero valor by usando the key name "pin"
+ * - "pin" can contain a single or matriz of entero values
* - On the Usermod Settings page there is simple checking for pin conflicts and warnings for special pins
- * - Red color indicates a conflict. Yellow color indicates a pin with a warning (e.g. an input-only pin)
- * - Tip: use int8_t to store the pin value in the Usermod, so a -1 value (pin not set) can be used
+ * - Red color indicates a conflicto. Yellow color indicates a pin with a advertencia (e.g. an entrada-only pin)
+ * - Tip: use int8_t to store the pin valor in the Usermod, so a -1 valor (pin not set) can be used
*
* See usermod_v2_auto_save.h for an example that saves Flash space by reusing ArduinoJson key name strings
*
* If you need a dedicated settings page with custom layout for your Usermod, that takes a lot more work.
- * You will have to add the setting to the HTML, xml.cpp and set.cpp manually.
- * See the WLED Soundreactive fork (code and wiki) for reference. https://github.com/atuline/WLED
+ * You will have to add the setting to the HTML, XML.cpp and set.cpp manually.
+ * See the WLED Soundreactive bifurcación (código and wiki) for reference. https://github.com/atuline/WLED
*
* I highly recommend checking out the basics of ArduinoJson serialization and deserialization in order to use custom settings!
*/
@@ -222,7 +222,7 @@ class MyExampleUsermod : public Usermod {
{
JsonObject top = root.createNestedObject(FPSTR(_name));
top[FPSTR(_enabled)] = enabled;
- //save these vars persistently whenever settings are saved
+ //guardar these vars persistently whenever settings are saved
top["great"] = userVar0;
top["testBool"] = testBool;
top["testInt"] = testInt;
@@ -237,24 +237,24 @@ class MyExampleUsermod : public Usermod {
/*
- * readFromConfig() can be used to read back the custom settings you added with addToConfig().
+ * readFromConfig() can be used to leer back the custom settings you added with addToConfig().
* This is called by WLED when settings are loaded (currently this only happens immediately after boot, or after saving on the Usermod Settings page)
*
- * readFromConfig() is called BEFORE setup(). This means you can use your persistent values in setup() (e.g. pin assignments, buffer sizes),
- * but also that if you want to write persistent values to a dynamic buffer, you'd need to allocate it here instead of in setup.
+ * readFromConfig() is called BEFORE configuración(). This means you can use your persistent values in configuración() (e.g. pin assignments, búfer sizes),
+ * but also that if you want to escribir persistent values to a dynamic búfer, you'd need to allocate it here instead of in configuración.
* If you don't know what that is, don't fret. It most likely doesn't affect your use case :)
*
- * Return true in case the config values returned from Usermod Settings were complete, or false if you'd like WLED to save your defaults to disk (so any missing values are editable in Usermod Settings)
+ * Retorno verdadero in case the config values returned from Usermod Settings were complete, or falso if you'd like WLED to guardar your defaults to disk (so any missing values are editable in Usermod Settings)
*
- * getJsonValue() returns false if the value is missing, or copies the value into the variable provided and returns true if the value is present
- * The configComplete variable is true only if the "exampleUsermod" object and all values are present. If any values are missing, WLED will know to call addToConfig() to save them
+ * getJsonValue() returns falso if the valor is missing, or copies the valor into the variable provided and returns verdadero if the valor is present
+ * The configComplete variable is verdadero only if the "exampleUsermod" object and all values are present. If any values are missing, WLED will know to call addToConfig() to guardar them
*
- * This function is guaranteed to be called on boot, but could also be called every time settings are updated
+ * This función is guaranteed to be called on boot, but could also be called every time settings are updated
*/
bool readFromConfig(JsonObject& root) override
{
- // default settings values could be set here (or below using the 3-argument getJsonValue()) instead of in the class definition or constructor
- // setting them inside readFromConfig() is slightly more robust, handling the rare but plausible use case of single value being missing after boot (e.g. if the cfg.json was manually edited and a value was removed)
+ // default settings values could be set here (or below usando the 3-argumento getJsonValue()) instead of in the clase definition or constructor
+ // setting them inside readFromConfig() is slightly more robust, handling the rare but plausible use case of single valor being missing after boot (e.g. if the cfg.JSON was manually edited and a valor was removed)
JsonObject top = root[FPSTR(_name)];
@@ -266,7 +266,7 @@ class MyExampleUsermod : public Usermod {
configComplete &= getJsonValue(top["testFloat"], testFloat);
configComplete &= getJsonValue(top["testString"], testString);
- // A 3-argument getJsonValue() assigns the 3rd argument as a default value if the Json value is missing
+ // A 3-argumento getJsonValue() assigns the 3rd argumento as a default valor if the JSON valor is missing
configComplete &= getJsonValue(top["testInt"], testInt, 42);
configComplete &= getJsonValue(top["testLong"], testLong, -42424242);
@@ -279,9 +279,9 @@ class MyExampleUsermod : public Usermod {
/*
- * appendConfigData() is called when user enters usermod settings page
+ * appendConfigData() is called when usuario enters usermod settings page
* it may add additional metadata for certain entry fields (adding drop down is possible)
- * be careful not to add too much as oappend() buffer is limited to 3k
+ * be careful not to add too much as oappend() búfer is limited to 3k
*/
void appendConfigData() override
{
@@ -294,24 +294,24 @@ class MyExampleUsermod : public Usermod {
/*
- * handleOverlayDraw() is called just before every show() (LED strip update frame) after effects have set the colors.
- * Use this to blank out some LEDs or set them to a different color regardless of the set effect mode.
- * Commonly used for custom clocks (Cronixie, 7 segment)
+ * handleOverlayDraw() is called just before every show() (LED tira actualizar frame) after effects have set the colors.
+ * Use this to blank out some LEDs or set them to a different color regardless of the set efecto mode.
+ * Commonly used for custom clocks (Cronixie, 7 segmento)
*/
void handleOverlayDraw() override
{
- //strip.setPixelColor(0, RGBW32(0,0,0,0)) // set the first pixel to black
+ //tira.setPixelColor(0, RGBW32(0,0,0,0)) // set the first píxel to black
}
/**
- * handleButton() can be used to override default button behaviour. Returning true
- * will prevent button working in a default way.
+ * handleButton() can be used to anular default button behaviour. Returning verdadero
+ * will prevent button funcionamiento in a default way.
* Replicating button.cpp
*/
bool handleButton(uint8_t b) override {
yield();
- // ignore certain button types as they may have other consequences
+ // ignorar certain button types as they may have other consequences
if (!enabled
|| buttons[b].type == BTN_TYPE_NONE
|| buttons[b].type == BTN_TYPE_RESERVED
@@ -329,29 +329,29 @@ class MyExampleUsermod : public Usermod {
#ifndef WLED_DISABLE_MQTT
/**
- * handling of MQTT message
- * topic only contains stripped topic (part after /wled/MAC)
+ * handling of MQTT mensaje
+ * topic only contains stripped topic (part after /WLED/MAC)
*/
bool onMqttMessage(char* topic, char* payload) override {
- // check if we received a command
+ // verificar if we received a command
//if (strlen(topic) == 8 && strncmp_P(topic, PSTR("/command"), 8) == 0) {
- // String action = payload;
- // if (action == "on") {
- // enabled = true;
- // return true;
- // } else if (action == "off") {
- // enabled = false;
- // return true;
- // } else if (action == "toggle") {
+ // Cadena acción = carga útil;
+ // if (acción == "on") {
+ // enabled = verdadero;
+ // retorno verdadero;
+ // } else if (acción == "off") {
+ // enabled = falso;
+ // retorno verdadero;
+ // } else if (acción == "toggle") {
// enabled = !enabled;
- // return true;
+ // retorno verdadero;
// }
//}
return false;
}
/**
- * onMqttConnect() is called when MQTT connection is established
+ * onMqttConnect() is called when MQTT conexión is established
*/
void onMqttConnect(bool sessionPresent) override {
// do any MQTT related initialisation here
@@ -361,39 +361,39 @@ class MyExampleUsermod : public Usermod {
/**
- * onStateChanged() is used to detect WLED state change
- * @mode parameter is CALL_MODE_... parameter used for notifications
+ * onStateChanged() is used to detect WLED estado change
+ * @mode parámetro is CALL_MODE_... parámetro used for notifications
*/
void onStateChange(uint8_t mode) override {
- // do something if WLED state changed (color, brightness, effect, preset, etc)
+ // do something if WLED estado changed (color, brillo, efecto, preset, etc)
}
/*
- * getId() allows you to optionally give your V2 usermod an unique ID (please define it in const.h!).
- * This could be used in the future for the system to determine whether your usermod is installed.
+ * getId() allows you to optionally give your V2 usermod an unique ID (please definir it in constante.h!).
+ * This could be used in the futuro for the sistema to determine whether your usermod is installed.
*/
uint16_t getId() override
{
return USERMOD_ID_EXAMPLE;
}
- //More methods can be added in the future, this example will then be extended.
- //Your usermod will remain compatible as it does not need to implement all methods from the Usermod base class!
+ //More methods can be added in the futuro, this example will then be extended.
+ //Your usermod will remain compatible as it does not need to implement all methods from the Usermod base clase!
};
-// add more strings here to reduce flash memory usage
+// add more strings here to reduce flash memoria usage
const char MyExampleUsermod::_name[] PROGMEM = "ExampleUsermod";
const char MyExampleUsermod::_enabled[] PROGMEM = "enabled";
-// implementation of non-inline member methods
+// implementación of non-en línea miembro methods
void MyExampleUsermod::publishMqtt(const char* state, bool retain)
{
#ifndef WLED_DISABLE_MQTT
- //Check if MQTT Connected, otherwise it will crash the 8266
+ //Verificar if MQTT Connected, otherwise it will bloqueo the 8266
if (WLED_MQTT_CONNECTED) {
char subuf[64];
strcpy(subuf, mqttDeviceTopic);
diff --git a/usermods/EleksTube_IPS/ChipSelect.h b/usermods/EleksTube_IPS/ChipSelect.h
index ced5eb8ea8..4c36f45fa8 100644
--- a/usermods/EleksTube_IPS/ChipSelect.h
+++ b/usermods/EleksTube_IPS/ChipSelect.h
@@ -17,9 +17,9 @@ class ChipSelect {
void update() {
// Documented in README.md. Q7 and Q6 are unused. Q5 is Seconds Ones, Q0 is Hours Tens.
- // Q7 is the first bit written, Q0 is the last. So we push two dummy bits, then start with
+ // Q7 is the first bit written, Q0 is the last. So we enviar two dummy bits, then iniciar with
// Seconds Ones and end with Hours Tens.
- // CS is Active Low, but digits_map is 1 for enable, 0 for disable. So we bit-wise NOT first.
+ // CS is Active Low, but digits_map is 1 for habilitar, 0 for deshabilitar. So we bit-wise NOT first.
uint8_t to_shift = (~digits_map) << 2;
@@ -42,8 +42,8 @@ class ChipSelect {
// These speak the indexes defined in Hardware.h.
// So 0 is disabled, 1 is enabled (even though CS is active low, this gets mapped.)
- // So bit 0 (LSB), is index 0, is SECONDS_ONES
- // Translation to what the 74HC595 uses is done in update()
+ // So bit 0 (LSB), is índice 0, is SECONDS_ONES
+ // Translation to what the 74HC595 uses is done in actualizar()
void setDigitMap(uint8_t map, bool update_=true) { digits_map = map; if (update_) update(); }
uint8_t getDigitMap() { return digits_map; }
diff --git a/usermods/EleksTube_IPS/EleksTube_IPS.cpp b/usermods/EleksTube_IPS/EleksTube_IPS.cpp
index e8637b0fe8..94f16d3798 100644
--- a/usermods/EleksTube_IPS/EleksTube_IPS.cpp
+++ b/usermods/EleksTube_IPS/EleksTube_IPS.cpp
@@ -1,11 +1,11 @@
#include "TFTs.h"
#include "wled.h"
-//Large parts of the code are from https://github.com/SmittyHalibut/EleksTubeHAX
+//Large parts of the código are from https://github.com/SmittyHalibut/EleksTubeHAX
class ElekstubeIPSUsermod : public Usermod {
private:
- // strings to reduce flash memory usage (used more than twice)
+ // strings to reduce flash memoria usage (used more than twice)
static const char _name[];
static const char _tubeSeg[];
static const char _digitOffset[];
@@ -83,7 +83,7 @@ class ElekstubeIPSUsermod : public Usermod {
}
/**
- * addToConfig() (called from set.cpp) stores persistent properties to cfg.json
+ * addToConfig() (called from set.cpp) stores persistent properties to cfg.JSON
*/
void addToConfig(JsonObject &root) {
// we add JSON object: {"EleksTubeIPS": {"tubeSegment": 1, "digitOffset": 0}}
@@ -94,9 +94,9 @@ class ElekstubeIPSUsermod : public Usermod {
}
/**
- * readFromConfig() is called before setup() to populate properties from values stored in cfg.json
+ * readFromConfig() is called before configuración() to populate properties from values stored in cfg.JSON
*
- * The function should return true if configuration was successfully loaded or false if there was no configuration.
+ * The función should retorno verdadero if configuration was successfully loaded or falso if there was no configuration.
*/
bool readFromConfig(JsonObject &root) {
// we look for JSON object: {"EleksTubeIPS": {"tubeSegment": 1, "digitOffset": 0}}
@@ -114,13 +114,13 @@ class ElekstubeIPSUsermod : public Usermod {
if (tfts.digitOffset > 240) tfts.digitOffset = 240;
if (tfts.digitOffset != digitOffsetPrev) fshow=TFTs::force;
- // use "return !top["newestParameter"].isNull();" when updating Usermod with new features
+ // use "retorno !top["newestParameter"].isNull();" when updating Usermod with new features
return !top[FPSTR(_digitOffset)].isNull();
}
/*
- * addToJsonState() can be used to add custom entries to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * addToJsonState() can be used to add custom entries to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
void addToJsonState(JsonObject& root)
{
@@ -130,8 +130,8 @@ class ElekstubeIPSUsermod : public Usermod {
/*
- * readFromJsonState() can be used to receive data clients send to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * readFromJsonState() can be used to recibir datos clients enviar to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
void readFromJsonState(JsonObject& root)
{
@@ -151,7 +151,7 @@ class ElekstubeIPSUsermod : public Usermod {
}
};
-// strings to reduce flash memory usage (used more than twice)
+// strings to reduce flash memoria usage (used more than twice)
const char ElekstubeIPSUsermod::_name[] PROGMEM = "EleksTubeIPS";
const char ElekstubeIPSUsermod::_tubeSeg[] PROGMEM = "tubeSegment";
const char ElekstubeIPSUsermod::_digitOffset[] PROGMEM = "digitOffset";
diff --git a/usermods/EleksTube_IPS/Hardware.h b/usermods/EleksTube_IPS/Hardware.h
index e4f7930536..f5a020bfec 100644
--- a/usermods/EleksTube_IPS/Hardware.h
+++ b/usermods/EleksTube_IPS/Hardware.h
@@ -1,5 +1,5 @@
/*
- * Define the hardware for the EleksTube IPS clock. Mostly pin definitions
+ * Definir the hardware for the EleksTube IPS clock. Mostly pin definitions
*/
#ifndef ELEKSTUBEHAX_HARDWARE_H
#define ELEKSTUBEHAX_HARDWARE_H
diff --git a/usermods/EleksTube_IPS/TFTs.h b/usermods/EleksTube_IPS/TFTs.h
index 030ec23add..d5e9a2351a 100644
--- a/usermods/EleksTube_IPS/TFTs.h
+++ b/usermods/EleksTube_IPS/TFTs.h
@@ -13,8 +13,8 @@ class TFTs : public TFT_eSPI {
uint8_t digits[NUM_DIGITS];
- // These read 16- and 32-bit types from the SD card file.
- // BMP data is stored little-endian, Arduino is little-endian too.
+ // These leer 16- and 32-bit types from the SD card archivo.
+ // BMP datos is stored little-endian, Arduino is little-endian too.
// May need to reverse subscript order if porting elsewhere.
uint16_t read16(fs::File &f) {
@@ -45,17 +45,17 @@ class TFTs : public TFT_eSPI {
setSwapBytes(oldSwapBytes);
}
- // These BMP functions are stolen directly from the TFT_SPIFFS_BMP example in the TFT_eSPI library.
- // Unfortunately, they aren't part of the library itself, so I had to copy them.
- // I've modified drawBmp to buffer the whole image at once instead of doing it line-by-line.
+ // These BMP functions are stolen directly from the TFT_SPIFFS_BMP example in the TFT_eSPI biblioteca.
+ // Unfortunately, they aren't part of the biblioteca itself, so I had to copy them.
+ // I've modified drawBmp to búfer the whole image at once instead of doing it line-by-line.
- //// BEGIN STOLEN CODE
+ //// BEGIN STOLEN CÓDIGO
- // Draw directly from file stored in RGB565 format. Fastest
+ // Dibujar directly from archivo stored in RGB565 formato. Fastest
bool drawBin(const char *filename) {
fs::File bmpFS;
- // Open requested file on SD card
+ // Open requested archivo on SD card
bmpFS = WLED_FS.open(filename, "r");
size_t sz = bmpFS.size();
@@ -67,7 +67,7 @@ class TFTs : public TFT_eSPI {
uint16_t r, g, b, dimming = 255;
int16_t row, col;
- //draw img that is shorter than 240pix into the center
+ //dibujar img that is shorter than 240pix into the center
w = 135;
h = sz / (w * 2);
x = 0;
@@ -83,16 +83,16 @@ class TFTs : public TFT_eSPI {
bmpFS.read(lineBuffer, sizeof(lineBuffer));
uint8_t PixM, PixL;
- // Colors are already in 16-bit R5, G6, B5 format
+ // Colors are already in 16-bit R5, G6, B5 formato
for (col = 0; col < w; col++)
{
if (dimming == 255 && !digitColor) { // not needed, copy directly
output_buffer[row][col] = (lineBuffer[col*2+1] << 8) | (lineBuffer[col*2]);
} else {
- // 16 BPP pixel format: R5, G6, B5 ; bin: RRRR RGGG GGGB BBBB
+ // 16 BPP píxel formato: R5, G6, B5 ; bin: RRRR RGGG GGGB BBBB
PixM = lineBuffer[col*2+1];
PixL = lineBuffer[col*2];
- // align to 8-bit value (MSB left aligned)
+ // align to 8-bit valor (MSB left aligned)
r = (PixM) & 0xF8;
g = ((PixM << 5) | (PixL >> 3)) & 0xFC;
b = (PixL << 3) & 0xF8;
@@ -119,7 +119,7 @@ class TFTs : public TFT_eSPI {
bool drawBmp(const char *filename) {
fs::File bmpFS;
- // Open requested file on SD card
+ // Open requested archivo on SD card
bmpFS = WLED_FS.open(filename, "r");
uint32_t seekOffset, headerSize, paletteSize = 0;
@@ -160,7 +160,7 @@ class TFTs : public TFT_eSPI {
}
}
- // draw img that is shorter than 240pix into the center
+ // dibujar img that is shorter than 240pix into the center
x = (width() - w) /2;
y = (height() - h) /2;
@@ -176,7 +176,7 @@ class TFTs : public TFT_eSPI {
bmpFS.read(lineBuffer, sizeof(lineBuffer));
uint8_t* bptr = lineBuffer;
- // Convert 24 to 16 bit colors while copying to output buffer.
+ // Convertir 24 to 16 bit colors while copying to salida búfer.
for (uint16_t col = 0; col < w; col++)
{
if (bitDepth == 24) {
@@ -222,7 +222,7 @@ class TFTs : public TFT_eSPI {
bool drawClk(const char *filename) {
fs::File bmpFS;
- // Open requested file on SD card
+ // Open requested archivo on SD card
bmpFS = WLED_FS.open(filename, "r");
if (!bmpFS)
@@ -258,16 +258,16 @@ class TFTs : public TFT_eSPI {
bmpFS.read(lineBuffer, sizeof(lineBuffer));
uint8_t PixM, PixL;
- // Colors are already in 16-bit R5, G6, B5 format
+ // Colors are already in 16-bit R5, G6, B5 formato
for (col = 0; col < w; col++)
{
if (dimming == 255 && !digitColor) { // not needed, copy directly
output_buffer[row][col+x] = (lineBuffer[col*2+1] << 8) | (lineBuffer[col*2]);
} else {
- // 16 BPP pixel format: R5, G6, B5 ; bin: RRRR RGGG GGGB BBBB
+ // 16 BPP píxel formato: R5, G6, B5 ; bin: RRRR RGGG GGGB BBBB
PixM = lineBuffer[col*2+1];
PixL = lineBuffer[col*2];
- // align to 8-bit value (MSB left aligned)
+ // align to 8-bit valor (MSB left aligned)
r = (PixM) & 0xF8;
g = ((PixM << 5) | (PixL >> 3)) & 0xFC;
b = (PixL << 3) & 0xF8;
@@ -295,7 +295,7 @@ class TFTs : public TFT_eSPI {
TFTs() : TFT_eSPI(), chip_select()
{ for (uint8_t digit=0; digit < NUM_DIGITS; digit++) digits[digit] = 0; }
- // no == Do not send to TFT. yes == Send to TFT if changed. force == Send to TFT.
+ // no == Do not enviar to TFT. yes == Enviar to TFT if changed. force == Enviar to TFT.
enum show_t { no, yes, force };
// A digit of 0xFF means blank the screen.
const static uint8_t blanked = 255;
@@ -307,11 +307,11 @@ class TFTs : public TFT_eSPI {
pinMode(TFT_ENABLE_PIN, OUTPUT);
digitalWrite(TFT_ENABLE_PIN, HIGH); //enable displays on boot
- // Start with all displays selected.
+ // Iniciar with all displays selected.
chip_select.begin();
chip_select.setAll();
- // Initialize the super class.
+ // Inicializar the super clase.
init();
}
@@ -324,7 +324,7 @@ class TFTs : public TFT_eSPI {
fillScreen(TFT_BLACK); return;
}
- // if last digit was the same, skip loading from FS to buffer
+ // if last digit was the same, omitir loading from FS to búfer
if (!digitColor && digitToDraw == bufferedDigit) drawBuffer();
digitR = R(digitColor); digitG = G(digitColor); digitB = B(digitColor);
@@ -336,7 +336,7 @@ class TFTs : public TFT_eSPI {
if (drawBin(file_name)) bufferedDigit = digitToDraw;
return;
}
- // Fast, raw RGB565, see https://github.com/aly-fly/EleksTubeHAX on how to create this clk format
+ // Fast, raw RGB565, see https://github.com/aly-fly/EleksTubeHAX on how to crear this clk formato
sprintf(file_name, "/%d.clk", digitToDraw);
if (WLED_FS.exists(file_name)) {
if (drawClk(file_name)) bufferedDigit = digitToDraw;
@@ -352,7 +352,7 @@ class TFTs : public TFT_eSPI {
uint8_t old_value = digits[digit];
digits[digit] = value;
- // Color in grayscale bitmaps if Segment 1 exists
+ // Color in grayscale bitmaps if Segmento 1 exists
// TODO If secondary and tertiary are black, color all in primary,
// else color first three from Seg 1 color slots and last three from Seg 2 color slots
Segment& seg1 = strip.getSegment(tubeSegment);
diff --git a/usermods/EleksTube_IPS/User_Setup.h b/usermods/EleksTube_IPS/User_Setup.h
index b4b2edab02..f707525456 100644
--- a/usermods/EleksTube_IPS/User_Setup.h
+++ b/usermods/EleksTube_IPS/User_Setup.h
@@ -1,6 +1,6 @@
/*
- * This is intended to over-ride `User_Setup.h` that comes with the TFT_eSPI library.
- * I hate having to modify the library code.
+ * This is intended to over-ride `User_Setup.h` that comes with the TFT_eSPI biblioteca.
+ * I hate having to modify the biblioteca código.
*/
// ST7789 135 x 240 display with no chip select line
@@ -12,36 +12,36 @@
#define CGRAM_OFFSET // Library will add offsets required
-//#define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue
-//#define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red
+//#definir TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue
+//#definir TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red
-//#define TFT_INVERSION_ON
-//#define TFT_INVERSION_OFF
+//#definir TFT_INVERSION_ON
+//#definir TFT_INVERSION_OFF
// EleksTube IPS
#define TFT_SDA_READ // Read and write on the MOSI/SDA pin, no separate MISO pin
#define TFT_MOSI 23
#define TFT_SCLK 18
-//#define TFT_CS -1 // Not connected
+//#definir TFT_CS -1 // Not connected
#define TFT_DC 25 // Data Command, aka Register Select or RS
#define TFT_RST 26 // Connect reset to ensure display initialises
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
-//#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
-//#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
-//#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
-//#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:.
-//#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
-//#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
-//#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
+//#definir LOAD_FONT2 // Font 2. Small 16 píxel high font, needs ~3534 bytes in FLASH, 96 characters
+//#definir LOAD_FONT4 // Font 4. Medium 26 píxel high font, needs ~5848 bytes in FLASH, 96 characters
+//#definir LOAD_FONT6 // Font 6. Large 48 píxel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
+//#definir LOAD_FONT7 // Font 7. 7 segmento 48 píxel font, needs ~2438 bytes in FLASH, only characters 1234567890:.
+//#definir LOAD_FONT8 // Font 8. Large 75 píxel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
+//#definir LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 píxel TFT
+//#definir LOAD_GFXFF // FreeFonts. Incluir acceso to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
-//#define SMOOTH_FONT
+//#definir SMOOTH_FONT
-//#define SPI_FREQUENCY 27000000
+//#definir SPI_FREQUENCY 27000000
#define SPI_FREQUENCY 40000000
/*
- * To make the Library not over-write all this:
+ * To make the Biblioteca not over-escribir all this:
*/
#define USER_SETUP_LOADED
diff --git a/usermods/Enclosure_with_OLED_temp_ESP07/usermod.cpp b/usermods/Enclosure_with_OLED_temp_ESP07/usermod.cpp
index d51ddb57cf..9573d7849e 100644
--- a/usermods/Enclosure_with_OLED_temp_ESP07/usermod.cpp
+++ b/usermods/Enclosure_with_OLED_temp_ESP07/usermod.cpp
@@ -18,28 +18,28 @@ long temptimer = millis();
long lastMeasure = 0;
#define Celsius // Show temperature measurement in Celsius otherwise is in Fahrenheit
-// If display does not work or looks corrupted check the
+// If display does not work or looks corrupted verificar the
// constructor reference:
// https://github.com/olikraus/u8g2/wiki/u8x8setupcpp
-// or check the gallery:
+// or verificar the gallery:
// https://github.com/olikraus/u8g2/wiki/gallery
// --> First choice of cheap I2C OLED 128X32 0.91"
U8X8_SSD1306_128X32_UNIVISION_HW_I2C u8x8(U8X8_PIN_NONE, U8X8_PIN_SCL, U8X8_PIN_SDA); // Pins are Reset, SCL, SDA
// --> Second choice of cheap I2C OLED 128X64 0.96" or 1.3"
-//U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(U8X8_PIN_NONE, U8X8_PIN_SCL, U8X8_PIN_SDA); // Pins are Reset, SCL, SDA
+//U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(U8X8_PIN_NONE, U8X8_PIN_SCL, U8X8_PIN_SDA); // Pins are Restablecer, SCL, SDA
// gets called once at boot. Do all initialization that doesn't depend on
-// network here
+// red here
void userSetup() {
sensor.begin(); //Start Dallas temperature sensor
u8x8.begin();
- //u8x8.setFlipMode(1); //Un-comment if using WLED Wemos shield
+ //u8x8.setFlipMode(1); //Un-comment if usando WLED Wemos shield
u8x8.setPowerSave(0);
u8x8.setContrast(10); //Contrast setup will help to preserve OLED lifetime. In case OLED need to be brighter increase number up to 255
u8x8.setFont(u8x8_font_chroma48medium8_r);
u8x8.drawString(0, 0, "Loading...");
}
-// gets called every time WiFi is (re-)connected. Initialize own network
+// gets called every time WiFi is (re-)connected. Inicializar own red
// interfaces here
void userConnected() {}
@@ -64,21 +64,21 @@ void userLoop() {
//----> Dallas temperature sensor MQTT publishing
temptimer = millis();
-// Timer to publishe new temperature every 60 seconds
+// Temporizador to publishe new temperature every 60 seconds
if (temptimer - lastMeasure > 60000)
{
lastMeasure = temptimer;
-//Check if MQTT Connected, otherwise it will crash the 8266
+//Verificar if MQTT Connected, otherwise it will bloqueo the 8266
if (mqtt != nullptr)
{
sensor.requestTemperatures();
-//Gets preferred temperature scale based on selection in definitions section
+//Gets preferred temperature escala based on selection in definitions section
#ifdef Celsius
float board_temperature = sensor.getTempCByIndex(0);
#else
float board_temperature = sensor.getTempFByIndex(0);
#endif
-//Create character string populated with user defined device topic from the UI, and the read temperature. Then publish to MQTT server.
+//Crear carácter cadena populated with usuario defined dispositivo topic from the UI, and the leer temperature. Then publish to MQTT servidor.
char subuf[38];
strcpy(subuf, mqttDeviceTopic);
strcat(subuf, "/temperature");
@@ -86,7 +86,7 @@ void userLoop() {
}
}
- // Check if we time interval for redrawing passes.
+ // Verificar if we time intervalo for redrawing passes.
if (millis() - lastUpdate < USER_LOOP_REFRESH_RATE_MS) {
return;
}
@@ -98,7 +98,7 @@ void userLoop() {
displayTurnedOff = true;
}
- // Check if values which are shown on display changed from the last time.
+ // Verificar if values which are shown on display changed from the last time.
if (((apActive) ? String(apSSID) : WiFi.SSID()) != knownSsid) {
needRedraw = true;
} else if (knownIp != (apActive ? IPAddress(4, 3, 2, 1) : WiFi.localIP())) {
@@ -123,7 +123,7 @@ void userLoop() {
}
lastRedraw = millis();
- // Update last known values.
+ // Actualizar last known values.
#if defined(ESP8266)
knownSsid = apActive ? WiFi.softAPSSID() : WiFi.SSID();
#else
@@ -136,16 +136,16 @@ void userLoop() {
u8x8.clear();
u8x8.setFont(u8x8_font_chroma48medium8_r);
- // First row with Wifi name
+ // First row with WiFi name
u8x8.setCursor(1, 0);
u8x8.print(knownSsid.substring(0, u8x8.getCols() > 1 ? u8x8.getCols() - 2 : 0));
- // Print `~` char to indicate that SSID is longer than our display
+ // Imprimir `~` char to indicate that SSID is longer than our display
if (knownSsid.length() > u8x8.getCols())
u8x8.print("~");
// Second row with IP or Password
u8x8.setCursor(1, 1);
- // Print password in AP mode and if led is OFF.
+ // Imprimir password in AP mode and if LED is OFF.
if (apActive && bri == 0)
u8x8.print(apPass);
else
diff --git a/usermods/Enclosure_with_OLED_temp_ESP07/usermod_bme280.cpp b/usermods/Enclosure_with_OLED_temp_ESP07/usermod_bme280.cpp
index ce3c659e8f..92b2916085 100644
--- a/usermods/Enclosure_with_OLED_temp_ESP07/usermod_bme280.cpp
+++ b/usermods/Enclosure_with_OLED_temp_ESP07/usermod_bme280.cpp
@@ -12,7 +12,7 @@ void UpdateBME280Data();
#define Celsius // Show temperature measurement in Celsius otherwise is in Fahrenheit
BME280I2C bme; // Default : forced mode, standby time = 1000 ms
- // Oversampling = pressure ×1, temperature ×1, humidity ×1, filter off,
+ // Oversampling = pressure ×1, temperature ×1, humidity ×1, filtro off,
#ifdef ARDUINO_ARCH_ESP32 //ESP32 boards
uint8_t SCL_PIN = 22;
@@ -27,22 +27,22 @@ uint8_t SDA_PIN = 4;
//ESP8266 Wemos D1 mini board use SCL=5 SDA=4 while ESP32 Wemos32 mini board use SCL=22 SDA=21
#define U8X8_PIN_SCL SCL_PIN
#define U8X8_PIN_SDA SDA_PIN
-//#define U8X8_PIN_RESET RST_PIN // Un-comment for Heltec WiFi-Kit-8
+//#definir U8X8_PIN_RESET RST_PIN // Un-comment for Heltec WiFi-Kit-8
-// If display does not work or looks corrupted check the
+// If display does not work or looks corrupted verificar the
// constructor reference:
// https://github.com/olikraus/u8g2/wiki/u8x8setupcpp
-// or check the gallery:
+// or verificar the gallery:
// https://github.com/olikraus/u8g2/wiki/gallery
// --> First choise of cheap I2C OLED 128X32 0.91"
U8X8_SSD1306_128X32_UNIVISION_HW_I2C u8x8(U8X8_PIN_NONE, U8X8_PIN_SCL, U8X8_PIN_SDA); // Pins are Reset, SCL, SDA
// --> Second choice of cheap I2C OLED 128X64 0.96" or 1.3"
-//U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(U8X8_PIN_NONE, U8X8_PIN_SCL, U8X8_PIN_SDA); // Pins are Reset, SCL, SDA
+//U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(U8X8_PIN_NONE, U8X8_PIN_SCL, U8X8_PIN_SDA); // Pins are Restablecer, SCL, SDA
// --> Third choice of Heltec WiFi-Kit-8 OLED 128X32 0.91"
//U8X8_SSD1306_128X32_UNIVISION_HW_I2C u8x8(U8X8_PIN_RESET, U8X8_PIN_SCL, U8X8_PIN_SDA); // Constructor for Heltec WiFi-Kit-8
-// gets called once at boot. Do all initialization that doesn't depend on network here
+// gets called once at boot. Do all initialization that doesn't depend on red here
-// BME280 sensor timer
+// BME280 sensor temporizador
long tempTimer = millis();
long lastMeasure = 0;
@@ -77,7 +77,7 @@ switch(bme.chipModel())
}
}
-// gets called every time WiFi is (re-)connected. Initialize own network
+// gets called every time WiFi is (re-)connected. Inicializar own red
// interfaces here
void userConnected() {}
@@ -102,12 +102,12 @@ void userLoop() {
// BME280 sensor MQTT publishing
tempTimer = millis();
-// Timer to publish new sensor data every 60 seconds
+// Temporizador to publish new sensor datos every 60 seconds
if (tempTimer - lastMeasure > 60000)
{
lastMeasure = tempTimer;
-// Check if MQTT Connected, otherwise it will crash the 8266
+// Verificar if MQTT Connected, otherwise it will bloqueo the 8266
if (mqtt != nullptr)
{
UpdateBME280Data();
@@ -115,7 +115,7 @@ void userLoop() {
float board_pressure = SensorPressure;
float board_humidity = SensorHumidity;
-// Create string populated with user defined device topic from the UI, and the read temperature, humidity and pressure. Then publish to MQTT server.
+// Crear cadena populated with usuario defined dispositivo topic from the UI, and the leer temperature, humidity and pressure. Then publish to MQTT servidor.
String t = String(mqttDeviceTopic);
t += "/temperature";
mqtt->publish(t.c_str(), 0, true, String(board_temperature).c_str());
@@ -128,7 +128,7 @@ void userLoop() {
}
}
- // Check if we time interval for redrawing passes.
+ // Verificar if we time intervalo for redrawing passes.
if (millis() - lastUpdate < USER_LOOP_REFRESH_RATE_MS) {
return;
}
@@ -140,7 +140,7 @@ void userLoop() {
displayTurnedOff = true;
}
- // Check if values which are shown on display changed from the last time.
+ // Verificar if values which are shown on display changed from the last time.
if (((apActive) ? String(apSSID) : WiFi.SSID()) != knownSsid) {
needRedraw = true;
} else if (knownIp != (apActive ? IPAddress(4, 3, 2, 1) : WiFi.localIP())) {
@@ -165,7 +165,7 @@ void userLoop() {
}
lastRedraw = millis();
- // Update last known values.
+ // Actualizar last known values.
#if defined(ESP8266)
knownSsid = apActive ? WiFi.softAPSSID() : WiFi.SSID();
#else
@@ -178,16 +178,16 @@ void userLoop() {
u8x8.clear();
u8x8.setFont(u8x8_font_chroma48medium8_r);
- // First row with Wifi name
+ // First row with WiFi name
u8x8.setCursor(1, 0);
u8x8.print(knownSsid.substring(0, u8x8.getCols() > 1 ? u8x8.getCols() - 2 : 0));
- // Print `~` char to indicate that SSID is longer than our display
+ // Imprimir `~` char to indicate that SSID is longer than our display
if (knownSsid.length() > u8x8.getCols())
u8x8.print("~");
// Second row with IP or Password
u8x8.setCursor(1, 1);
- // Print password in AP mode and if led is OFF.
+ // Imprimir password in AP mode and if LED is OFF.
if (apActive && bri == 0)
u8x8.print(apPass);
else
diff --git a/usermods/Fix_unreachable_netservices_v2/usermod_Fix_unreachable_netservices.cpp b/usermods/Fix_unreachable_netservices_v2/usermod_Fix_unreachable_netservices.cpp
index 7fb8e97982..9e3e8ee7ad 100644
--- a/usermods/Fix_unreachable_netservices_v2/usermod_Fix_unreachable_netservices.cpp
+++ b/usermods/Fix_unreachable_netservices_v2/usermod_Fix_unreachable_netservices.cpp
@@ -4,29 +4,29 @@
#include
/*
- * This usermod performs a ping request to the local IP address every 60 seconds.
- * By this procedure the net services of WLED remains accessible in some problematic WLAN environments.
- *
- * Usermods allow you to add own functionality to WLED more easily
- * See: https://github.com/wled-dev/WLED/wiki/Add-own-functionality
- *
- * v2 usermods are class inheritance based and can (but don't have to) implement more functions, each of them is shown in this example.
- * Multiple v2 usermods can be added to one compilation easily.
- *
- * Creating a usermod:
- * This file serves as an example. If you want to create a usermod, it is recommended to use usermod_v2_empty.h from the usermods folder as a template.
- * Please remember to rename the class and file to a descriptive name.
- * You may also use multiple .h and .cpp files.
- *
- * Using a usermod:
- * 1. Copy the usermod into the sketch folder (same folder as wled00.ino)
- * 2. Register the usermod by adding #include "usermod_filename.h" in the top and registerUsermod(new MyUsermodClass()) in the bottom of usermods_list.cpp
+ * Este usermod realiza una petición ping a la IP local cada 60 segundos.
+ * Con este procedimiento los servicios de red de WLED permanecen accesibles en entornos WLAN problemáticos.
+ *
+ * Los usermods permiten añadir funcionalidad propia a WLED de forma sencilla.
+ * Ver: https://github.com/WLED-dev/WLED/wiki/Add-own-functionality
+ *
+ * Los usermods v2 se basan en herencia de clases y pueden (pero no deben) implementar más funciones; este ejemplo muestra varias.
+ * Se pueden añadir múltiples usermods v2 en una misma compilación.
+ *
+ * Creación de un usermod:
+ * Este fichero sirve como ejemplo. Para crear un usermod, se recomienda usar `usermod_v2_empty.h` como plantilla.
+ * Recuerda renombrar la clase y el fichero a nombres descriptivos.
+ * También puedes usar varios ficheros `.h` y `.cpp`.
+ *
+ * Uso de un usermod:
+ * 1. Copia el usermod a la carpeta del sketch (misma carpeta que `wled00.ino`).
+ * 2. Registra el usermod añadiendo `#incluir "usermod_filename.h"` y `registerUsermod(new MyUsermodClass())` en `usermods_list.cpp`.
*/
class FixUnreachableNetServices : public Usermod
{
private:
- //Private class members. You can declare variables and functions only accessible to your usermod here
+ //Privado clase members. You can declare variables and functions only accessible to your usermod here
unsigned long m_lastTime = 0;
// declare required variables
@@ -40,32 +40,32 @@ class FixUnreachableNetServices : public Usermod
//Functions called by WLED
/**
- * setup() is called once at boot. WiFi is not yet connected at this point.
- * You can use it to initialize variables, sensors or similar.
+ * `configuración()` se llama una vez al arrancar. En este punto WiFi aún no está conectado.
+ * Úsalo para inicializar variables, sensores o similares.
*/
void setup()
{
- //Serial.println("Hello from my usermod!");
+ //Serie.println("Hello from my usermod!");
}
/**
- * connected() is called every time the WiFi is (re)connected
- * Use it to initialize network interfaces
+ * `connected()` se llama cada vez que el WiFi se (re)conecta.
+ * Úsalo para inicializar interfaces de red.
*/
void connected()
{
- //Serial.println("Connected to WiFi!");
+ //Serie.println("Connected to WiFi!");
++m_connectedWiFi;
- // initialize ping_options structure
+ // inicializar ping_options structure
memset(&m_pingOpt, 0, sizeof(struct ping_option));
m_pingOpt.count = 1;
m_pingOpt.ip = WiFi.localIP();
}
/**
- * loop
+ * `bucle()`
*/
void loop()
{
@@ -83,13 +83,13 @@ class FixUnreachableNetServices : public Usermod
}
/**
- * addToJsonInfo() can be used to add custom entries to the /json/info part of the JSON API.
- * Creating an "u" object allows you to add custom key/value pairs to the Info section of the WLED web UI.
+ * addToJsonInfo() can be used to add custom entries to the /JSON/información part of the JSON API.
+ * Creating an "u" object allows you to add custom key/valor pairs to the Información section of the WLED web UI.
* Below it is shown how this could be used for e.g. a light sensor
*/
void addToJsonInfo(JsonObject &root)
{
- //this code adds "u":{"⚡ Ping fix pings": m_pingCount} to the info object
+ //this código adds "u":{"⚡ Ping fix pings": m_pingCount} to the información object
JsonObject user = root["u"];
if (user.isNull())
user = root.createNestedObject("u");
@@ -102,14 +102,14 @@ Delay > 8, 204, CONV_TIME_204},
{1, AVERAGE_1 >> 8, 140, CONV_TIME_140}};
-// Note: Will update the provided arg to be the correct value
+// Note: Will actualizar the provided arg to be the correct valor
INA226_AVERAGES getAverageEnum(uint16_t &samples)
{
for (const auto &setting : _inaSettingsLookup)
{
- // If a user supplies 2000 samples, we serve up the highest possible value
+ // If a usuario supplies 2000 samples, we serve up the highest possible valor
if (samples >= setting.avgSamples)
{
samples = setting.avgSamples;
return static_cast(setting.avgEnum << 8);
}
}
- // Default value if not found
+ // Predeterminado valor if not found
samples = DEFAULT_INASAMPLES;
return DEFAULT_INASAMPLESENUM;
}
@@ -50,14 +50,14 @@ INA226_CONV_TIME getConversionTimeEnum(uint16_t &timeUs)
{
for (const auto &setting : _inaSettingsLookup)
{
- // If a user supplies 9000 μs, we serve up the highest possible value
+ // If a usuario supplies 9000 μs, we serve up the highest possible valor
if (timeUs >= setting.convTimeUs)
{
timeUs = setting.convTimeUs;
return setting.convTimeEnum;
}
}
- // Default value if not found
+ // Predeterminado valor if not found
timeUs = DEFAULT_INACONVERSIONTIME;
return DEFAULT_INACONVERSIONTIMEENUM;
}
@@ -175,7 +175,7 @@ class UsermodINA226 : public Usermod
{
if (_measurementTriggered)
{
- // Test if we have a measurement every 400ms
+ // Prueba if we have a measurement every 400ms
if (currentTime - _lastTriggerTime >= 400)
{
_lastTriggerTime = currentTime;
@@ -190,7 +190,7 @@ class UsermodINA226 : public Usermod
{
if (currentTime - _lastLoopCheck >= _checkInterval)
{
- // Start a measurement and use isBusy() later to determine when it is done
+ // Iniciar a measurement and use isBusy() later to determine when it is done
_ina226->startSingleMeasurementNoWait();
_lastLoopCheck = currentTime;
_lastTriggerTime = currentTime;
@@ -314,7 +314,7 @@ class UsermodINA226 : public Usermod
public:
UsermodINA226()
{
- // Default values
+ // Predeterminado values
_settingInaSamples = DEFAULT_INASAMPLES;
_settingInaConversionTimeUs = DEFAULT_INACONVERSIONTIME;
@@ -485,7 +485,7 @@ class UsermodINA226 : public Usermod
uint16_t tmpShort;
if (getJsonValue(top[F("INASamples")], tmpShort))
{
- // The method below will fix the provided value to a valid one
+ // The método below will fix the provided valor to a valid one
getAverageEnum(tmpShort);
_settingInaSamples = tmpShort;
}
@@ -494,7 +494,7 @@ class UsermodINA226 : public Usermod
if (getJsonValue(top[F("INAConversionTime")], tmpShort))
{
- // The method below will fix the provided value to a valid one
+ // The método below will fix the provided valor to a valid one
getConversionTimeEnum(tmpShort);
_settingInaConversionTimeUs = tmpShort >> 2;
}
diff --git a/usermods/Internal_Temperature_v2/Internal_Temperature_v2.cpp b/usermods/Internal_Temperature_v2/Internal_Temperature_v2.cpp
index 7c30985eea..dd1667d51c 100644
--- a/usermods/Internal_Temperature_v2/Internal_Temperature_v2.cpp
+++ b/usermods/Internal_Temperature_v2/Internal_Temperature_v2.cpp
@@ -22,7 +22,7 @@ class InternalTemperatureUsermod : public Usermod
static const char _activationThreshold[];
static const char _presetToActivate[];
- // any private methods should go here (non-inline method should be defined out of class)
+ // any private methods should go here (non-en línea método should be defined out of clase)
void publishMqtt(const char *state, bool retain = false); // example for publishing MQTT message
public:
@@ -32,8 +32,8 @@ class InternalTemperatureUsermod : public Usermod
void loop()
{
- // if usermod is disabled or called during strip updating just exit
- // NOTE: on very long strips strip.isUpdating() may always return true so update accordingly
+ // if usermod is disabled or called during tira updating just salida
+ // NOTE: on very long strips tira.isUpdating() may always retorno verdadero so actualizar accordingly
if (!isEnabled || strip.isUpdating() || millis() - lastTime <= loopInterval)
return;
@@ -49,13 +49,13 @@ class InternalTemperatureUsermod : public Usermod
temperature = roundf(temperatureRead() * 10) / 10;
#endif
if(presetToActivate != 0){
- // Check if temperature has exceeded the activation threshold
+ // Verificar if temperature has exceeded the activation umbral
if (temperature >= activationThreshold) {
- // Update the state flag if not already set
+ // Actualizar the estado bandera if not already set
if (!isAboveThreshold) {
isAboveThreshold = true;
}
- // Check if a 'high temperature' preset is configured and it's not already active
+ // Verificar if a 'high temperature' preset is configured and it's not already active
if (currentPreset != presetToActivate) {
// If a playlist is active, store it for reactivation later
if (currentPlaylist > 0) {
@@ -64,7 +64,7 @@ class InternalTemperatureUsermod : public Usermod
// If a preset is active, store it for reactivation later
else if (currentPreset > 0) {
previousPreset = currentPreset;
- // If no playlist or preset is active, save current state for reactivation later
+ // If no playlist or preset is active, guardar current estado for reactivation later
} else {
saveTemporaryPreset();
}
@@ -72,28 +72,28 @@ class InternalTemperatureUsermod : public Usermod
applyPreset(presetToActivate);
}
}
- // Check if temperature is back below the threshold
+ // Verificar if temperature is back below the umbral
else if (temperature <= (activationThreshold - resetMargin)) {
- // Update the state flag if not already set
+ // Actualizar the estado bandera if not already set
if (isAboveThreshold){
isAboveThreshold = false;
}
- // Check if the 'high temperature' preset is active
+ // Verificar if the 'high temperature' preset is active
if (currentPreset == presetToActivate) {
- // Check if a previous playlist was stored
+ // Verificar if a previous playlist was stored
if (previousPlaylist > 0) {
// Reactivate the stored playlist
applyPreset(previousPlaylist);
- // Clear the stored playlist
+ // Limpiar the stored playlist
previousPlaylist = 0;
}
- // Check if a previous preset was stored
+ // Verificar if a previous preset was stored
else if (previousPreset > 0) {
// Reactivate the stored preset
applyPreset(previousPreset);
- // Clear the stored preset
+ // Limpiar the stored preset
previousPreset = 0;
- // If no previous playlist or preset was stored, revert to the stored state
+ // If no previous playlist or preset was stored, revertir to the stored estado
} else {
applyTemporaryPreset();
}
@@ -116,7 +116,7 @@ class InternalTemperatureUsermod : public Usermod
if (!isEnabled)
return;
- // if "u" object does not exist yet wee need to create it
+ // if "u" object does not exist yet wee need to crear it
JsonObject user = root["u"];
if (user.isNull())
user = root.createNestedObject("u");
@@ -125,7 +125,7 @@ class InternalTemperatureUsermod : public Usermod
userTempArr.add(temperature);
userTempArr.add(F(" °C"));
- // if "sensor" object does not exist yet wee need to create it
+ // if "sensor" object does not exist yet wee need to crear it
JsonObject sensor = root[F("sensor")];
if (sensor.isNull())
sensor = root.createNestedObject(F("sensor"));
@@ -144,12 +144,12 @@ class InternalTemperatureUsermod : public Usermod
top[FPSTR(_presetToActivate)] = presetToActivate;
}
- // Append useful info to the usermod settings gui
+ // Añadir useful información to the usermod settings gui
void appendConfigData()
{
- // Display 'ms' next to the 'Loop Interval' setting
+ // Display 'ms' next to the 'Bucle Intervalo' setting
oappend(F("addInfo('Internal Temperature:Loop Interval', 1, 'ms');"));
- // Display '°C' next to the 'Activation Threshold' setting
+ // Display '°C' next to the 'Activation Umbral' setting
oappend(F("addInfo('Internal Temperature:Activation Threshold', 1, '°C');"));
// Display '0 = Disabled' next to the 'Preset To Activate' setting
oappend(F("addInfo('Internal Temperature:Preset To Activate', 1, '0 = unused');"));
@@ -182,7 +182,7 @@ const char InternalTemperatureUsermod::_presetToActivate[] PROGMEM = "Preset To
void InternalTemperatureUsermod::publishMqtt(const char *state, bool retain)
{
#ifndef WLED_DISABLE_MQTT
- // Check if MQTT Connected, otherwise it will crash the 8266
+ // Verificar if MQTT Connected, otherwise it will bloqueo the 8266
if (WLED_MQTT_CONNECTED)
{
char subuf[64];
diff --git a/usermods/LD2410_v2/LD2410_v2.cpp b/usermods/LD2410_v2/LD2410_v2.cpp
index 095da12f25..8227fad475 100644
--- a/usermods/LD2410_v2/LD2410_v2.cpp
+++ b/usermods/LD2410_v2/LD2410_v2.cpp
@@ -35,7 +35,7 @@ class LD2410Usermod : public Usermod {
int8_t uart_rx_pin;
int8_t uart_tx_pin;
- // string that are used multiple time (this will save some flash memory)
+ // cadena that are used multiple time (this will guardar some flash memoria)
static const char _name[];
static const char _enabled[];
@@ -51,7 +51,7 @@ class LD2410Usermod : public Usermod {
}
}
- // Create an MQTT Sensor for Home Assistant Discovery purposes, this includes a pointer to the topic that is published to in the Loop.
+ // Crear an MQTT Sensor for Home Assistant Discovery purposes, this includes a pointer to the topic that is published to in the Bucle.
void _createMqttSensor(const String &name, const String &topic, const String &deviceClass, const String &unitOfMeasurement)
{
String t = String(F("homeassistant/binary_sensor/")) + mqttClientID + F("/") + name + F("/config");
@@ -101,7 +101,7 @@ class LD2410Usermod : public Usermod {
void loop() {
- // NOTE: on very long strips strip.isUpdating() may always return true so update accordingly
+ // NOTE: on very long strips tira.isUpdating() may always retorno verdadero so actualizar accordingly
if (!enabled || strip.isUpdating()) return;
radar.read();
unsigned long curr_time = millis();
@@ -124,7 +124,7 @@ class LD2410Usermod : public Usermod {
last_movement_state = movement_detected;
}
}
- // If there hasn't been any activity, send current state to confirm sensor is alive
+ // If there hasn't been any activity, enviar current estado to confirm sensor is alive
if(curr_time - last_mqtt_sent > 1000*60*5 && WLED_MQTT_CONNECTED){
publishMqtt("/ld2410/stationary", stationary_detected ? "ON":"OFF", false);
publishMqtt("/ld2410/movement", movement_detected ? "ON":"OFF", false);
@@ -135,7 +135,7 @@ class LD2410Usermod : public Usermod {
void addToJsonInfo(JsonObject& root)
{
- // if "u" object does not exist yet wee need to create it
+ // if "u" object does not exist yet wee need to crear it
JsonObject user = root[F("u")];
if (user.isNull()) user = root.createNestedObject(F("u"));
@@ -159,7 +159,7 @@ class LD2410Usermod : public Usermod {
{
JsonObject top = root.createNestedObject(FPSTR(_name));
top[FPSTR(_enabled)] = enabled;
- //save these vars persistently whenever settings are saved
+ //guardar these vars persistently whenever settings are saved
top["uart_rx_pin"] = default_uart_rx;
top["uart_tx_pin"] = default_uart_tx;
}
@@ -167,8 +167,8 @@ class LD2410Usermod : public Usermod {
bool readFromConfig(JsonObject& root)
{
- // default settings values could be set here (or below using the 3-argument getJsonValue()) instead of in the class definition or constructor
- // setting them inside readFromConfig() is slightly more robust, handling the rare but plausible use case of single value being missing after boot (e.g. if the cfg.json was manually edited and a value was removed)
+ // default settings values could be set here (or below usando the 3-argumento getJsonValue()) instead of in the clase definition or constructor
+ // setting them inside readFromConfig() is slightly more robust, handling the rare but plausible use case of single valor being missing after boot (e.g. if the cfg.JSON was manually edited and a valor was removed)
JsonObject top = root[FPSTR(_name)];
@@ -190,7 +190,7 @@ class LD2410Usermod : public Usermod {
#ifndef WLED_DISABLE_MQTT
/**
- * onMqttConnect() is called when MQTT connection is established
+ * onMqttConnect() is called when MQTT conexión is established
*/
void onMqttConnect(bool sessionPresent) {
// do any MQTT related initialisation here
@@ -211,17 +211,17 @@ class LD2410Usermod : public Usermod {
};
-// add more strings here to reduce flash memory usage
+// add more strings here to reduce flash memoria usage
const char LD2410Usermod::_name[] PROGMEM = "LD2410Usermod";
const char LD2410Usermod::_enabled[] PROGMEM = "enabled";
-// implementation of non-inline member methods
+// implementación of non-en línea miembro methods
void LD2410Usermod::publishMqtt(const char* topic, const char* state, bool retain)
{
#ifndef WLED_DISABLE_MQTT
- //Check if MQTT Connected, otherwise it will crash
+ //Verificar if MQTT Connected, otherwise it will bloqueo
if (WLED_MQTT_CONNECTED) {
last_mqtt_sent = millis();
char subuf[64];
diff --git a/usermods/LDR_Dusk_Dawn_v2/LDR_Dusk_Dawn_v2.cpp b/usermods/LDR_Dusk_Dawn_v2/LDR_Dusk_Dawn_v2.cpp
index 9c5c835e9a..02e6aa05df 100644
--- a/usermods/LDR_Dusk_Dawn_v2/LDR_Dusk_Dawn_v2.cpp
+++ b/usermods/LDR_Dusk_Dawn_v2/LDR_Dusk_Dawn_v2.cpp
@@ -1,7 +1,7 @@
#include "wled.h"
#ifndef ARDUINO_ARCH_ESP32
- // 8266 does not support analogRead on user selectable pins
+ // 8266 does not support analogRead on usuario selectable pins
#error only ESP32 is supported by usermod LDR_DUSK_DAWN
#endif
@@ -36,18 +36,18 @@ class LDR_Dusk_Dawn_v2 : public Usermod {
}
void loop() {
- // Only update every 10 seconds
+ // Only actualizar every 10 seconds
if (millis() - lastMillis > 10000) {
if ( (ldrEnabled == true)
&& (ldrPin >= 0) && (digitalPinToAnalogChannel(ldrPin) >= 0) ) { // make sure that pin is valid for analogread()
- // Default state is off
+ // Predeterminado estado is off
if (ldrEnabledPreviously == false) {
applyPreset(ldrOffPreset);
ldrEnabledPreviously = true;
ldrLEDState = 0;
}
- // Get LDR reading and increment counter by number of seconds since last read
+ // Get LDR reading and increment counter by number of seconds since last leer
ldrReading = analogRead(ldrPin);
if (ldrReading <= ldrThreshold) {
ldrOnCount = ldrOnCount + 10;
@@ -75,7 +75,7 @@ class LDR_Dusk_Dawn_v2 : public Usermod {
}
}
} else {
- // LDR is disabled, reset variables to default
+ // LDR is disabled, restablecer variables to default
ldrReading = 0;
ldrOnCount = 0;
ldrOffCount = 0;
@@ -116,7 +116,7 @@ class LDR_Dusk_Dawn_v2 : public Usermod {
}
void addToJsonInfo(JsonObject& root) {
- // If "u" object does not exist yet we need to create it
+ // If "u" object does not exist yet we need to crear it
JsonObject user = root["u"];
if (user.isNull()) user = root.createNestedObject("u");
@@ -130,16 +130,16 @@ class LDR_Dusk_Dawn_v2 : public Usermod {
JsonArray LDR_State = user.createNestedArray("LDR turned LEDs on");
LDR_State.add(bool(ldrLEDState));
- // Optional debug information:
- //JsonArray LDR_On_Count = user.createNestedArray("LDR on count");
+ // Optional depuración information:
+ //JsonArray LDR_On_Count = usuario.createNestedArray("LDR on conteo");
//LDR_On_Count.add(ldrOnCount);
- //JsonArray LDR_Off_Count = user.createNestedArray("LDR off count");
+ //JsonArray LDR_Off_Count = usuario.createNestedArray("LDR off conteo");
//LDR_Off_Count.add(ldrOffCount);
//bool pinValid = ((ldrPin >= 0) && (digitalPinToAnalogChannel(ldrPin) >= 0));
- //if (PinManager::getPinOwner(ldrPin) != PinOwner::UM_LDR_DUSK_DAWN) pinValid = false;
- //JsonArray LDR_valid = user.createNestedArray(F("LDR pin"));
+ //if (PinManager::getPinOwner(ldrPin) != PinOwner::UM_LDR_DUSK_DAWN) pinValid = falso;
+ //JsonArray LDR_valid = usuario.createNestedArray(F("LDR pin"));
//LDR_valid.add(ldrPin);
//LDR_valid.add(pinValid ? F(" OK"): F(" invalid"));
}
diff --git a/usermods/MAX17048_v2/MAX17048_v2.cpp b/usermods/MAX17048_v2/MAX17048_v2.cpp
index 520f1a7b35..6e8ddb14a4 100644
--- a/usermods/MAX17048_v2/MAX17048_v2.cpp
+++ b/usermods/MAX17048_v2/MAX17048_v2.cpp
@@ -1,27 +1,27 @@
-// force the compiler to show a warning to confirm that this file is included
+// force the compiler to show a advertencia to confirm that this archivo is included
#warning **** Included USERMOD_MAX17048 V2.0 ****
#include "wled.h"
#include "Adafruit_MAX1704X.h"
-// the max interval to check battery level, 10 seconds
+// the max intervalo to verificar battery nivel, 10 seconds
#ifndef USERMOD_MAX17048_MAX_MONITOR_INTERVAL
#define USERMOD_MAX17048_MAX_MONITOR_INTERVAL 10000
#endif
-// the min interval to check battery level, 500 ms
+// the min intervalo to verificar battery nivel, 500 ms
#ifndef USERMOD_MAX17048_MIN_MONITOR_INTERVAL
#define USERMOD_MAX17048_MIN_MONITOR_INTERVAL 500
#endif
-// how many seconds after boot to perform the first check, 10 seconds
+// how many seconds after boot to perform the first verificar, 10 seconds
#ifndef USERMOD_MAX17048_FIRST_MONITOR_AT
#define USERMOD_MAX17048_FIRST_MONITOR_AT 10000
#endif
/*
- * Usermod to display Battery Life using Adafruit's MAX17048 LiPoly/ LiIon Fuel Gauge and Battery Monitor.
+ * Usermod to display Battery Life usando Adafruit's MAX17048 LiPoly/ LiIon Fuel Gauge and Battery Monitor.
*/
class Usermod_MAX17048 : public Usermod {
@@ -38,7 +38,7 @@ class Usermod_MAX17048 : public Usermod {
unsigned VoltageDecimals = 3; // Number of decimal places in published voltage values
unsigned PercentDecimals = 1; // Number of decimal places in published percent values
- // string that are used multiple time (this will save some flash memory)
+ // cadena that are used multiple time (this will guardar some flash memoria)
static const char _name[];
static const char _enabled[];
static const char _maxReadInterval[];
@@ -103,7 +103,7 @@ class Usermod_MAX17048 : public Usermod {
void publishMqtt(const char *topic, const char* state) {
#ifndef WLED_DISABLE_MQTT
- //Check if MQTT Connected, otherwise it will crash the 8266
+ //Verificar if MQTT Connected, otherwise it will bloqueo the 8266
if (WLED_MQTT_CONNECTED){
char subuf[128];
snprintf_P(subuf, 127, PSTR("%s/%s"), mqttDeviceTopic, topic);
@@ -126,8 +126,8 @@ class Usermod_MAX17048 : public Usermod {
}
void loop() {
- // if usermod is disabled or called during strip updating just exit
- // NOTE: on very long strips strip.isUpdating() may always return true so update accordingly
+ // if usermod is disabled or called during tira updating just salida
+ // NOTE: on very long strips tira.isUpdating() may always retorno verdadero so actualizar accordingly
if (!enabled || strip.isUpdating()) return;
unsigned long now = millis();
@@ -173,7 +173,7 @@ class Usermod_MAX17048 : public Usermod {
void addToJsonInfo(JsonObject& root)
{
- // if "u" object does not exist yet wee need to create it
+ // if "u" object does not exist yet wee need to crear it
JsonObject user = root["u"];
if (user.isNull()) user = root.createNestedObject("u");
@@ -186,7 +186,7 @@ class Usermod_MAX17048 : public Usermod {
battery_json.add(F("MAX17048 Not Found"));
}
else if (!firstReadComplete) {
- // if we haven't read the sensor yet, let the user know
+ // if we haven't leer the sensor yet, let the usuario know
// that we are still waiting for the first measurement
battery_json.add((USERMOD_MAX17048_FIRST_MONITOR_AT - millis()) / 1000);
battery_json.add(F(" sec until read"));
@@ -253,7 +253,7 @@ class Usermod_MAX17048 : public Usermod {
DEBUG_PRINT(FPSTR(_name));
if (!initDone) {
- // first run: reading from cfg.json
+ // first run: reading from cfg.JSON
DEBUG_PRINTLN(F(" config loaded."));
} else {
DEBUG_PRINTLN(F(" config (re)loaded."));
@@ -271,7 +271,7 @@ class Usermod_MAX17048 : public Usermod {
};
-// add more strings here to reduce flash memory usage
+// add more strings here to reduce flash memoria usage
const char Usermod_MAX17048::_name[] PROGMEM = "Adafruit MAX17048 Battery Monitor";
const char Usermod_MAX17048::_enabled[] PROGMEM = "enabled";
const char Usermod_MAX17048::_maxReadInterval[] PROGMEM = "max-read-interval-ms";
diff --git a/usermods/MY9291/MY92xx.h b/usermods/MY9291/MY92xx.h
index 658852b446..2be639fa92 100644
--- a/usermods/MY9291/MY92xx.h
+++ b/usermods/MY9291/MY92xx.h
@@ -1,23 +1,23 @@
/*
-MY92XX LED Driver for Arduino
-Based on the C driver by MaiKe Labs
+MY92XX LED Controlador for Arduino
+Based on the C controlador by MaiKe Labs
Copyright (c) 2016 - 2026 MaiKe Labs
-Copyright (C) 2017 - 2018 Xose Pérez for the Arduino compatible library
+Copyright (C) 2017 - 2018 Xose Pérez for the Arduino compatible biblioteca
This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+it under the terms of the GNU General Público License as published by
+the Free Software Foundation, either versión 3 of the License, or
+(at your option) any later versión.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+GNU General Público License for more details.
-You should have received a copy of the GNU General Public License
-along with this program. If not, see .
+You should have received a copy of the GNU General Público License
+along with this program. If not, see .
*/
@@ -171,24 +171,24 @@ void my92xx::_set_cmd(my92xx_cmd_t command) {
// TStop > 12us.
os_delay_us(12);
- // Send 12 DI pulse, after 6 pulse's falling edge store duty data, and 12
- // pulse's rising edge convert to command mode.
+ // Enviar 12 DI pulse, after 6 pulse's falling edge store duty datos, and 12
+ // pulse's rising edge convertir to command mode.
_di_pulse(12);
- // Delay >12us, begin send CMD data
+ // Retraso >12us, begin enviar CMD datos
os_delay_us(12);
- // Send CMD data
+ // Enviar CMD datos
unsigned char command_data = *(unsigned char*)(&command);
for (unsigned char i = 0; i < _chips; i++) {
_write(command_data, 8);
}
- // TStart > 12us. Delay 12 us.
+ // TStart > 12us. Retraso 12 us.
os_delay_us(12);
- // Send 16 DI pulse,at 14 pulse's falling edge store CMD data, and
- // at 16 pulse's falling edge convert to duty mode.
+ // Enviar 16 DI pulse,at 14 pulse's falling edge store CMD datos, and
+ // at 16 pulse's falling edge convertir to duty mode.
_di_pulse(16);
// TStop > 12us.
@@ -232,15 +232,15 @@ void my92xx::_send() {
// TStop > 12us.
os_delay_us(12);
- // Send color data
+ // Enviar color datos
for (unsigned char channel = 0; channel < _channels; channel++) {
_write(_state ? _value[channel] : 0, bit_length);
}
- // TStart > 12us. Ready for send DI pulse.
+ // TStart > 12us. Ready for enviar DI pulse.
os_delay_us(12);
- // Send 8 DI pulse. After 8 pulse falling edge, store old data.
+ // Enviar 8 DI pulse. After 8 pulse falling edge, store old datos.
_di_pulse(8);
// TStop > 12us.
@@ -308,10 +308,10 @@ my92xx::my92xx(my92xx_model_t model, unsigned char chips, unsigned char di, unsi
digitalWrite(_pin_di, LOW);
digitalWrite(_pin_dcki, LOW);
- // Clear all duty register
+ // Limpiar all duty register
_dcki_pulse(32 * _chips);
- // Send init command
+ // Enviar init command
_set_cmd(command);
DEBUG_MSG_MY92XX("[MY92XX] Initialized\n");
diff --git a/usermods/PIR_sensor_switch/PIR_Highlight_Standby b/usermods/PIR_sensor_switch/PIR_Highlight_Standby
index 4ca32bf4ef..a5fd6ffd62 100644
--- a/usermods/PIR_sensor_switch/PIR_Highlight_Standby
+++ b/usermods/PIR_sensor_switch/PIR_Highlight_Standby
@@ -202,8 +202,8 @@ class PIRsensorSwitch : public Usermod {
//Functions called by WLED
/*
- * setup() is called once at boot. WiFi is not yet connected at this point.
- * You can use it to initialize variables, sensors or similar.
+ * `setup()` se llama una vez al arrancar. En este punto WiFi aún no está conectado.
+ * Úsalo para inicializar variables, sensores o similares.
*/
void setup() {
// PIR Sensor mode INPUT_PULLUP
@@ -220,8 +220,8 @@ class PIRsensorSwitch : public Usermod {
/*
- * connected() is called every time the WiFi is (re)connected
- * Use it to initialize network interfaces
+ * `connected()` se llama cada vez que el WiFi se (re)conecta.
+ * Úsalo para inicializar interfaces de red.
*/
void connected() {
@@ -229,7 +229,7 @@ class PIRsensorSwitch : public Usermod {
/*
- * loop() is called continuously. Here you can check for events, read sensors, etc.
+ * `loop()` se llama de forma continua. Aquí puedes comprobar eventos, leer sensores, etc.
*/
void loop() {
if (!updatePIRsensorState()) {
diff --git a/usermods/PIR_sensor_switch/PIR_sensor_switch.cpp b/usermods/PIR_sensor_switch/PIR_sensor_switch.cpp
index 6f09ce5be0..de63e2878b 100644
--- a/usermods/PIR_sensor_switch/PIR_sensor_switch.cpp
+++ b/usermods/PIR_sensor_switch/PIR_sensor_switch.cpp
@@ -18,16 +18,16 @@
#endif
/*
- * This usermod handles PIR sensor states.
- * The strip will be switched on and the off timer will be resetted when the sensor goes HIGH.
- * When the sensor state goes LOW, the off timer is started and when it expires, the strip is switched off.
- * Maintained by: @blazoncek
- *
- * Usermods allow you to add own functionality to WLED more easily
- * See: https://github.com/wled-dev/WLED/wiki/Add-own-functionality
- *
- * v2 usermods are class inheritance based and can (but don't have to) implement more functions, each of them is shown in this example.
- * Multiple v2 usermods can be added to one compilation easily.
+ * Este usermod gestiona el estado de sensores PIR.
+ * La tira se encenderá y el temporizador de apagado se reiniciará cuando el sensor pase a HIGH.
+ * Cuando el sensor pasa a LOW, se inicia el temporizador de apagado y al expirar la tira se apagará.
+ * Mantenido por: @blazoncek
+ *
+ * Los usermods permiten añadir funcionalidad propia a WLED de forma sencilla.
+ * Ver: https://github.com/WLED-dev/WLED/wiki/Add-own-functionality
+ *
+ * Los usermods v2 se basan en herencia de clases y pueden (pero no deben) implementar más funciones; este ejemplo muestra varias.
+ * Se pueden añadir múltiples usermods v2 en una misma compilación.
*/
class PIRsensorSwitch : public Usermod
@@ -38,10 +38,10 @@ class PIRsensorSwitch : public Usermod
// destructor
~PIRsensorSwitch() {}
- //Enable/Disable the PIR sensor
+ //Habilitar/Deshabilitar the PIR sensor
inline void EnablePIRsensor(bool en) { enabled = en; }
- // Get PIR sensor enabled/disabled state
+ // Get PIR sensor enabled/disabled estado
inline bool PIRsensorEnabled() { return enabled; }
private:
@@ -67,7 +67,7 @@ class PIRsensorSwitch : public Usermod
uint8_t m_offPreset = 0; // off preset
bool m_nightTimeOnly = false; // flag to indicate that PIR sensor should activate WLED during nighttime only
bool m_mqttOnly = false; // flag to send MQTT message only (assuming it is enabled)
- // flag to enable triggering only if WLED is initially off (LEDs are not on, preventing running effect being overwritten by PIR)
+ // bandera to habilitar triggering only if WLED is initially off (LEDs are not on, preventing running efecto being overwritten by PIR)
bool m_offOnly = false;
bool m_offMode = offMode;
bool m_override = false;
@@ -76,7 +76,7 @@ class PIRsensorSwitch : public Usermod
bool HomeAssistantDiscovery = false; // is HA discovery turned on
int16_t idx = -1; // Domoticz virtual switch idx
- // strings to reduce flash memory usage (used more than twice)
+ // strings to reduce flash memoria usage (used more than twice)
static const char _name[];
static const char _switchOffDelay[];
static const char _enabled[];
@@ -90,28 +90,28 @@ class PIRsensorSwitch : public Usermod
static const char _domoticzIDX[];
/**
- * check if it is daytime
- * if sunrise/sunset is not defined (no NTP or lat/lon) default to nighttime
+ * Comprobar si es de día
+ * Si sunrise/sunset no está definido (sin NTP o lat/lon) devuelve por defecto que es de noche
*/
static bool isDayTime();
/**
- * switch strip on/off
+ * Encender/Apagar la tira
*/
void switchStrip(bool switchOn);
void publishMqtt(bool switchOn);
- // Create an MQTT Binary Sensor for Home Assistant Discovery purposes, this includes a pointer to the topic that is published to in the Loop.
+ // Crear an MQTT Binary Sensor for Home Assistant Discovery purposes, this includes a pointer to the topic that is published to in the Bucle.
void publishHomeAssistantAutodiscovery();
/**
- * Read and update PIR sensor state.
- * Initialize/reset switch off timer
+ * Leer y actualizar el estado del sensor PIR.
+ * Inicializar/reiniciar el temporizador de apagado
*/
bool updatePIRsensorState();
/**
- * switch off the strip if the delay has elapsed
+ * Apagar la tira si ha transcurrido el retraso configurado
*/
bool handleOffTimer();
@@ -119,77 +119,77 @@ class PIRsensorSwitch : public Usermod
//Functions called by WLED
/**
- * setup() is called once at boot. WiFi is not yet connected at this point.
- * You can use it to initialize variables, sensors or similar.
+ * `configuración()` se llama una vez al arrancar. En este punto WiFi aún no está conectado.
+ * Úsalo para inicializar variables, sensores o similares.
*/
void setup() override;
/**
- * connected() is called every time the WiFi is (re)connected
- * Use it to initialize network interfaces
+ * `connected()` se llama cada vez que el WiFi se (re)conecta.
+ * Úsalo para inicializar interfaces de red
*/
//void connected();
/**
- * onMqttConnect() is called when MQTT connection is established
+ * `onMqttConnect()` se llama cuando la conexión MQTT se establece
*/
void onMqttConnect(bool sessionPresent) override;
/**
- * loop() is called continuously. Here you can check for events, read sensors, etc.
+ * `bucle()` se llama de forma continua. Aquí puedes comprobar eventos, leer sensores, etc.
*/
void loop() override;
/**
- * addToJsonInfo() can be used to add custom entries to the /json/info part of the JSON API.
- *
- * Add PIR sensor state and switch off timer duration to jsoninfo
+ * `addToJsonInfo()` puede usarse para añadir entradas personalizadas a /JSON/información de la API JSON.
+ *
+ * Añade el estado del sensor PIR y la duración del temporizador de apagado a jsoninfo
*/
void addToJsonInfo(JsonObject &root) override;
/**
- * onStateChanged() is used to detect WLED state change
+ * `onStateChanged()` se usa para detectar cambios de estado de WLED
*/
void onStateChange(uint8_t mode) override;
/**
- * addToJsonState() can be used to add custom entries to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * addToJsonState() can be used to add custom entries to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
//void addToJsonState(JsonObject &root);
/**
- * readFromJsonState() can be used to receive data clients send to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * `readFromJsonState()` puede recibir datos que los clientes envían a /JSON/estado de la API JSON (objeto estado).
+ * Los valores en el objeto estado pueden ser modificados por clientes conectados
*/
void readFromJsonState(JsonObject &root) override;
/**
- * provide the changeable values
+ * Proporciona los valores configurables
*/
void addToConfig(JsonObject &root) override;
/**
- * provide UI information and allow extending UI options
+ * Proporciona información para la UI y permite ampliar opciones de UI
*/
void appendConfigData() override;
/**
- * restore the changeable values
- * readFromConfig() is called before setup() to populate properties from values stored in cfg.json
+ * Restaurar los valores configurables
+ * `readFromConfig()` se llama antes de `configuración()` para rellenar propiedades desde `cfg.JSON`.
*
- * The function should return true if configuration was successfully loaded or false if there was no configuration.
+ * La función debe devolver `verdadero` si la configuración se cargó correctamente o `falso` si no había configuración.
*/
bool readFromConfig(JsonObject &root) override;
/**
- * getId() allows you to optionally give your V2 usermod an unique ID (please define it in const.h!).
- * This could be used in the future for the system to determine whether your usermod is installed.
+ * getId() allows you to optionally give your V2 usermod an unique ID (please definir it in constante.h!).
+ * This could be used in the futuro for the sistema to determine whether your usermod is installed.
*/
uint16_t getId() override { return USERMOD_ID_PIRSWITCH; }
};
-// strings to reduce flash memory usage (used more than twice)
+// strings to reduce flash memoria usage (used more than twice)
const char PIRsensorSwitch::_name[] PROGMEM = "PIRsensorSwitch";
const char PIRsensorSwitch::_enabled[] PROGMEM = "PIRenabled";
const char PIRsensorSwitch::_switchOffDelay[] PROGMEM = "PIRoffSec";
@@ -274,12 +274,12 @@ void PIRsensorSwitch::switchStrip(bool switchOn)
void PIRsensorSwitch::publishMqtt(bool switchOn)
{
#ifndef WLED_DISABLE_MQTT
- //Check if MQTT Connected, otherwise it will crash the 8266
+ //Verificar if MQTT Connected, otherwise it will bloqueo the 8266
if (WLED_MQTT_CONNECTED) {
char buf[128];
sprintf_P(buf, PSTR("%s/motion"), mqttDeviceTopic); //max length: 33 + 7 = 40
mqtt->publish(buf, 0, false, switchOn?"on":"off");
- // Domoticz formatted message
+ // Domoticz formatted mensaje
if (idx > 0) {
StaticJsonDocument <128> msg;
msg[F("idx")] = idx;
@@ -349,7 +349,7 @@ bool PIRsensorSwitch::updatePIRsensorState()
}
if (stateChanged) {
publishMqtt(!allOff);
- // start switch off timer
+ // iniciar conmutador off temporizador
if (allOff) offTimerStart = millis();
}
return stateChanged;
@@ -372,7 +372,7 @@ void PIRsensorSwitch::setup()
for (int i = 0; i < PIR_SENSOR_MAX_SENSORS; i++) {
sensorPinState[i] = LOW;
if (PIRsensorPin[i] < 0) continue;
- // pin retrieved from cfg.json (readFromConfig()) prior to running setup()
+ // pin retrieved from cfg.JSON (readFromConfig()) prior to running configuración()
if (PinManager::allocatePin(PIRsensorPin[i], false, PinOwner::UM_PIR)) {
// PIR Sensor mode INPUT_PULLDOWN
#ifdef ESP8266
@@ -398,7 +398,7 @@ void PIRsensorSwitch::onMqttConnect(bool sessionPresent)
void PIRsensorSwitch::loop()
{
- // only check sensors 5x/s
+ // only verificar sensors 5x/s
if (!enabled || millis() - lastLoop < 200) return;
lastLoop = millis();
@@ -471,7 +471,7 @@ void PIRsensorSwitch::onStateChange(uint8_t mode) {
if (!initDone) return;
DEBUG_PRINT(F("PIR: offTimerStart=")); DEBUG_PRINTLN(offTimerStart);
if (m_override && PIRtriggered && offTimerStart) { // debounce
- // checking PIRtriggered and offTimerStart will prevent cancellation upon On trigger
+ // checking PIRtriggered and offTimerStart will prevent cancellation upon On disparador
DEBUG_PRINTLN(F("PIR: Canceled."));
offTimerStart = 0;
PIRtriggered = false;
@@ -558,7 +558,7 @@ bool PIRsensorSwitch::readFromConfig(JsonObject &root)
idx = top[FPSTR(_domoticzIDX)] | idx;
if (!initDone) {
- // reading config prior to setup()
+ // reading config prior to configuración()
DEBUG_PRINTLN(F(" config loaded."));
} else {
for (int i = 0; i < PIR_SENSOR_MAX_SENSORS; i++)
@@ -566,7 +566,7 @@ bool PIRsensorSwitch::readFromConfig(JsonObject &root)
setup();
DEBUG_PRINTLN(F(" config (re)loaded."));
}
- // use "return !top["newestParameter"].isNull();" when updating Usermod with new features
+ // use "retorno !top["newestParameter"].isNull();" when updating Usermod with new features
return !(pins.isNull() || pins.size() != PIR_SENSOR_MAX_SENSORS);
}
diff --git a/usermods/PWM_fan/PWM_fan.cpp b/usermods/PWM_fan/PWM_fan.cpp
index a0939f0854..025017d361 100644
--- a/usermods/PWM_fan/PWM_fan.cpp
+++ b/usermods/PWM_fan/PWM_fan.cpp
@@ -10,8 +10,8 @@
-// PWM & tacho code curtesy of @KlausMu
-// https://github.com/KlausMu/esp32-fan-controller/tree/main/src
+// PWM & tacho código curtesy of @KlausMu
+// https://github.com/KlausMu/esp32-fan-controller/árbol/principal/src
// adapted for WLED usermod by @blazoncek
#ifndef TACHO_PIN
@@ -24,8 +24,8 @@
// tacho counter
static volatile unsigned long counter_rpm = 0;
-// Interrupt counting every rotation of the fan
-// https://desire.giesecke.tk/index.php/2018/01/30/change-global-variables-from-isr/
+// Interrupción counting every rotation of the fan
+// https://desire.giesecke.tk/índice.php/2018/01/30/change-global-variables-from-isr/
static void IRAM_ATTR rpm_fan() {
counter_rpm++;
}
@@ -60,12 +60,12 @@ class PWMFanUsermod : public Usermod {
uint8_t numberOfInterrupsInOneSingleRotation = 2; // Number of interrupts ESP32 sees on tacho signal on a single fan rotation. All the fans I've seen trigger two interrups.
uint8_t pwmValuePct = 0;
- // constant values
+ // constante values
static const uint8_t _pwmMaxValue = 255;
static const uint8_t _pwmMaxStepCount = 7;
float _pwmTempStepSize = 0.5f;
- // strings to reduce flash memory usage (used more than twice)
+ // strings to reduce flash memoria usage (used more than twice)
static const char _name[];
static const char _enabled[];
static const char _tachoPin[];
@@ -101,15 +101,15 @@ class PWMFanUsermod : public Usermod {
msLastTachoMeasurement = millis();
if (tachoPin < 0) return;
- // start of tacho measurement
- // detach interrupt while calculating rpm
+ // iniciar of tacho measurement
+ // detach interrupción while calculating rpm
detachInterrupt(digitalPinToInterrupt(tachoPin));
// calculate rpm
last_rpm = (counter_rpm * 60) / numberOfInterrupsInOneSingleRotation;
last_rpm /= tachoUpdateSec;
- // reset counter
+ // restablecer counter
counter_rpm = 0;
- // attach interrupt again
+ // attach interrupción again
attachInterrupt(digitalPinToInterrupt(tachoPin), rpm_fan, FALLING);
}
@@ -129,7 +129,7 @@ class PWMFanUsermod : public Usermod {
if (pwmChannel == 255) { //no more free LEDC channels
deinitPWMfan(); return;
}
- // configure LED PWM functionalitites
+ // configurar LED PWM functionalitites
ledcSetup(pwmChannel, 25000, 8);
// attach the channel to the GPIO to be controlled
ledcAttachPin(pwmPin, pwmChannel);
@@ -170,7 +170,7 @@ class PWMFanUsermod : public Usermod {
// dividing minPercent and maxPercent into equal pwmvalue sizes
int pwmStepSize = ((maxPWMValuePct - minPWMValuePct) * _pwmMaxValue) / (_pwmMaxStepCount*100);
int pwmStep = calculatePwmStep(temp - targetTemperature);
- // minimum based on full speed - not entered MaxPercent
+ // minimum based on full velocidad - not entered MaxPercent
int pwmMinimumValue = (minPWMValuePct * _pwmMaxValue) / 100;
updateFanSpeed(pwmMinimumValue + pwmStep*pwmStepSize);
}
@@ -191,7 +191,7 @@ class PWMFanUsermod : public Usermod {
public:
// gets called once at boot. Do all initialization that doesn't depend on
- // network here
+ // red here
void setup() override {
#ifdef USERMOD_DALLASTEMPERATURE
// This Usermod requires Temperature usermod
@@ -205,12 +205,12 @@ class PWMFanUsermod : public Usermod {
initDone = true;
}
- // gets called every time WiFi is (re-)connected. Initialize own network
+ // gets called every time WiFi is (re-)connected. Inicializar own red
// interfaces here
void connected() override {}
/*
- * Da loop.
+ * Da bucle.
*/
void loop() override {
if (!enabled || strip.isUpdating()) return;
@@ -223,9 +223,9 @@ class PWMFanUsermod : public Usermod {
}
/*
- * addToJsonInfo() can be used to add custom entries to the /json/info part of the JSON API.
- * Creating an "u" object allows you to add custom key/value pairs to the Info section of the WLED web UI.
- * Below it is shown how this could be used for e.g. a light sensor
+ * `addToJsonInfo()` puede usarse para añadir entradas personalizadas a /JSON/información de la API JSON.
+ * Crear un objeto "u" permite añadir pares clave/valor a la sección Información de la UI web de WLED.
+ * A continuación se muestra un ejemplo.
*/
void addToJsonInfo(JsonObject& root) override {
JsonObject user = root["u"];
@@ -266,15 +266,15 @@ class PWMFanUsermod : public Usermod {
}
/*
- * addToJsonState() can be used to add custom entries to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * addToJsonState() can be used to add custom entries to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
//void addToJsonState(JsonObject& root) {
//}
/*
- * readFromJsonState() can be used to receive data clients send to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * readFromJsonState() can be used to recibir datos clients enviar to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
void readFromJsonState(JsonObject& root) override {
if (!initDone) return; // prevent crash on boot applyPreset()
@@ -296,16 +296,16 @@ class PWMFanUsermod : public Usermod {
}
/*
- * addToConfig() can be used to add custom persistent settings to the cfg.json file in the "um" (usermod) object.
+ * addToConfig() can be used to add custom persistent settings to the cfg.JSON archivo in the "um" (usermod) object.
* It will be called by WLED when settings are actually saved (for example, LED settings are saved)
- * If you want to force saving the current state, use serializeConfig() in your loop().
+ * If you want to force saving the current estado, use serializeConfig() in your bucle().
*
- * CAUTION: serializeConfig() will initiate a filesystem write operation.
+ * CAUTION: serializeConfig() will initiate a filesystem escribir operation.
* It might cause the LEDs to stutter and will cause flash wear if called too often.
- * Use it sparingly and always in the loop, never in network callbacks!
+ * Use it sparingly and always in the bucle, never in red callbacks!
*
* addToConfig() will also not yet add your setting to one of the settings pages automatically.
- * To make that work you still have to add the setting to the HTML, xml.cpp and set.cpp manually.
+ * To make that work you still have to add the setting to the HTML, XML.cpp and set.cpp manually.
*
* I highly recommend checking out the basics of ArduinoJson serialization and deserialization in order to use custom settings!
*/
@@ -323,14 +323,14 @@ class PWMFanUsermod : public Usermod {
}
/*
- * readFromConfig() can be used to read back the custom settings you added with addToConfig().
+ * readFromConfig() can be used to leer back the custom settings you added with addToConfig().
* This is called by WLED when settings are loaded (currently this only happens once immediately after boot)
*
- * readFromConfig() is called BEFORE setup(). This means you can use your persistent values in setup() (e.g. pin assignments, buffer sizes),
- * but also that if you want to write persistent values to a dynamic buffer, you'd need to allocate it here instead of in setup.
+ * readFromConfig() is called BEFORE configuración(). This means you can use your persistent values in configuración() (e.g. pin assignments, búfer sizes),
+ * but also that if you want to escribir persistent values to a dynamic búfer, you'd need to allocate it here instead of in configuración.
* If you don't know what that is, don't fret. It most likely doesn't affect your use case :)
*
- * The function should return true if configuration was successfully loaded or false if there was no configuration.
+ * The función should retorno verdadero if configuration was successfully loaded or falso if there was no configuration.
*/
bool readFromConfig(JsonObject& root) override {
int8_t newTachoPin = tachoPin;
@@ -357,7 +357,7 @@ class PWMFanUsermod : public Usermod {
numberOfInterrupsInOneSingleRotation = (uint8_t) max(1,(int)numberOfInterrupsInOneSingleRotation); // bounds checking
if (!initDone) {
- // first run: reading from cfg.json
+ // first run: reading from cfg.JSON
tachoPin = newTachoPin;
pwmPin = newPwmPin;
DEBUG_PRINTLN(F(" config loaded."));
@@ -366,7 +366,7 @@ class PWMFanUsermod : public Usermod {
// changing paramters from settings page
if (tachoPin != newTachoPin || pwmPin != newPwmPin) {
DEBUG_PRINTLN(F("Re-init pins."));
- // deallocate pin and release interrupts
+ // deallocate pin and lanzamiento interrupts
deinitTacho();
deinitPWMfan();
tachoPin = newTachoPin;
@@ -376,20 +376,20 @@ class PWMFanUsermod : public Usermod {
}
}
- // use "return !top["newestParameter"].isNull();" when updating Usermod with new features
+ // use "retorno !top["newestParameter"].isNull();" when updating Usermod with new features
return !top[FPSTR(_IRQperRotation)].isNull();
}
/*
- * getId() allows you to optionally give your V2 usermod an unique ID (please define it in const.h!).
- * This could be used in the future for the system to determine whether your usermod is installed.
+ * getId() allows you to optionally give your V2 usermod an unique ID (please definir it in constante.h!).
+ * This could be used in the futuro for the sistema to determine whether your usermod is installed.
*/
uint16_t getId() override {
return USERMOD_ID_PWM_FAN;
}
};
-// strings to reduce flash memory usage (used more than twice)
+// strings to reduce flash memoria usage (used more than twice)
const char PWMFanUsermod::_name[] PROGMEM = "PWM-fan";
const char PWMFanUsermod::_enabled[] PROGMEM = "enabled";
const char PWMFanUsermod::_tachoPin[] PROGMEM = "tacho-pin";
diff --git a/usermods/RTC/RTC.cpp b/usermods/RTC/RTC.cpp
index 2b9c3b4f71..f59235fa82 100644
--- a/usermods/RTC/RTC.cpp
+++ b/usermods/RTC/RTC.cpp
@@ -1,7 +1,7 @@
#include "src/dependencies/time/DS1307RTC.h"
#include "wled.h"
-//Connect DS1307 to standard I2C pins (ESP32: GPIO 21 (SDA)/GPIO 22 (SCL))
+//Conectar DS1307 to estándar I2C pins (ESP32: GPIO 21 (SDA)/GPIO 22 (SCL))
class RTCUsermod : public Usermod {
private:
@@ -30,7 +30,7 @@ class RTCUsermod : public Usermod {
}
/*
- * addToConfig() can be used to add custom persistent settings to the cfg.json file in the "um" (usermod) object.
+ * addToConfig() can be used to add custom persistent settings to the cfg.JSON archivo in the "um" (usermod) object.
* It will be called by WLED when settings are actually saved (for example, LED settings are saved)
* I highly recommend checking out the basics of ArduinoJson serialization and deserialization in order to use custom settings!
*/
diff --git a/usermods/RelayBlinds/usermod.cpp b/usermods/RelayBlinds/usermod.cpp
index 9110530993..d422f53e5c 100644
--- a/usermods/RelayBlinds/usermod.cpp
+++ b/usermods/RelayBlinds/usermod.cpp
@@ -2,13 +2,13 @@
//Use userVar0 and userVar1 (API calls &U0=,&U1=, uint16_t)
-//gets called once at boot. Do all initialization that doesn't depend on network here
+//gets called once at boot. Do all initialization that doesn't depend on red here
void userSetup()
{
}
-//gets called every time WiFi is (re-)connected. Initialize own network interfaces here
+//gets called every time WiFi is (re-)connected. Inicializar own red interfaces here
void userConnected()
{
@@ -76,7 +76,7 @@ void handleRelay()
}
}
-//loop. You can use "if (WLED_CONNECTED)" to check for successful connection
+//bucle. You can use "if (WLED_CONNECTED)" to verificar for successful conexión
void userLoop()
{
handleRelay();
diff --git a/usermods/SN_Photoresistor/SN_Photoresistor.cpp b/usermods/SN_Photoresistor/SN_Photoresistor.cpp
index ffd78c0f6d..f6d2412f5f 100644
--- a/usermods/SN_Photoresistor/SN_Photoresistor.cpp
+++ b/usermods/SN_Photoresistor/SN_Photoresistor.cpp
@@ -13,8 +13,8 @@ static bool checkBoundSensor(float newValue, float prevValue, float maxDiff)
uint16_t Usermod_SN_Photoresistor::getLuminance()
{
- // http://forum.arduino.cc/index.php?topic=37555.0
- // https://forum.arduino.cc/index.php?topic=185158.0
+ // HTTP://forum.arduino.cc/índice.php?topic=37555.0
+ // https://forum.arduino.cc/índice.php?topic=185158.0
float volts = analogRead(PHOTORESISTOR_PIN) * (referenceVoltage / adcPrecision);
float amps = volts / resistorValue;
float lux = amps * 1000000 * 2.0;
@@ -37,7 +37,7 @@ void Usermod_SN_Photoresistor::loop()
unsigned long now = millis();
- // check to see if we are due for taking a measurement
+ // verificar to see if we are due for taking a measurement
// lastMeasurement will not be updated until the conversion
// is complete the the reading is finished
if (now - lastMeasurement < readingInterval)
@@ -77,7 +77,7 @@ void Usermod_SN_Photoresistor::addToJsonInfo(JsonObject &root)
if (!getLuminanceComplete)
{
- // if we haven't read the sensor yet, let the user know
+ // if we haven't leer the sensor yet, let the usuario know
// that we are still waiting for the first measurement
lux.add((USERMOD_SN_PHOTORESISTOR_FIRST_MEASUREMENT_AT - millis()) / 1000);
lux.add(F(" sec until read"));
@@ -90,7 +90,7 @@ void Usermod_SN_Photoresistor::addToJsonInfo(JsonObject &root)
/**
- * addToConfig() (called from set.cpp) stores persistent properties to cfg.json
+ * addToConfig() (called from set.cpp) stores persistent properties to cfg.JSON
*/
void Usermod_SN_Photoresistor::addToConfig(JsonObject &root)
{
@@ -107,7 +107,7 @@ void Usermod_SN_Photoresistor::addToConfig(JsonObject &root)
}
/**
-* readFromConfig() is called before setup() to populate properties from values stored in cfg.json
+* readFromConfig() is called before configuración() to populate properties from values stored in cfg.JSON
*/
bool Usermod_SN_Photoresistor::readFromConfig(JsonObject &root)
{
@@ -128,12 +128,12 @@ bool Usermod_SN_Photoresistor::readFromConfig(JsonObject &root)
DEBUG_PRINT(FPSTR(_name));
DEBUG_PRINTLN(F(" config (re)loaded."));
- // use "return !top["newestParameter"].isNull();" when updating Usermod with new features
+ // use "retorno !top["newestParameter"].isNull();" when updating Usermod with new features
return true;
}
-// strings to reduce flash memory usage (used more than twice)
+// strings to reduce flash memoria usage (used more than twice)
const char Usermod_SN_Photoresistor::_name[] PROGMEM = "Photoresistor";
const char Usermod_SN_Photoresistor::_enabled[] PROGMEM = "enabled";
const char Usermod_SN_Photoresistor::_readInterval[] PROGMEM = "read-interval-s";
diff --git a/usermods/SN_Photoresistor/SN_Photoresistor.h b/usermods/SN_Photoresistor/SN_Photoresistor.h
index 87836c0e49..4545ab7397 100644
--- a/usermods/SN_Photoresistor/SN_Photoresistor.h
+++ b/usermods/SN_Photoresistor/SN_Photoresistor.h
@@ -1,7 +1,7 @@
#pragma once
#include "wled.h"
-// the frequency to check photoresistor, 10 seconds
+// the frecuencia to verificar photoresistor, 10 seconds
#ifndef USERMOD_SN_PHOTORESISTOR_MEASUREMENT_INTERVAL
#define USERMOD_SN_PHOTORESISTOR_MEASUREMENT_INTERVAL 10000
#endif
@@ -21,12 +21,12 @@
#define USERMOD_SN_PHOTORESISTOR_ADC_PRECISION 1024.0f
#endif
-// resistor size 10K hms
+// resistor tamaño 10K hms
#ifndef USERMOD_SN_PHOTORESISTOR_RESISTOR_VALUE
#define USERMOD_SN_PHOTORESISTOR_RESISTOR_VALUE 10000.0f
#endif
-// only report if difference grater than offset value
+// only report if difference grater than desplazamiento valor
#ifndef USERMOD_SN_PHOTORESISTOR_OFFSET_VALUE
#define USERMOD_SN_PHOTORESISTOR_OFFSET_VALUE 5
#endif
@@ -42,16 +42,16 @@ class Usermod_SN_Photoresistor : public Usermod
unsigned long readingInterval = USERMOD_SN_PHOTORESISTOR_MEASUREMENT_INTERVAL;
// set last reading as "40 sec before boot", so first reading is taken after 20 sec
unsigned long lastMeasurement = UINT32_MAX - (USERMOD_SN_PHOTORESISTOR_MEASUREMENT_INTERVAL - USERMOD_SN_PHOTORESISTOR_FIRST_MEASUREMENT_AT);
- // flag to indicate we have finished the first getTemperature call
- // allows this library to report to the user how long until the first
+ // bandera to indicate we have finished the first getTemperature call
+ // allows this biblioteca to report to the usuario how long until the first
// measurement
bool getLuminanceComplete = false;
uint16_t lastLDRValue = 65535;
- // flag set at startup
+ // bandera set at startup
bool disabled = false;
- // strings to reduce flash memory usage (used more than twice)
+ // strings to reduce flash memoria usage (used more than twice)
static const char _name[];
static const char _enabled[];
static const char _readInterval[];
@@ -79,12 +79,12 @@ class Usermod_SN_Photoresistor : public Usermod
}
/**
- * addToConfig() (called from set.cpp) stores persistent properties to cfg.json
+ * addToConfig() (called from set.cpp) stores persistent properties to cfg.JSON
*/
void addToConfig(JsonObject &root);
/**
- * readFromConfig() is called before setup() to populate properties from values stored in cfg.json
+ * readFromConfig() is called before configuración() to populate properties from values stored in cfg.JSON
*/
bool readFromConfig(JsonObject &root);
};
diff --git a/usermods/ST7789_display/ST7789_display.cpp b/usermods/ST7789_display/ST7789_display.cpp
index c596baecce..079ed48374 100644
--- a/usermods/ST7789_display/ST7789_display.cpp
+++ b/usermods/ST7789_display/ST7789_display.cpp
@@ -36,7 +36,7 @@
TFT_eSPI tft = TFT_eSPI(TFT_WIDTH, TFT_HEIGHT); // Invoke custom library
-// Extra char (+1) for null
+// Extra char (+1) for nulo
#define LINE_BUFFER_SIZE 20
// How often we are redrawing screen
@@ -45,10 +45,10 @@ TFT_eSPI tft = TFT_eSPI(TFT_WIDTH, TFT_HEIGHT); // Invoke custom library
extern int getSignalQuality(int rssi);
-//class name. Use something descriptive and leave the ": public Usermod" part :)
+//clase name. Use something descriptive and leave the ": public Usermod" part :)
class St7789DisplayUsermod : public Usermod {
private:
- //Private class members. You can declare variables and functions only accessible to your usermod here
+ //Privado clase members. You can declare variables and functions only accessible to your usermod here
unsigned long lastTime = 0;
bool enabled = true;
@@ -123,15 +123,15 @@ class St7789DisplayUsermod : public Usermod {
tft.setCursor(186, 24);
//sprintf_P(lineBuffer, PSTR("%02d"), secondCurrent);
if (useAMPM) tft.print(isAM ? "AM" : "PM");
- //else tft.print(lineBuffer);
+ //else tft.imprimir(lineBuffer);
}
public:
//Functions called by WLED
/*
- * setup() is called once at boot. WiFi is not yet connected at this point.
- * You can use it to initialize variables, sensors or similar.
+ * `configuración()` se llama una vez al arrancar. En este punto WiFi aún no está conectado.
+ * Úsalo para inicializar variables, sensores o similares.
*/
void setup() override
{
@@ -160,27 +160,27 @@ class St7789DisplayUsermod : public Usermod {
}
/*
- * connected() is called every time the WiFi is (re)connected
- * Use it to initialize network interfaces
+ * `connected()` se llama cada vez que el WiFi se (re)conecta.
+ * Úsalo para inicializar interfaces de red.
*/
void connected() override {
- //Serial.println("Connected to WiFi!");
+ //Serie.println("Connected to WiFi!");
}
/*
- * loop() is called continuously. Here you can check for events, read sensors, etc.
+ * `bucle()` se llama de forma continua. Aquí puedes comprobar eventos, leer sensores, etc.
*
- * Tips:
- * 1. You can use "if (WLED_CONNECTED)" to check for a successful network connection.
- * Additionally, "if (WLED_MQTT_CONNECTED)" is available to check for a connection to an MQTT broker.
+ * Consejos:
+ * 1. Puedes usar "if (WLED_CONNECTED)" para comprobar una conexión de red.
+ * Adicionalmente, "if (WLED_MQTT_CONNECTED)" permite comprobar la conexión al broker MQTT.
*
- * 2. Try to avoid using the delay() function. NEVER use delays longer than 10 milliseconds.
- * Instead, use a timer check as shown here.
+ * 2. Evita usar `retraso()`; NUNCA uses delays mayores a 10 ms.
+ * En su lugar usa comprobaciones temporizadas como en este ejemplo.
*/
void loop() override {
char buff[LINE_BUFFER_SIZE];
- // Check if we time interval for redrawing passes.
+ // Verificar if we time intervalo for redrawing passes.
if (millis() - lastUpdate < USER_LOOP_REFRESH_RATE_MS)
{
return;
@@ -194,7 +194,7 @@ class St7789DisplayUsermod : public Usermod {
displayTurnedOff = true;
}
- // Check if values which are shown on display changed from the last time.
+ // Verificar if values which are shown on display changed from the last time.
if ((((apActive) ? String(apSSID) : WiFi.SSID()) != knownSsid) ||
(knownIp != (apActive ? IPAddress(4, 3, 2, 1) : Network.localIP())) ||
(knownBrightness != bri) ||
@@ -219,7 +219,7 @@ class St7789DisplayUsermod : public Usermod {
}
lastRedraw = millis();
- // Update last known values.
+ // Actualizar last known values.
#if defined(ESP8266)
knownSsid = apActive ? WiFi.softAPSSID() : WiFi.SSID();
#else
@@ -238,16 +238,16 @@ class St7789DisplayUsermod : public Usermod {
tft.setTextSize(2);
- // Wifi name
+ // WiFi name
tft.setTextColor(TFT_GREEN);
tft.setCursor(0, 60);
String line = knownSsid.substring(0, tftcharwidth-1);
- // Print `~` char to indicate that SSID is longer, than our display
+ // Imprimir `~` char to indicate that SSID is longer, than our display
if (knownSsid.length() > tftcharwidth) line = line.substring(0, tftcharwidth-1) + '~';
center(line, tftcharwidth);
tft.print(line.c_str());
- // Print AP IP and password in AP mode or knownIP if AP not active.
+ // Imprimir AP IP and password in AP mode or knownIP if AP not active.
if (apActive)
{
tft.setCursor(0, 84);
@@ -263,13 +263,13 @@ class St7789DisplayUsermod : public Usermod {
line = knownIp.toString();
center(line, tftcharwidth);
tft.print(line.c_str());
- // percent brightness
+ // percent brillo
tft.setCursor(0, 120);
tft.setTextColor(TFT_WHITE);
tft.print("Bri: ");
tft.print((((int)bri*100)/255));
tft.print("%");
- // signal quality
+ // señal quality
tft.setCursor(124,120);
tft.print("Sig: ");
if (getSignalQuality(WiFi.RSSI()) < 10) {
@@ -305,7 +305,7 @@ class St7789DisplayUsermod : public Usermod {
// Fifth row with estimated mA usage
tft.setTextColor(TFT_SILVER);
tft.setCursor(0, 216);
- // Print estimated milliamp usage (must specify the LED type in LED prefs for this to be a reasonable estimate).
+ // Imprimir estimated milliamp usage (must specify the LED tipo in LED prefs for this to be a reasonable estimate).
tft.print("Current: ");
tft.setTextColor(TFT_ORANGE);
tft.print(BusManager::currentMilliamps());
@@ -313,8 +313,8 @@ class St7789DisplayUsermod : public Usermod {
}
/*
- * addToJsonInfo() can be used to add custom entries to the /json/info part of the JSON API.
- * Creating an "u" object allows you to add custom key/value pairs to the Info section of the WLED web UI.
+ * addToJsonInfo() can be used to add custom entries to the /JSON/información part of the JSON API.
+ * Creating an "u" object allows you to add custom key/valor pairs to the Información section of the WLED web UI.
* Below it is shown how this could be used for e.g. a light sensor
*/
void addToJsonInfo(JsonObject& root) override
@@ -328,8 +328,8 @@ class St7789DisplayUsermod : public Usermod {
/*
- * addToJsonState() can be used to add custom entries to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * addToJsonState() can be used to add custom entries to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
void addToJsonState(JsonObject& root) override
{
@@ -338,27 +338,27 @@ class St7789DisplayUsermod : public Usermod {
/*
- * readFromJsonState() can be used to receive data clients send to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * readFromJsonState() can be used to recibir datos clients enviar to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
void readFromJsonState(JsonObject& root) override
{
- //userVar0 = root["user0"] | userVar0; //if "user0" key exists in JSON, update, else keep old value
- //if (root["bri"] == 255) Serial.println(F("Don't burn down your garage!"));
+ //userVar0 = root["user0"] | userVar0; //if "user0" key exists in JSON, actualizar, else keep old valor
+ //if (root["bri"] == 255) Serie.println(F("Don't burn down your garage!"));
}
/*
- * addToConfig() can be used to add custom persistent settings to the cfg.json file in the "um" (usermod) object.
+ * addToConfig() can be used to add custom persistent settings to the cfg.JSON archivo in the "um" (usermod) object.
* It will be called by WLED when settings are actually saved (for example, LED settings are saved)
- * If you want to force saving the current state, use serializeConfig() in your loop().
+ * If you want to force saving the current estado, use serializeConfig() in your bucle().
*
- * CAUTION: serializeConfig() will initiate a filesystem write operation.
+ * CAUTION: serializeConfig() will initiate a filesystem escribir operation.
* It might cause the LEDs to stutter and will cause flash wear if called too often.
- * Use it sparingly and always in the loop, never in network callbacks!
+ * Use it sparingly and always in the bucle, never in red callbacks!
*
* addToConfig() will also not yet add your setting to one of the settings pages automatically.
- * To make that work you still have to add the setting to the HTML, xml.cpp and set.cpp manually.
+ * To make that work you still have to add the setting to the HTML, XML.cpp and set.cpp manually.
*
* I highly recommend checking out the basics of ArduinoJson serialization and deserialization in order to use custom settings!
*/
@@ -370,7 +370,7 @@ class St7789DisplayUsermod : public Usermod {
pins.add(TFT_DC);
pins.add(TFT_RST);
pins.add(TFT_BL);
- //top["great"] = userVar0; //save this var persistently whenever settings are saved
+ //top["great"] = userVar0; //guardar this var persistently whenever settings are saved
}
@@ -382,32 +382,32 @@ class St7789DisplayUsermod : public Usermod {
}
/*
- * readFromConfig() can be used to read back the custom settings you added with addToConfig().
+ * readFromConfig() can be used to leer back the custom settings you added with addToConfig().
* This is called by WLED when settings are loaded (currently this only happens once immediately after boot)
*
- * readFromConfig() is called BEFORE setup(). This means you can use your persistent values in setup() (e.g. pin assignments, buffer sizes),
- * but also that if you want to write persistent values to a dynamic buffer, you'd need to allocate it here instead of in setup.
+ * readFromConfig() is called BEFORE configuración(). This means you can use your persistent values in configuración() (e.g. pin assignments, búfer sizes),
+ * but also that if you want to escribir persistent values to a dynamic búfer, you'd need to allocate it here instead of in configuración.
* If you don't know what that is, don't fret. It most likely doesn't affect your use case :)
*/
bool readFromConfig(JsonObject& root) override
{
//JsonObject top = root["top"];
- //userVar0 = top["great"] | 42; //The value right of the pipe "|" is the default value in case your setting was not present in cfg.json (e.g. first boot)
+ //userVar0 = top["great"] | 42; //The valor right of the pipe "|" is the default valor in case your setting was not present in cfg.JSON (e.g. first boot)
return true;
}
/*
- * getId() allows you to optionally give your V2 usermod an unique ID (please define it in const.h!).
- * This could be used in the future for the system to determine whether your usermod is installed.
+ * getId() allows you to optionally give your V2 usermod an unique ID (please definir it in constante.h!).
+ * This could be used in the futuro for the sistema to determine whether your usermod is installed.
*/
uint16_t getId() override
{
return USERMOD_ID_ST7789_DISPLAY;
}
- //More methods can be added in the future, this example will then be extended.
- //Your usermod will remain compatible as it does not need to implement all methods from the Usermod base class!
+ //More methods can be added in the futuro, this example will then be extended.
+ //Your usermod will remain compatible as it does not need to implement all methods from the Usermod base clase!
};
static name. st7789_display;
diff --git a/usermods/Si7021_MQTT_HA/Si7021_MQTT_HA.cpp b/usermods/Si7021_MQTT_HA/Si7021_MQTT_HA.cpp
index 7845658ad1..011b9a3fe3 100644
--- a/usermods/Si7021_MQTT_HA/Si7021_MQTT_HA.cpp
+++ b/usermods/Si7021_MQTT_HA/Si7021_MQTT_HA.cpp
@@ -31,7 +31,7 @@ class Si7021_MQTT_HA : public Usermod
bool haAutoDiscovery = true;
bool sendAdditionalSensors = true;
- // strings to reduce flash memory usage (used more than twice)
+ // strings to reduce flash memoria usage (used more than twice)
static const char _name[];
static const char _enabled[];
static const char _sendAdditionalSensors[];
@@ -51,7 +51,7 @@ class Si7021_MQTT_HA : public Usermod
mqttDewPointTopic = String(mqttDeviceTopic) + "/si7021_dew_point";
mqttAbsoluteHumidityTopic = String(mqttDeviceTopic) + "/si7021_absolute_humidity";
- // Update and publish sensor data
+ // Actualizar and publish sensor datos
_updateSensorData();
_publishSensorData();
@@ -108,10 +108,10 @@ class Si7021_MQTT_HA : public Usermod
sensorTemperature = si7021.readTemperature();
sensorHumidity = si7021.readHumidity();
- // Serial.print("Si7021_MQTT_HA: Temperature: ");
- // Serial.print(sensorTemperature, 2);
- // Serial.print("\tHumidity: ");
- // Serial.print(sensorHumidity, 2);
+ // Serie.imprimir("Si7021_MQTT_HA: Temperature: ");
+ // Serie.imprimir(sensorTemperature, 2);
+ // Serie.imprimir("\tHumidity: ");
+ // Serie.imprimir(sensorHumidity, 2);
if (sendAdditionalSensors) {
EnvironmentCalculations::TempUnit envTempUnit(EnvironmentCalculations::TempUnit_Celsius);
@@ -119,15 +119,15 @@ class Si7021_MQTT_HA : public Usermod
sensorDewPoint = EnvironmentCalculations::DewPoint(sensorTemperature, sensorHumidity, envTempUnit);
sensorAbsoluteHumidity = EnvironmentCalculations::AbsoluteHumidity(sensorTemperature, sensorHumidity, envTempUnit);
- // Serial.print("\tHeat Index: ");
- // Serial.print(sensorHeatIndex, 2);
- // Serial.print("\tDew Point: ");
- // Serial.print(sensorDewPoint, 2);
- // Serial.print("\tAbsolute Humidity: ");
- // Serial.println(sensorAbsoluteHumidity, 2);
+ // Serie.imprimir("\tHeat Índice: ");
+ // Serie.imprimir(sensorHeatIndex, 2);
+ // Serie.imprimir("\tDew Point: ");
+ // Serie.imprimir(sensorDewPoint, 2);
+ // Serie.imprimir("\tAbsolute Humidity: ");
+ // Serie.println(sensorAbsoluteHumidity, 2);
}
// else
- // Serial.println("");
+ // Serie.println("");
}
void _publishSensorData()
@@ -205,7 +205,7 @@ class Si7021_MQTT_HA : public Usermod
if (!mqttInitialized)
_initializeMqtt();
- // Update and publish sensor data
+ // Actualizar and publish sensor datos
_updateSensorData();
_publishSensorData();
}
@@ -222,7 +222,7 @@ class Si7021_MQTT_HA : public Usermod
}
};
-// strings to reduce flash memory usage (used more than twice)
+// strings to reduce flash memoria usage (used more than twice)
const char Si7021_MQTT_HA::_name[] PROGMEM = "Si7021 MQTT (Home Assistant)";
const char Si7021_MQTT_HA::_enabled[] PROGMEM = "enabled";
const char Si7021_MQTT_HA::_sendAdditionalSensors[] PROGMEM = "Send Dew Point, Abs. Humidity and Heat Index";
diff --git a/usermods/TTGO-T-Display/README.md b/usermods/TTGO-T-Display/README.md
index 439f9832dd..b3211a3829 100644
--- a/usermods/TTGO-T-Display/README.md
+++ b/usermods/TTGO-T-Display/README.md
@@ -73,7 +73,7 @@ You need to modify a file in the `TFT_eSPI` library to select the correct board.
Modify the `User_Setup_Select.h` file as follows:
* Comment out the following line (which is the 'default' setup file):
```ini
-//#include // Default setup is root library folder
+//#incluir // Default configuración is root biblioteca carpeta
```
* Uncomment the following line (which points to the setup file for the TTGO T-Display):
```ini
diff --git a/usermods/TTGO-T-Display/usermod.cpp b/usermods/TTGO-T-Display/usermod.cpp
index d8dcb29996..311dcb47ba 100644
--- a/usermods/TTGO-T-Display/usermod.cpp
+++ b/usermods/TTGO-T-Display/usermod.cpp
@@ -1,20 +1,20 @@
/*
- * This file allows you to add own functionality to WLED more easily
- * See: https://github.com/wled-dev/WLED/wiki/Add-own-functionality
- * EEPROM bytes 2750+ are reserved for your custom use case. (if you extend #define EEPSIZE in const.h)
- * bytes 2400+ are currently unused, but might be used for future wled features
+ * This archivo allows you to add own functionality to WLED more easily
+ * See: https://github.com/WLED-dev/WLED/wiki/Add-own-functionality
+ * EEPROM bytes 2750+ are reserved for your custom use case. (if you extend #definir EEPSIZE in constante.h)
+ * bytes 2400+ are currently unused, but might be used for futuro WLED features
*/
/*
- * Pin 2 of the TTGO T-Display serves as the data line for the LED string.
- * Pin 35 is set up as the button pin in the platformio_overrides.ini file.
- * The button can be set up via the macros section in the web interface.
+ * Pin 2 of the TTGO T-Display serves as the datos line for the LED cadena.
+ * Pin 35 is set up as the button pin in the platformio_overrides.ini archivo.
+ * The button can be set up via the macros section in the web interfaz.
* I use the button to cycle between presets.
- * The Pin 35 button is the one on the RIGHT side of the USB-C port on the board,
- * when the port is oriented downwards. See readme.md file for photo.
+ * The Pin 35 button is the one on the RIGHT side of the USB-C puerto on the board,
+ * when the puerto is oriented downwards. See readme.md archivo for photo.
* The display is set up to turn off after 5 minutes, and turns on automatically
- * when a change in the dipslayed info is detected (within a 5 second interval).
+ * when a change in the dipslayed información is detected (within a 5 second intervalo).
*/
@@ -45,7 +45,7 @@
TFT_eSPI tft = TFT_eSPI(135, 240); // Invoke custom library
-//gets called once at boot. Do all initialization that doesn't depend on network here
+//gets called once at boot. Do all initialization that doesn't depend on red here
void userSetup() {
Serial.begin(115200);
Serial.println("Start");
@@ -67,7 +67,7 @@ void userSetup() {
// tft.setRotation(3);
}
-// gets called every time WiFi is (re-)connected. Initialize own network
+// gets called every time WiFi is (re-)connected. Inicializar own red
// interfaces here
void userConnected() {}
@@ -91,7 +91,7 @@ bool displayTurnedOff = false;
void userLoop() {
- // Check if we time interval for redrawing passes.
+ // Verificar if we time intervalo for redrawing passes.
if (millis() - lastUpdate < USER_LOOP_REFRESH_RATE_MS) {
return;
}
@@ -103,7 +103,7 @@ void userLoop() {
displayTurnedOff = true;
}
- // Check if values which are shown on display changed from the last time.
+ // Verificar if values which are shown on display changed from the last time.
if (((apActive) ? String(apSSID) : WiFi.SSID()) != knownSsid) {
needRedraw = true;
} else if (knownIp != (apActive ? IPAddress(4, 3, 2, 1) : WiFi.localIP())) {
@@ -128,7 +128,7 @@ void userLoop() {
}
lastRedraw = millis();
- // Update last known values.
+ // Actualizar last known values.
#if defined(ESP8266)
knownSsid = apActive ? WiFi.softAPSSID() : WiFi.SSID();
#else
@@ -141,21 +141,21 @@ void userLoop() {
tft.fillScreen(TFT_BLACK);
tft.setTextSize(2);
- // First row with Wifi name
+ // First row with WiFi name
tft.setCursor(1, 1);
tft.print(knownSsid.substring(0, tftcharwidth > 1 ? tftcharwidth - 1 : 0));
- // Print `~` char to indicate that SSID is longer than our display
+ // Imprimir `~` char to indicate that SSID is longer than our display
if (knownSsid.length() > tftcharwidth)
tft.print("~");
// Second row with AP IP and Password or IP
tft.setTextSize(2);
tft.setCursor(1, 24);
- // Print AP IP and password in AP mode or knownIP if AP not active.
+ // Imprimir AP IP and password in AP mode or knownIP if AP not active.
// if (apActive && bri == 0)
- // tft.print(apPass);
+ // tft.imprimir(apPass);
// else
- // tft.print(knownIp);
+ // tft.imprimir(knownIp);
if (apActive) {
tft.print("AP IP: ");
@@ -168,8 +168,8 @@ void userLoop() {
tft.print("IP: ");
tft.print(knownIp);
tft.setCursor(1,46);
- //tft.print("Signal Strength: ");
- //tft.print(i.wifi.signal);
+ //tft.imprimir("Señal Strength: ");
+ //tft.imprimir(i.WiFi.señal);
tft.print("Brightness: ");
tft.print(((float(bri)/255)*100));
tft.print("%");
@@ -188,7 +188,7 @@ void userLoop() {
// Fifth row with estimated mA usage
tft.setCursor(1, 112);
- // Print estimated milliamp usage (must specify the LED type in LED prefs for this to be a reasonable estimate).
+ // Imprimir estimated milliamp usage (must specify the LED tipo in LED prefs for this to be a reasonable estimate).
tft.print(strip.currentMilliamps);
tft.print("mA (estimated)");
diff --git a/usermods/Temperature/Temperature.cpp b/usermods/Temperature/Temperature.cpp
index a2e0ea91da..adab263dd0 100644
--- a/usermods/Temperature/Temperature.cpp
+++ b/usermods/Temperature/Temperature.cpp
@@ -53,7 +53,7 @@ void UsermodTemperature::readTemperature() {
temperature = readDallas();
lastMeasurement = millis();
waitingForConversion = false;
- //DEBUG_PRINTF_P(PSTR("Read temperature %2.1f.\n"), temperature); // does not work properly on 8266
+ //DEBUG_PRINTF_P(PSTR("Leer temperature %2.1f.\n"), temperature); // does not work properly on 8266
DEBUG_PRINT(F("Read temperature "));
DEBUG_PRINTLN(temperature);
}
@@ -61,7 +61,7 @@ void UsermodTemperature::readTemperature() {
bool UsermodTemperature::findSensor() {
DEBUG_PRINTLN(F("Searching for sensor..."));
uint8_t deviceAddress[8] = {0,0,0,0,0,0,0,0};
- // find out if we have DS18xxx sensor attached
+ // encontrar out if we have DS18xxx sensor attached
oneWire->reset_search();
delay(10);
while (oneWire->search(deviceAddress)) {
@@ -115,7 +115,7 @@ void UsermodTemperature::setup() {
if (enabled) {
// config says we are enabled
DEBUG_PRINTLN(F("Allocating temperature pin..."));
- // pin retrieved from cfg.json (readFromConfig()) prior to running setup()
+ // pin retrieved from cfg.JSON (readFromConfig()) prior to running configuración()
if (temperaturePin >= 0 && PinManager::allocatePin(temperaturePin, true, PinOwner::UM_Temperature)) {
oneWire = new OneWire(temperaturePin);
if (oneWire->reset()) {
@@ -147,19 +147,19 @@ void UsermodTemperature::loop() {
static uint8_t errorCount = 0;
unsigned long now = millis();
- // check to see if we are due for taking a measurement
+ // verificar to see if we are due for taking a measurement
// lastMeasurement will not be updated until the conversion
// is complete the the reading is finished
if (now - lastMeasurement < readingInterval) return;
// we are due for a measurement, if we are not already waiting
- // for a conversion to complete, then make a new request for temps
+ // for a conversion to complete, then make a new solicitud for temps
if (!waitingForConversion) {
requestTemperatures();
return;
}
- // we were waiting for a conversion to complete, have we waited log enough?
+ // we were waiting for a conversion to complete, have we waited registro enough?
if (now - lastTemperaturesRequest >= 750 /* 93.75ms per the datasheet but can be up to 750ms */) {
readTemperature();
if (getTemperatureC() < -100.0f) {
@@ -175,7 +175,7 @@ void UsermodTemperature::loop() {
strcpy(subuf, mqttDeviceTopic);
if (temperature > -100.0f) {
// dont publish super low temperature as the graph will get messed up
- // the DallasTemperature library returns -127C or -196.6F when problem
+ // the DallasTemperature biblioteca returns -127C or -196.6F when problem
// reading the sensor
strcat_P(subuf, _Temperature);
mqtt->publish(subuf, 0, false, String(getTemperatureC()).c_str());
@@ -191,7 +191,7 @@ void UsermodTemperature::loop() {
mqtt->publish("domoticz/in", 0, false, subuf);
}
} else {
- // publish something else to indicate status?
+ // publish something else to indicate estado?
}
}
#endif
@@ -200,7 +200,7 @@ void UsermodTemperature::loop() {
/**
* connected() is called every time the WiFi is (re)connected
- * Use it to initialize network interfaces
+ * Use it to inicializar red interfaces
*/
//void UsermodTemperature::connected() {}
@@ -218,12 +218,12 @@ void UsermodTemperature::onMqttConnect(bool sessionPresent) {
#endif
/*
- * addToJsonInfo() can be used to add custom entries to the /json/info part of the JSON API.
- * Creating an "u" object allows you to add custom key/value pairs to the Info section of the WLED web UI.
- * Below it is shown how this could be used for e.g. a light sensor
+ * `addToJsonInfo()` puede usarse para añadir entradas personalizadas a /JSON/información de la API JSON.
+ * Crear un objeto "u" permite añadir pares clave/valor a la sección Información de la UI web de WLED.
+ * A continuación se muestra un ejemplo (p. ej. para un sensor de temperatura).
*/
void UsermodTemperature::addToJsonInfo(JsonObject& root) {
- // dont add temperature to info if we are disabled
+ // dont add temperature to información if we are disabled
if (!enabled) return;
JsonObject user = root["u"];
@@ -248,27 +248,27 @@ void UsermodTemperature::addToJsonInfo(JsonObject& root) {
}
/**
- * addToJsonState() can be used to add custom entries to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * addToJsonState() can be used to add custom entries to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
//void UsermodTemperature::addToJsonState(JsonObject &root)
//{
//}
/**
- * readFromJsonState() can be used to receive data clients send to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
- * Read "_" from json state and and change settings (i.e. GPIO pin) used.
+ * readFromJsonState() can be used to recibir datos clients enviar to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
+ * Leer "_" from JSON estado and and change settings (i.e. GPIO pin) used.
*/
//void UsermodTemperature::readFromJsonState(JsonObject &root) {
-// if (!initDone) return; // prevent crash on boot applyPreset()
+// if (!initDone) retorno; // prevent bloqueo on boot applyPreset()
//}
/**
- * addToConfig() (called from set.cpp) stores persistent properties to cfg.json
+ * addToConfig() (called from set.cpp) stores persistent properties to cfg.JSON
*/
void UsermodTemperature::addToConfig(JsonObject &root) {
- // we add JSON object: {"Temperature": {"pin": 0, "degC": true}}
+ // we add JSON object: {"Temperature": {"pin": 0, "degC": verdadero}}
JsonObject top = root.createNestedObject(FPSTR(_name)); // usermodname
top[FPSTR(_enabled)] = enabled;
top["pin"] = temperaturePin; // usermodparam
@@ -281,12 +281,12 @@ void UsermodTemperature::addToConfig(JsonObject &root) {
}
/**
- * readFromConfig() is called before setup() to populate properties from values stored in cfg.json
+ * readFromConfig() is called before configuración() to populate properties from values stored in cfg.JSON
*
- * The function should return true if configuration was successfully loaded or false if there was no configuration.
+ * The función should retorno verdadero if configuration was successfully loaded or falso if there was no configuration.
*/
bool UsermodTemperature::readFromConfig(JsonObject &root) {
- // we look for JSON object: {"Temperature": {"pin": 0, "degC": true}}
+ // we look for JSON object: {"Temperature": {"pin": 0, "degC": verdadero}}
int8_t newTemperaturePin = temperaturePin;
DEBUG_PRINT(FPSTR(_name));
@@ -306,7 +306,7 @@ bool UsermodTemperature::readFromConfig(JsonObject &root) {
idx = top[FPSTR(_domoticzIDX)] | idx;
if (!initDone) {
- // first run: reading from cfg.json
+ // first run: reading from cfg.JSON
temperaturePin = newTemperaturePin;
DEBUG_PRINTLN(F(" config loaded."));
} else {
@@ -314,7 +314,7 @@ bool UsermodTemperature::readFromConfig(JsonObject &root) {
// changing paramters from settings page
if (newTemperaturePin != temperaturePin) {
DEBUG_PRINTLN(F("Re-init temperature."));
- // deallocate pin and release memory
+ // deallocate pin and lanzamiento memoria
delete oneWire;
PinManager::deallocatePin(temperaturePin, PinOwner::UM_Temperature);
temperaturePin = newTemperaturePin;
@@ -323,7 +323,7 @@ bool UsermodTemperature::readFromConfig(JsonObject &root) {
setup();
}
}
- // use "return !top["newestParameter"].isNull();" when updating Usermod with new features
+ // use "retorno !top["newestParameter"].isNull();" when updating Usermod with new features
return !top[FPSTR(_domoticzIDX)].isNull();
}
@@ -344,7 +344,7 @@ const char *UsermodTemperature::getTemperatureUnit() {
UsermodTemperature* UsermodTemperature::_instance = nullptr;
-// strings to reduce flash memory usage (used more than twice)
+// strings to reduce flash memoria usage (used more than twice)
const char UsermodTemperature::_name[] PROGMEM = "Temperature";
const char UsermodTemperature::_enabled[] PROGMEM = "enabled";
const char UsermodTemperature::_readInterval[] PROGMEM = "read-interval-s";
diff --git a/usermods/Temperature/UsermodTemperature.h b/usermods/Temperature/UsermodTemperature.h
index 2517a2b817..57ca029c21 100644
--- a/usermods/Temperature/UsermodTemperature.h
+++ b/usermods/Temperature/UsermodTemperature.h
@@ -11,7 +11,7 @@
#endif
#endif
-// the frequency to check temperature, 1 minute
+// the frecuencia to verificar temperature, 1 minute
#ifndef USERMOD_DALLASTEMPERATURE_MEASUREMENT_INTERVAL
#define USERMOD_DALLASTEMPERATURE_MEASUREMENT_INTERVAL 60000
#endif
@@ -24,23 +24,23 @@ class UsermodTemperature : public Usermod {
OneWire *oneWire;
// GPIO pin used for sensor (with a default compile-time fallback)
int8_t temperaturePin = TEMPERATURE_PIN;
- // measurement unit (true==°C, false==°F)
+ // measurement unit (verdadero==°C, falso==°F)
bool degC = true;
- // using parasite power on the sensor
+ // usando parasite power on the sensor
bool parasite = false;
int8_t parasitePin = -1;
- // how often do we read from sensor?
+ // how often do we leer from sensor?
unsigned long readingInterval = USERMOD_DALLASTEMPERATURE_MEASUREMENT_INTERVAL;
// set last reading as "40 sec before boot", so first reading is taken after 20 sec
unsigned long lastMeasurement = UINT32_MAX - USERMOD_DALLASTEMPERATURE_MEASUREMENT_INTERVAL;
// last time requestTemperatures was called
- // used to determine when we can read the sensors temperature
+ // used to determine when we can leer the sensors temperature
// we have to wait at least 93.75 ms after requestTemperatures() is called
unsigned long lastTemperaturesRequest;
float temperature;
// indicates requestTemperatures has been called but the sensor measurement is not complete
bool waitingForConversion = false;
- // flag set at startup if DS18B20 sensor not found, avoids trying to keep getting
+ // bandera set at startup if DS18B20 sensor not found, avoids trying to keep getting
// temperature if flashed to a board without a sensor attached
byte sensorFound;
@@ -49,7 +49,7 @@ class UsermodTemperature : public Usermod {
bool HApublished = false;
int16_t idx = -1; // Domoticz virtual sensor idx
- // strings to reduce flash memory usage (used more than twice)
+ // strings to reduce flash memoria usage (used more than twice)
static const char _name[];
static const char _enabled[];
static const char _readInterval[];
@@ -78,7 +78,7 @@ class UsermodTemperature : public Usermod {
static UsermodTemperature *getInstance() { return UsermodTemperature::_instance; }
/*
- * API calls te enable data exchange between WLED modules
+ * API calls te habilitar datos exchange between WLED modules
*/
inline float getTemperatureC() { return temperature; }
inline float getTemperatureF() { return temperature * 1.8f + 32.0f; }
@@ -88,18 +88,18 @@ class UsermodTemperature : public Usermod {
void setup() override;
void loop() override;
- //void connected() override;
+ //void connected() anular;
#ifndef WLED_DISABLE_MQTT
void onMqttConnect(bool sessionPresent) override;
#endif
- //void onUpdateBegin(bool init) override;
+ //void onUpdateBegin(bool init) anular;
- //bool handleButton(uint8_t b) override;
- //void handleOverlayDraw() override;
+ //bool handleButton(uint8_t b) anular;
+ //void handleOverlayDraw() anular;
void addToJsonInfo(JsonObject& root) override;
- //void addToJsonState(JsonObject &root) override;
- //void readFromJsonState(JsonObject &root) override;
+ //void addToJsonState(JsonObject &root) anular;
+ //void readFromJsonState(JsonObject &root) anular;
void addToConfig(JsonObject &root) override;
bool readFromConfig(JsonObject &root) override;
diff --git a/usermods/TetrisAI_v2/TetrisAI_v2.cpp b/usermods/TetrisAI_v2/TetrisAI_v2.cpp
index b51250b262..6effb56255 100644
--- a/usermods/TetrisAI_v2/TetrisAI_v2.cpp
+++ b/usermods/TetrisAI_v2/TetrisAI_v2.cpp
@@ -39,7 +39,7 @@ void drawGrid(TetrisAIGame* tetris, TetrisAI_data* tetrisai_data)
//BG color
color = SEGCOLOR(1);
}
- //game over animation
+ //game over animación
else if(*tetris->grid.getPixel(index_x, index_y) == 254)
{
//use fg
@@ -64,7 +64,7 @@ void drawGrid(TetrisAIGame* tetris, TetrisAI_data* tetrisai_data)
//BORDER
if (tetrisai_data->showBorder)
{
- //draw a line 6 pixels from right with the border color
+ //dibujar a line 6 pixels from right with the border color
for (auto index_y = 0; index_y < tetrisai_data->effectHeight; index_y++)
{
SEGMENT.setPixelColorXY(tetrisai_data->segOffsetX + tetrisai_data->effectWidth - 6, tetrisai_data->segOffsetY + index_y, SEGCOLOR(2));
@@ -111,13 +111,13 @@ uint16_t mode_2DTetrisAI()
const uint16_t cols = SEGMENT.virtualWidth();
const uint16_t rows = SEGMENT.virtualHeight();
- //range 0 - 1024ms => 1024/255 ~ 4
+ //rango 0 - 1024ms => 1024/255 ~ 4
uint16_t msDelayMove = 1024 - (4 * SEGMENT.speed);
int16_t msDelayGameOver = msDelayMove / 4;
- //range 0 - 2 (not including current)
+ //rango 0 - 2 (not including current)
uint8_t nLookAhead = SEGMENT.intensity ? (SEGMENT.intensity >> 7) + 2 : 1;
- //range 0 - 16
+ //rango 0 - 16
tetrisai_data->colorInc = SEGMENT.custom2 >> 4;
if (tetrisai_data->tetris.nLookAhead != nLookAhead
@@ -132,7 +132,7 @@ uint16_t mode_2DTetrisAI()
tetrisai_data->showNext = SEGMENT.check1;
tetrisai_data->showBorder = SEGMENT.check2;
- //not more than 32 columns and 255 rows as this is the limit of this implementation
+ //not more than 32 columns and 255 rows as this is the límite of this implementación
uint8_t gridWidth = cols > 32 ? 32 : cols;
uint8_t gridHeight = rows > 255 ? 255 : rows;
@@ -146,7 +146,7 @@ uint16_t mode_2DTetrisAI()
if (gridWidth + 5 > cols)
{
// yes, so make the grid smaller
- // make space for the piece and one pixel of space
+ // make space for the piece and one píxel of space
gridWidth = (gridWidth - ((gridWidth + 5) - cols));
}
tetrisai_data->effectWidth += 5;
diff --git a/usermods/TetrisAI_v2/gridbw.h b/usermods/TetrisAI_v2/gridbw.h
index deea027d79..c9ffdb6c4b 100644
--- a/usermods/TetrisAI_v2/gridbw.h
+++ b/usermods/TetrisAI_v2/gridbw.h
@@ -1,6 +1,6 @@
/******************************************************************************
- * @file : gridbw.h
- * @brief : contains the tetris grid as binary so black and white version
+ * @archivo : gridbw.h
+ * @brief : contains the tetris grid as binary so black and white versión
******************************************************************************
* @attention
*
@@ -80,8 +80,8 @@ class GridBW
piece->landingY++;
}
- //at this point the positon is 'in the wall' or 'over some occupied pixel'
- //so the previous position was the last correct one (clamped to 0 as minimum).
+ //at this point the positon is 'in the wall' or 'over some occupied píxel'
+ //so the previous posición was the last correct one (clamped to 0 as minimum).
piece->landingY = piece->landingY > 0 ? piece->landingY - 1 : 0;
}
diff --git a/usermods/TetrisAI_v2/gridcolor.h b/usermods/TetrisAI_v2/gridcolor.h
index 815c2a5603..4eba6b5d72 100644
--- a/usermods/TetrisAI_v2/gridcolor.h
+++ b/usermods/TetrisAI_v2/gridcolor.h
@@ -1,6 +1,6 @@
/******************************************************************************
- * @file : gridcolor.h
- * @brief : contains the tetris grid as 8bit indexed color version
+ * @archivo : gridcolor.h
+ * @brief : contains the tetris grid as 8bit indexed color versión
******************************************************************************
* @attention
*
diff --git a/usermods/TetrisAI_v2/pieces.h b/usermods/TetrisAI_v2/pieces.h
index 5d461615ae..23d5e8884b 100644
--- a/usermods/TetrisAI_v2/pieces.h
+++ b/usermods/TetrisAI_v2/pieces.h
@@ -1,5 +1,5 @@
/******************************************************************************
- * @file : pieces.h
+ * @archivo : pieces.h
* @brief : contains the tetris pieces with their colors indecies
******************************************************************************
* @attention
@@ -139,7 +139,7 @@ class Piece
{
if (x < width)
{
- //shift the row with the "top-left" position to the "x" position
+ //shift the row with the "top-left" posición to the "x" posición
auto shiftx = (width - 1) - x;
auto topleftx = (getRotation().width - 1);
diff --git a/usermods/TetrisAI_v2/rating.h b/usermods/TetrisAI_v2/rating.h
index 88320818e1..502ab09142 100644
--- a/usermods/TetrisAI_v2/rating.h
+++ b/usermods/TetrisAI_v2/rating.h
@@ -1,5 +1,5 @@
/******************************************************************************
- * @file : rating.h
+ * @archivo : rating.h
* @brief : contains the tetris rating of a grid
******************************************************************************
* @attention
diff --git a/usermods/TetrisAI_v2/tetrisai.h b/usermods/TetrisAI_v2/tetrisai.h
index ba4fe60e43..b097c286cf 100644
--- a/usermods/TetrisAI_v2/tetrisai.h
+++ b/usermods/TetrisAI_v2/tetrisai.h
@@ -1,6 +1,6 @@
/******************************************************************************
- * @file : ai.h
- * @brief : contains the heuristic
+ * @archivo : ai.h
+ * @brief : contains the heurística
******************************************************************************
* @attention
*
@@ -79,17 +79,17 @@ class TetrisAI
//calculate the difference (XOR) between the current column vector and the last one
uint32_t columnDelta = columnvector ^ lastcolumnvector;
- //process every new column
+ //proceso every new column
uint8_t index = 0;
while (columnDelta)
{
//if this is a new column
if (columnDelta & 0x1)
{
- //update hight of this column
+ //actualizar hight of this column
rating->lineHights[(grid.width - 1) - index] = grid.height - row;
- // update aggregatedHeight
+ // actualizar aggregatedHeight
rating->aggregatedHeight += grid.height - row;
}
index++;
@@ -98,7 +98,7 @@ class TetrisAI
lastcolumnvector = columnvector;
}
- //compare every two columns to get the difference and add them up
+ //comparar every two columns to get the difference and add them up
for (uint8_t column = 1; column < grid.width; column++)
{
rating->bumpiness += abs(rating->lineHights[column - 1] - rating->lineHights[column]);
@@ -154,15 +154,15 @@ class TetrisAI
{
//todo optimise by the use of the previous grids height
piece.landingY = 0;
- //will set landingY to final position
+ //will set landingY to final posición
grid.findLandingPosition(&piece);
- // draw piece
+ // dibujar piece
grid.placePiece(&piece, piece.x, piece.landingY);
if(start == end - 1)
{
- //at the deepest level
+ //at the deepest nivel
updateRating(grid, &curRating);
}
else
@@ -183,7 +183,7 @@ class TetrisAI
bestRating->score = FLT_MAX;
}
- // update if we found a worse one
+ // actualizar if we found a worse one
if (bestRating->score > curRating.score)
{
*bestRating = curRating;
@@ -192,7 +192,7 @@ class TetrisAI
}
else
{
- // update if we found a better one
+ // actualizar if we found a better one
if (bestRating->score < curRating.score)
{
*bestRating = curRating;
diff --git a/usermods/TetrisAI_v2/tetrisaigame.h b/usermods/TetrisAI_v2/tetrisaigame.h
index e4766d18b6..1b0f515c4a 100644
--- a/usermods/TetrisAI_v2/tetrisaigame.h
+++ b/usermods/TetrisAI_v2/tetrisaigame.h
@@ -1,6 +1,6 @@
/******************************************************************************
- * @file : tetrisaigame.h
- * @brief : main tetris functions
+ * @archivo : tetrisaigame.h
+ * @brief : principal tetris functions
******************************************************************************
* @attention
*
@@ -43,7 +43,7 @@ class TetrisAIGame
//move piece down
piece->y++;
- // draw piece
+ // dibujar piece
grid.placePiece(piece, piece->x, piece->y);
return true;
diff --git a/usermods/TetrisAI_v2/tetrisbag.h b/usermods/TetrisAI_v2/tetrisbag.h
index 592dac6c7f..8efb51a81a 100644
--- a/usermods/TetrisAI_v2/tetrisbag.h
+++ b/usermods/TetrisAI_v2/tetrisbag.h
@@ -1,6 +1,6 @@
/******************************************************************************
- * @file : tetrisbag.h
- * @brief : the tetris implementation of a random piece generator
+ * @archivo : tetrisbag.h
+ * @brief : the tetris implementación of a random piece generador
******************************************************************************
* @attention
*
@@ -50,7 +50,7 @@ class TetrisBag
bag[bagIndex] = bagIndex % nPieces;
}
- //will init the queue
+ //will init the cola
for (uint8_t index = 0; index < piecesQueue.size(); index++)
{
queuePiece();
diff --git a/usermods/VL53L0X_gestures/VL53L0X_gestures.cpp b/usermods/VL53L0X_gestures/VL53L0X_gestures.cpp
index af3220b3c0..f5f1d2d23a 100644
--- a/usermods/VL53L0X_gestures/VL53L0X_gestures.cpp
+++ b/usermods/VL53L0X_gestures/VL53L0X_gestures.cpp
@@ -1,15 +1,15 @@
/*
- * That usermod implements support of simple hand gestures with VL53L0X sensor: on/off and brightness correction.
+ * That usermod implements support of simple hand gestures with VL53L0X sensor: on/off and brillo correction.
* It can be useful for kitchen strips to avoid any touches.
* - on/off - just swipe a hand below your sensor ("shortPressAction" is called and can be customized through WLED macros)
- * - brightness correction - keep your hand below sensor for 1 second to switch to "brightness" mode.
- Configure brightness by changing distance to the sensor (see parameters below for customization).
+ * - brillo correction - keep your hand below sensor for 1 second to conmutador to "brillo" mode.
+ Configurar brillo by changing distance to the sensor (see parameters below for personalización).
*
* Enabling this usermod:
- * 1. Attach VL53L0X sensor to i2c pins according to default pins for your board.
- * 2. Add `-D USERMOD_VL53L0X_GESTURES` to your build flags at platformio.ini (plaformio_override.ini) for needed environment.
+ * 1. Attach VL53L0X sensor to I2C pins according to default pins for your board.
+ * 2. Add `-D USERMOD_VL53L0X_GESTURES` to your compilación flags at platformio.ini (plaformio_override.ini) for needed environment.
* In my case, for example: `build_flags = ${env.build_flags} -D USERMOD_VL53L0X_GESTURES`
- * 3. Add "pololu/VL53L0X" dependency below to `lib_deps` like this:
+ * 3. Add "pololu/VL53L0X" dependencia below to `lib_deps` like this:
* lib_deps = ${env.lib_deps}
* pololu/VL53L0X @ ^1.3.0
*/
@@ -36,7 +36,7 @@
class UsermodVL53L0XGestures : public Usermod {
private:
- //Private class members. You can declare variables and functions only accessible to your usermod here
+ //Privado clase members. You can declare variables and functions only accessible to your usermod here
unsigned long lastTime = 0;
VL53L0X sensor;
bool enabled = true;
@@ -86,7 +86,7 @@ class UsermodVL53L0XGestures : public Usermod {
isLongMotion = true;
}
- // set brightness according to range
+ // set brillo according to rango
bri = (VL53L0X_MAX_RANGE_MM - max(range, VL53L0X_MIN_RANGE_OFFSET)) * 255 / (VL53L0X_MAX_RANGE_MM - VL53L0X_MIN_RANGE_OFFSET);
DEBUG_PRINTF("new brightness: %d", bri);
stateUpdated(1);
@@ -104,7 +104,7 @@ class UsermodVL53L0XGestures : public Usermod {
}
/*
- * addToConfig() can be used to add custom persistent settings to the cfg.json file in the "um" (usermod) object.
+ * addToConfig() can be used to add custom persistent settings to the cfg.JSON archivo in the "um" (usermod) object.
* It will be called by WLED when settings are actually saved (for example, LED settings are saved)
* I highly recommend checking out the basics of ArduinoJson serialization and deserialization in order to use custom settings!
*/
@@ -117,8 +117,8 @@ class UsermodVL53L0XGestures : public Usermod {
// }
/*
- * getId() allows you to optionally give your V2 usermod an unique ID (please define it in const.h!).
- * This could be used in the future for the system to determine whether your usermod is installed.
+ * getId() allows you to optionally give your V2 usermod an unique ID (please definir it in constante.h!).
+ * This could be used in the futuro for the sistema to determine whether your usermod is installed.
*/
uint16_t getId()
{
diff --git a/usermods/Wemos_D1_mini+Wemos32_mini_shield/usermod.cpp b/usermods/Wemos_D1_mini+Wemos32_mini_shield/usermod.cpp
index e7d1212a14..35a4421a00 100644
--- a/usermods/Wemos_D1_mini+Wemos32_mini_shield/usermod.cpp
+++ b/usermods/Wemos_D1_mini+Wemos32_mini_shield/usermod.cpp
@@ -41,27 +41,27 @@ uint8_t DALLAS_PIN =13;
//ESP8266 Wemos D1 mini board use SCL=5 SDA=4 while ESP32 Wemos32 mini board use SCL=22 SDA=21
#define U8X8_PIN_SCL SCL_PIN
#define U8X8_PIN_SDA SDA_PIN
-//#define U8X8_PIN_RESET RST_PIN // Un-comment for Heltec WiFi-Kit-8
+//#definir U8X8_PIN_RESET RST_PIN // Un-comment for Heltec WiFi-Kit-8
-// Dallas sensor reading timer
+// Dallas sensor reading temporizador
long temptimer = millis();
long lastMeasure = 0;
#define Celsius // Show temperature measurement in Celsius otherwise is in Fahrenheit
-// If display does not work or looks corrupted check the
+// If display does not work or looks corrupted verificar the
// constructor reference:
// https://github.com/olikraus/u8g2/wiki/u8x8setupcpp
-// or check the gallery:
+// or verificar the gallery:
// https://github.com/olikraus/u8g2/wiki/gallery
// --> First choice of cheap I2C OLED 128X32 0.91"
U8X8_SSD1306_128X32_UNIVISION_HW_I2C u8x8(U8X8_PIN_NONE, U8X8_PIN_SCL, U8X8_PIN_SDA); // Pins are Reset, SCL, SDA
// --> Second choice of cheap I2C OLED 128X64 0.96" or 1.3"
-//U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(U8X8_PIN_NONE, U8X8_PIN_SCL, U8X8_PIN_SDA); // Pins are Reset, SCL, SDA
+//U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(U8X8_PIN_NONE, U8X8_PIN_SCL, U8X8_PIN_SDA); // Pins are Restablecer, SCL, SDA
// --> Third choice of Heltec WiFi-Kit-8 OLED 128X32 0.91"
//U8X8_SSD1306_128X32_UNIVISION_HW_I2C u8x8(U8X8_PIN_RESET, U8X8_PIN_SCL, U8X8_PIN_SDA); // Constructor for Heltec WiFi-Kit-8
-// gets called once at boot. Do all initialization that doesn't depend on network here
+// gets called once at boot. Do all initialization that doesn't depend on red here
void userSetup() {
-//Serial.begin(115200);
+//Serie.begin(115200);
Dallas (DALLAS_PIN,1);
u8x8.begin();
@@ -72,7 +72,7 @@ void userSetup() {
u8x8.drawString(0, 0, "Loading...");
}
-// gets called every time WiFi is (re-)connected. Initialize own network
+// gets called every time WiFi is (re-)connected. Inicializar own red
// interfaces here
void userConnected() {}
@@ -97,22 +97,22 @@ void userLoop() {
//----> Dallas temperature sensor MQTT publishing
temptimer = millis();
-// Timer to publish new temperature every 60 seconds
+// Temporizador to publish new temperature every 60 seconds
if (temptimer - lastMeasure > 60000)
{
lastMeasure = temptimer;
#ifndef WLED_DISABLE_MQTT
-//Check if MQTT Connected, otherwise it will crash the 8266
+//Verificar if MQTT Connected, otherwise it will bloqueo the 8266
if (mqtt != nullptr)
{
-// Serial.println(Dallas(DALLAS_PIN,0));
-//Gets preferred temperature scale based on selection in definitions section
+// Serie.println(Dallas(DALLAS_PIN,0));
+//Gets preferred temperature escala based on selection in definitions section
#ifdef Celsius
int16_t board_temperature = Dallas(DALLAS_PIN,0);
#else
int16_t board_temperature = (Dallas(DALLAS_PIN,0)* 1.8 + 32);
#endif
-//Create character string populated with user defined device topic from the UI, and the read temperature. Then publish to MQTT server.
+//Crear carácter cadena populated with usuario defined dispositivo topic from the UI, and the leer temperature. Then publish to MQTT servidor.
String t = String(mqttDeviceTopic);
t += "/temperature";
mqtt->publish(t.c_str(), 0, true, String(board_temperature).c_str());
@@ -120,7 +120,7 @@ void userLoop() {
#endif
}
- // Check if we time interval for redrawing passes.
+ // Verificar if we time intervalo for redrawing passes.
if (millis() - lastUpdate < USER_LOOP_REFRESH_RATE_MS) {
return;
}
@@ -132,7 +132,7 @@ void userLoop() {
displayTurnedOff = true;
}
- // Check if values which are shown on display changed from the last time.
+ // Verificar if values which are shown on display changed from the last time.
if (((apActive) ? String(apSSID) : WiFi.SSID()) != knownSsid) {
needRedraw = true;
} else if (knownIp != (apActive ? IPAddress(4, 3, 2, 1) : WiFi.localIP())) {
@@ -157,7 +157,7 @@ void userLoop() {
}
lastRedraw = millis();
- // Update last known values.
+ // Actualizar last known values.
#ifdef ARDUINO_ARCH_ESP32
knownSsid = WiFi.SSID();
#else
@@ -170,16 +170,16 @@ void userLoop() {
u8x8.clear();
u8x8.setFont(u8x8_font_chroma48medium8_r);
- // First row with Wifi name
+ // First row with WiFi name
u8x8.setCursor(1, 0);
u8x8.print(knownSsid.substring(0, u8x8.getCols() > 1 ? u8x8.getCols() - 2 : 0));
- // Print `~` char to indicate that SSID is longer than our display
+ // Imprimir `~` char to indicate that SSID is longer than our display
if (knownSsid.length() > u8x8.getCols())
u8x8.print("~");
// Second row with IP or Password
u8x8.setCursor(1, 1);
- // Print password in AP mode and if led is OFF.
+ // Imprimir password in AP mode and if LED is OFF.
if (apActive && bri == 0)
u8x8.print(apPass);
else
diff --git a/usermods/Wemos_D1_mini+Wemos32_mini_shield/usermod_bme280.cpp b/usermods/Wemos_D1_mini+Wemos32_mini_shield/usermod_bme280.cpp
index ff1cf7e534..df916bb6e0 100644
--- a/usermods/Wemos_D1_mini+Wemos32_mini_shield/usermod_bme280.cpp
+++ b/usermods/Wemos_D1_mini+Wemos32_mini_shield/usermod_bme280.cpp
@@ -8,7 +8,7 @@ void UpdateBME280Data();
#define Celsius // Show temperature measurement in Celsius otherwise is in Fahrenheit
BME280I2C bme; // Default : forced mode, standby time = 1000 ms
- // Oversampling = pressure ×1, temperature ×1, humidity ×1, filter off,
+ // Oversampling = pressure ×1, temperature ×1, humidity ×1, filtro off,
#ifdef ARDUINO_ARCH_ESP32 //ESP32 boards
uint8_t SCL_PIN = 22;
@@ -23,22 +23,22 @@ uint8_t SDA_PIN = 4;
//ESP8266 Wemos D1 mini board use SCL=5 SDA=4 while ESP32 Wemos32 mini board use SCL=22 SDA=21
#define U8X8_PIN_SCL SCL_PIN
#define U8X8_PIN_SDA SDA_PIN
-//#define U8X8_PIN_RESET RST_PIN // Un-comment for Heltec WiFi-Kit-8
+//#definir U8X8_PIN_RESET RST_PIN // Un-comment for Heltec WiFi-Kit-8
-// If display does not work or looks corrupted check the
+// If display does not work or looks corrupted verificar the
// constructor reference:
// https://github.com/olikraus/u8g2/wiki/u8x8setupcpp
-// or check the gallery:
+// or verificar the gallery:
// https://github.com/olikraus/u8g2/wiki/gallery
// --> First choice of cheap I2C OLED 128X32 0.91"
U8X8_SSD1306_128X32_UNIVISION_HW_I2C u8x8(U8X8_PIN_NONE, U8X8_PIN_SCL, U8X8_PIN_SDA); // Pins are Reset, SCL, SDA
// --> Second choice of cheap I2C OLED 128X64 0.96" or 1.3"
-//U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(U8X8_PIN_NONE, U8X8_PIN_SCL, U8X8_PIN_SDA); // Pins are Reset, SCL, SDA
+//U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(U8X8_PIN_NONE, U8X8_PIN_SCL, U8X8_PIN_SDA); // Pins are Restablecer, SCL, SDA
// --> Third choice of Heltec WiFi-Kit-8 OLED 128X32 0.91"
//U8X8_SSD1306_128X32_UNIVISION_HW_I2C u8x8(U8X8_PIN_RESET, U8X8_PIN_SCL, U8X8_PIN_SDA); // Constructor for Heltec WiFi-Kit-8
-// gets called once at boot. Do all initialization that doesn't depend on network here
+// gets called once at boot. Do all initialization that doesn't depend on red here
-// BME280 sensor timer
+// BME280 sensor temporizador
long tempTimer = millis();
long lastMeasure = 0;
@@ -73,7 +73,7 @@ switch(bme.chipModel())
}
}
-// gets called every time WiFi is (re-)connected. Initialize own network
+// gets called every time WiFi is (re-)connected. Inicializar own red
// interfaces here
void userConnected() {}
@@ -98,13 +98,13 @@ void userLoop() {
// BME280 sensor MQTT publishing
tempTimer = millis();
-// Timer to publish new sensor data every 60 seconds
+// Temporizador to publish new sensor datos every 60 seconds
if (tempTimer - lastMeasure > 60000)
{
lastMeasure = tempTimer;
#ifndef WLED_DISABLE_MQTT
-// Check if MQTT Connected, otherwise it will crash the 8266
+// Verificar if MQTT Connected, otherwise it will bloqueo the 8266
if (mqtt != nullptr)
{
UpdateBME280Data();
@@ -112,7 +112,7 @@ void userLoop() {
float board_pressure = SensorPressure;
float board_humidity = SensorHumidity;
-// Create string populated with user defined device topic from the UI, and the read temperature, humidity and pressure. Then publish to MQTT server.
+// Crear cadena populated with usuario defined dispositivo topic from the UI, and the leer temperature, humidity and pressure. Then publish to MQTT servidor.
String t = String(mqttDeviceTopic);
t += "/temperature";
mqtt->publish(t.c_str(), 0, true, String(board_temperature).c_str());
@@ -126,7 +126,7 @@ void userLoop() {
#endif
}
- // Check if we time interval for redrawing passes.
+ // Verificar if we time intervalo for redrawing passes.
if (millis() - lastUpdate < USER_LOOP_REFRESH_RATE_MS) {
return;
}
@@ -138,7 +138,7 @@ void userLoop() {
displayTurnedOff = true;
}
- // Check if values which are shown on display changed from the last time.
+ // Verificar if values which are shown on display changed from the last time.
if (((apActive) ? String(apSSID) : WiFi.SSID()) != knownSsid) {
needRedraw = true;
} else if (knownIp != (apActive ? IPAddress(4, 3, 2, 1) : WiFi.localIP())) {
@@ -163,7 +163,7 @@ void userLoop() {
}
lastRedraw = millis();
- // Update last known values.
+ // Actualizar last known values.
#if defined(ESP8266)
knownSsid = apActive ? WiFi.softAPSSID() : WiFi.SSID();
#else
@@ -176,16 +176,16 @@ void userLoop() {
u8x8.clear();
u8x8.setFont(u8x8_font_chroma48medium8_r);
- // First row with Wifi name
+ // First row with WiFi name
u8x8.setCursor(1, 0);
u8x8.print(knownSsid.substring(0, u8x8.getCols() > 1 ? u8x8.getCols() - 2 : 0));
- // Print `~` char to indicate that SSID is longer, than our display
+ // Imprimir `~` char to indicate that SSID is longer, than our display
if (knownSsid.length() > u8x8.getCols())
u8x8.print("~");
// Second row with IP or Password
u8x8.setCursor(1, 1);
- // Print password in AP mode and if led is OFF.
+ // Imprimir password in AP mode and if LED is OFF.
if (apActive && bri == 0)
u8x8.print(apPass);
else
diff --git a/usermods/audioreactive/audio_reactive.cpp b/usermods/audioreactive/audio_reactive.cpp
index 2b7b25aaf6..94620f72af 100644
--- a/usermods/audioreactive/audio_reactive.cpp
+++ b/usermods/audioreactive/audio_reactive.cpp
@@ -17,23 +17,23 @@
#endif
/*
- * Usermods allow you to add own functionality to WLED more easily
- * See: https://github.com/wled-dev/WLED/wiki/Add-own-functionality
- *
- * This is an audioreactive v2 usermod.
+ * Los usermods permiten añadir funcionalidad propia a WLED de forma sencilla
+ * Ver: https://github.com/WLED-dev/WLED/wiki/Add-own-functionality
+ *
+ * Este es un usermod v2 de tipo audioreactivo.
* ....
*/
#if !defined(FFTTASK_PRIORITY)
#define FFTTASK_PRIORITY 1 // standard: looptask prio
-//#define FFTTASK_PRIORITY 2 // above looptask, below asyc_tcp
-//#define FFTTASK_PRIORITY 4 // above asyc_tcp
+//#definir FFTTASK_PRIORITY 2 // above looptask, below asyc_tcp
+//#definir FFTTASK_PRIORITY 4 // above asyc_tcp
#endif
-// Comment/Uncomment to toggle usb serial debugging
-// #define MIC_LOGGER // MIC sampling & sound input debugging (serial plotter)
-// #define FFT_SAMPLING_LOG // FFT result debugging
-// #define SR_DEBUG // generic SR DEBUG messages
+// Comentario/Uncomment to toggle usb serial debugging
+// #definir MIC_LOGGER // MIC sampling & sound entrada debugging (serial plotter)
+// #definir FFT_SAMPLING_LOG // FFT resultado debugging
+// #definir SR_DEBUG // genérico SR DEPURACIÓN messages
#ifdef SR_DEBUG
#define DEBUGSR_PRINT(x) DEBUGOUT.print(x)
@@ -74,7 +74,7 @@ static float sampleAvg = 0.0f; // Smoothed Average sample - sam
static float sampleAgc = 0.0f; // Smoothed AGC sample
static uint8_t soundAgc = SR_AGC; // Automatic gain control: 0 - off, 1 - normal, 2 - vivid, 3 - lazy (config value)
#endif
-//static float volumeSmth = 0.0f; // either sampleAvg or sampleAgc depending on soundAgc; smoothed sample
+//estático flotante volumeSmth = 0.0f; // either sampleAvg or sampleAgc depending on soundAgc; smoothed sample
static float FFT_MajorPeak = 1.0f; // FFT: strongest (peak) frequency
static float FFT_Magnitude = 0.0f; // FFT: volume (magnitude) of peak frequency
static bool samplePeak = false; // Boolean flag for peak - used in effects. Responding routine may reset this flag. Auto-reset after strip.getFrameTime()
@@ -82,10 +82,10 @@ static bool udpSamplePeak = false; // Boolean flag for peak. Set at the same t
static unsigned long timeOfPeak = 0; // time of last sample peak detection.
static uint8_t fftResult[NUM_GEQ_CHANNELS]= {0};// Our calculated freq. channel result table to be used by effects
-// TODO: probably best not used by receive nodes
-//static float agcSensitivity = 128; // AGC sensitivity estimation, based on agc gain (multAgc). calculated by getSensitivity(). range 0..255
+// TODO: probably best not used by recibir nodes
+//estático flotante agcSensitivity = 128; // AGC sensitivity estimación, based on agc gain (multAgc). calculated by getSensitivity(). rango 0..255
-// user settable parameters for limitSoundDynamics()
+// usuario settable parameters for limitSoundDynamics()
#ifdef UM_AUDIOREACTIVE_DYNAMICS_LIMITER_OFF
static bool limiterOn = false; // bool: enable / disable dynamics limiter
#else
@@ -104,7 +104,7 @@ static uint8_t binNum = 8; // Used to select the bin for FFT based bea
#ifdef ARDUINO_ARCH_ESP32
-// use audio source class (ESP32 specific)
+// use audio source clase (ESP32 specific)
#include "audio_source.h"
constexpr i2s_port_t I2S_PORT = I2S_NUM_0; // I2S port to use (do not change !)
constexpr int BLOCK_SIZE = 128; // I2S buffer size (samples)
@@ -121,12 +121,12 @@ static uint8_t inputLevel = 128; // UI slider value
#else
uint8_t sampleGain = SR_GAIN; // sample gain (config value)
#endif
-// user settable options for FFTResult scaling
+// usuario settable options for FFTResult scaling
static uint8_t FFTScalingMode = 3; // 0 none; 1 optimized logarithmic; 2 optimized linear; 3 optimized square root
//
// AGC presets
-// Note: in C++, "const" implies "static" - no need to explicitly declare everything as "static const"
+// Note: in C++, "constante" implies "estático" - no need to explicitly declare everything as "estático constante"
//
#define AGC_NUM_PRESETS 3 // AGC presets: normal, vivid, lazy
const double agcSampleDecay[AGC_NUM_PRESETS] = { 0.9994f, 0.9985f, 0.9997f}; // decay factor for sampleMax, in case the current sample is below sampleMax
@@ -147,7 +147,7 @@ static AudioSource *audioSource = nullptr;
static bool useBandPassFilter = false; // if true, enables a bandpass filter 80Hz-16Khz to remove noise. Applies before FFT.
////////////////////
-// Begin FFT Code //
+// Inicio del código FFT //
////////////////////
// some prototypes, to ensure consistent interfaces
@@ -158,56 +158,56 @@ static void postProcessFFTResults(bool noiseGateOpen, int numberOfChannels); //
static TaskHandle_t FFT_Task = nullptr;
-// Table of multiplication factors so that we can even out the frequency response.
+// Table of multiplication factors so that we can even out the frecuencia respuesta.
static float fftResultPink[NUM_GEQ_CHANNELS] = { 1.70f, 1.71f, 1.73f, 1.78f, 1.68f, 1.56f, 1.55f, 1.63f, 1.79f, 1.62f, 1.80f, 2.06f, 2.47f, 3.35f, 6.83f, 9.55f };
-// globals and FFT Output variables shared with animations
+// globals and FFT Salida variables shared with animations
#if defined(WLED_DEBUG) || defined(SR_DEBUG)
static uint64_t fftTime = 0;
static uint64_t sampleTime = 0;
#endif
-// FFT Task variables (filtering and post-processing)
+// FFT Tarea variables (filtering and post-processing)
static float fftCalc[NUM_GEQ_CHANNELS] = {0.0f}; // Try and normalize fftBin values to a max of 4096, so that 4096/16 = 256.
static float fftAvg[NUM_GEQ_CHANNELS] = {0.0f}; // Calculated frequency channel results, with smoothing (used if dynamics limiter is ON)
#ifdef SR_DEBUG
static float fftResultMax[NUM_GEQ_CHANNELS] = {0.0f}; // A table used for testing to determine how our post-processing is working.
#endif
-// audio source parameters and constant
+// audio source parameters and constante
constexpr SRate_t SAMPLE_RATE = 22050; // Base sample rate in Hz - 22Khz is a standard rate. Physical sample time -> 23ms
//constexpr SRate_t SAMPLE_RATE = 16000; // 16kHz - use if FFTtask takes more than 20ms. Physical sample time -> 32ms
//constexpr SRate_t SAMPLE_RATE = 20480; // Base sample rate in Hz - 20Khz is experimental. Physical sample time -> 25ms
//constexpr SRate_t SAMPLE_RATE = 10240; // Base sample rate in Hz - previous default. Physical sample time -> 50ms
#define FFT_MIN_CYCLE 21 // minimum time before FFT task is repeated. Use with 22Khz sampling
-//#define FFT_MIN_CYCLE 30 // Use with 16Khz sampling
-//#define FFT_MIN_CYCLE 23 // minimum time before FFT task is repeated. Use with 20Khz sampling
-//#define FFT_MIN_CYCLE 46 // minimum time before FFT task is repeated. Use with 10Khz sampling
+//#definir FFT_MIN_CYCLE 30 // Use with 16Khz sampling
+//#definir FFT_MIN_CYCLE 23 // minimum time before FFT tarea is repeated. Use with 20Khz sampling
+//#definir FFT_MIN_CYCLE 46 // minimum time before FFT tarea is repeated. Use with 10Khz sampling
// FFT Constants
constexpr uint16_t samplesFFT = 512; // Samples in an FFT batch - This value MUST ALWAYS be a power of 2
constexpr uint16_t samplesFFT_2 = 256; // meaningfull part of FFT results - only the "lower half" contains useful information.
// the following are observed values, supported by a bit of "educated guessing"
-//#define FFT_DOWNSCALE 0.65f // 20kHz - downscaling factor for FFT results - "Flat-Top" window @20Khz, old freq channels
+//#definir FFT_DOWNSCALE 0.65f // 20kHz - downscaling factor for FFT results - "Flat-Top" window @20Khz, old freq channels
#define FFT_DOWNSCALE 0.46f // downscaling factor for FFT results - for "Flat-Top" window @22Khz, new freq channels
#define LOG_256 5.54517744f // log(256)
-// These are the input and output vectors. Input vectors receive computed results from FFT.
+// These are the entrada and salida vectors. Entrada vectors recibir computed results from FFT.
static float* vReal = nullptr; // FFT sample inputs / freq output - these are our raw result bins
static float* vImag = nullptr; // imaginary parts
-// Create FFT object
+// Crear FFT object
// lib_deps += https://github.com/kosme/arduinoFFT#develop @ 1.9.2
// these options actually cause slow-downs on all esp32 processors, don't use them.
-// #define FFT_SPEED_OVER_PRECISION // enables use of reciprocals (1/x etc) - not faster on ESP32
-// #define FFT_SQRT_APPROXIMATION // enables "quake3" style inverse sqrt - slower on ESP32
+// #definir FFT_SPEED_OVER_PRECISION // enables use of reciprocals (1/x etc) - not faster on ESP32
+// #definir FFT_SQRT_APPROXIMATION // enables "quake3" style inverse sqrt - slower on ESP32
// Below options are forcing ArduinoFFT to use sqrtf() instead of sqrt()
-// #define sqrt_internal sqrtf // see https://github.com/kosme/arduinoFFT/pull/83 - since v2.0.0 this must be done in build_flags
+// #definir sqrt_internal sqrtf // see https://github.com/kosme/arduinoFFT/extraer/83 - since v2.0.0 this must be done in build_flags
#include // FFT object is created in FFTcode
// Helper functions
-// compute average of several FFT result bins
+// compute average of several FFT resultado bins
static float fftAddAvg(int from, int to) {
float result = 0.0f;
for (int i = from; i <= to; i++) {
@@ -217,7 +217,7 @@ static float fftAddAvg(int from, int to) {
}
//
-// FFT main task
+// Tarea principal FFT
//
void FFTcode(void * parameter)
{
@@ -232,10 +232,10 @@ void FFTcode(void * parameter)
if (vImag) free(vImag); vImag = nullptr;
return;
}
- // Create FFT object with weighing factor storage
+ // Crear FFT object with weighing factor almacenamiento
ArduinoFFT FFT = ArduinoFFT( vReal, vImag, samplesFFT, SAMPLE_RATE, true);
- // see https://www.freertos.org/vtaskdelayuntil.html
+ // see https://www.freertos.org/vtaskdelayuntil.HTML
const TickType_t xFrequency = FFT_MIN_CYCLE * portTICK_PERIOD_MS;
TickType_t xLastWakeTime = xTaskGetTickCount();
@@ -243,7 +243,7 @@ void FFTcode(void * parameter)
delay(1); // DO NOT DELETE THIS LINE! It is needed to give the IDLE(0) task enough time and to keep the watchdog happy.
// taskYIELD(), yield(), vTaskDelay() and esp_task_wdt_feed() didn't seem to work.
- // Don't run FFT computing code if we're in Receive mode or in realtime mode
+ // Don't run FFT computing código if we're in Recibir mode or in realtime mode
if (disableSoundProcessing || (audioSyncEnabled & 0x02)) {
vTaskDelayUntil( &xLastWakeTime, xFrequency); // release CPU, and let I2S fill its buffers
continue;
@@ -268,19 +268,19 @@ void FFTcode(void * parameter)
xLastWakeTime = xTaskGetTickCount(); // update "last unblocked time" for vTaskDelay
- // band pass filter - can reduce noise floor by a factor of 50
+ // band pass filtro - can reduce noise piso by a factor of 50
// downside: frequencies below 100Hz will be ignored
if (useBandPassFilter) runMicFilter(samplesFFT, vReal);
- // find highest sample in the batch
+ // encontrar highest sample in the batch
float maxSample = 0.0f; // max sample from FFT batch
for (int i=0; i < samplesFFT; i++) {
- // pick our our current mic sample - we take the max value from all samples that go into FFT
+ // pick our our current mic sample - we take the max valor from all samples that go into FFT
if ((vReal[i] <= (INT16_MAX - 1024)) && (vReal[i] >= (INT16_MIN + 1024))) //skip extreme values - normally these are artefacts
if (fabsf((float)vReal[i]) > maxSample) maxSample = fabsf((float)vReal[i]);
}
- // release highest sample to volume reactive effects early - not strictly necessary here - could also be done at the end of the function
- // early release allows the filters (getSample() and agcAvg()) to work with fresh values - we will have matching gain and noise gate values when we want to process the FFT results.
+ // lanzamiento highest sample to volume reactive effects early - not strictly necessary here - could also be done at the end of the función
+ // early lanzamiento allows the filters (getSample() and agcAvg()) to work with fresh values - we will have matching gain and noise gate values when we want to proceso the FFT results.
micDataReal = maxSample;
#ifdef SR_DEBUG
@@ -292,7 +292,7 @@ void FFTcode(void * parameter)
// run FFT (takes 3-5ms on ESP32, ~12ms on ESP32-S2)
FFT.dcRemoval(); // remove DC offset
FFT.windowing( FFTWindow::Flat_top, FFTDirection::Forward); // Weigh data using "Flat Top" function - better amplitude accuracy
- //FFT.windowing(FFTWindow::Blackman_Harris, FFTDirection::Forward); // Weigh data using "Blackman- Harris" window - sharp peaks due to excellent sideband rejection
+ //FFT.windowing(FFTWindow::Blackman_Harris, FFTDirection::Forward); // Weigh datos usando "Blackman- Harris" window - sharp peaks due to excellent sideband rejection
FFT.compute( FFTDirection::Forward ); // Compute FFT
FFT.complexToMagnitude(); // Compute magnitudes
vReal[0] = 0; // The remaining DC offset on the signal produces a strong spike on position 0 that should be eliminated to avoid issues.
@@ -315,16 +315,16 @@ void FFTcode(void * parameter)
vReal[i] = t / 16.0f; // Reduce magnitude. Want end result to be scaled linear and ~4096 max.
} // for()
- // mapping of FFT result bins to frequency channels
+ // mapping of FFT resultado bins to frecuencia channels
if (fabsf(sampleAvg) > 0.5f) { // noise gate open
#if 0
- /* This FFT post processing is a DIY endeavour. What we really need is someone with sound engineering expertise to do a great job here AND most importantly, that the animations look GREAT as a result.
+ /* This FFT post processing is a DIY endeavour. What we really need is someone with sound engineering expertise to do a great trabajo here AND most importantly, that the animations look GREAT as a resultado.
*
- * Andrew's updated mapping of 256 bins down to the 16 result bins with Sample Freq = 10240, samplesFFT = 512 and some overlap.
- * Based on testing, the lowest/Start frequency is 60 Hz (with bin 3) and a highest/End frequency of 5120 Hz in bin 255.
- * Now, Take the 60Hz and multiply by 1.320367784 to get the next frequency and so on until the end. Then determine the bins.
- * End frequency = Start frequency * multiplier ^ 16
- * Multiplier = (End frequency/ Start frequency) ^ 1/16
+ * Andrew's updated mapping of 256 bins down to the 16 resultado bins with Sample Freq = 10240, samplesFFT = 512 and some overlap.
+ * Based on testing, the lowest/Iniciar frecuencia is 60 Hz (with bin 3) and a highest/End frecuencia of 5120 Hz in bin 255.
+ * Now, Take the 60Hz and multiply by 1.320367784 to get the next frecuencia and so on until the end. Then determine the bins.
+ * End frecuencia = Iniciar frecuencia * multiplier ^ 16
+ * Multiplier = (End frecuencia/ Iniciar frecuencia) ^ 1/16
* Multiplier = 1.320367784
*/ // Range
fftCalc[ 0] = fftAddAvg(2,4); // 60 - 100
@@ -345,9 +345,9 @@ void FFTcode(void * parameter)
fftCalc[15] = fftAddAvg(194,250); // 3880 - 5000 // avoid the last 5 bins, which are usually inaccurate
#else
/* new mapping, optimized for 22050 Hz by softhack007 */
- // bins frequency range
+ // bins frecuencia rango
if (useBandPassFilter) {
- // skip frequencies below 100hz
+ // omitir frequencies below 100hz
fftCalc[ 0] = 0.8f * fftAddAvg(3,4);
fftCalc[ 1] = 0.9f * fftAddAvg(4,5);
fftCalc[ 2] = fftAddAvg(5,6);
@@ -381,7 +381,7 @@ void FFTcode(void * parameter)
}
}
- // post-processing of frequency channels (pink noise adjustment, AGC, smoothing, scaling)
+ // post-processing of frecuencia channels (pink noise adjustment, AGC, smoothing, scaling)
postProcessFFTResults((fabsf(sampleAvg) > 0.25f)? true : false , NUM_GEQ_CHANNELS);
#if defined(WLED_DEBUG) || defined(SR_DEBUG)
@@ -409,15 +409,15 @@ void FFTcode(void * parameter)
static void runMicFilter(uint16_t numSamples, float *sampleBuffer) // pre-filtering of raw samples (band-pass)
{
- // low frequency cutoff parameter - see https://dsp.stackexchange.com/questions/40462/exponential-moving-average-cut-off-frequency
- //constexpr float alpha = 0.04f; // 150Hz
- //constexpr float alpha = 0.03f; // 110Hz
+ // low frecuencia cutoff parámetro - see https://dsp.stackexchange.com/questions/40462/exponential-moving-average-cut-off-frecuencia
+ //constexpr flotante alpha = 0.04f; // 150Hz
+ //constexpr flotante alpha = 0.03f; // 110Hz
constexpr float alpha = 0.0225f; // 80hz
- //constexpr float alpha = 0.01693f;// 60hz
- // high frequency cutoff parameter
- //constexpr float beta1 = 0.75f; // 11Khz
- //constexpr float beta1 = 0.82f; // 15Khz
- //constexpr float beta1 = 0.8285f; // 18Khz
+ //constexpr flotante alpha = 0.01693f;// 60hz
+ // high frecuencia cutoff parámetro
+ //constexpr flotante beta1 = 0.75f; // 11Khz
+ //constexpr flotante beta1 = 0.82f; // 15Khz
+ //constexpr flotante beta1 = 0.8285f; // 18Khz
constexpr float beta1 = 0.85f; // 20Khz
constexpr float beta2 = (1.0f - beta1) / 2.0f;
@@ -425,14 +425,14 @@ static void runMicFilter(uint16_t numSamples, float *sampleBuffer) // p
static float lowfilt = 0.0f; // IIR low frequency cutoff filter
for (int i=0; i < numSamples; i++) {
- // FIR lowpass, to remove high frequency noise
+ // FIR lowpass, to eliminar high frecuencia noise
float highFilteredSample;
if (i < (numSamples-1)) highFilteredSample = beta1*sampleBuffer[i] + beta2*last_vals[0] + beta2*sampleBuffer[i+1]; // smooth out spikes
else highFilteredSample = beta1*sampleBuffer[i] + beta2*last_vals[0] + beta2*last_vals[1]; // special handling for last sample in array
last_vals[1] = last_vals[0];
last_vals[0] = sampleBuffer[i];
sampleBuffer[i] = highFilteredSample;
- // IIR highpass, to remove low frequency noise
+ // IIR highpass, to eliminar low frecuencia noise
lowfilt += alpha * (sampleBuffer[i] - lowfilt);
sampleBuffer[i] = sampleBuffer[i] - lowfilt;
}
@@ -443,10 +443,10 @@ static void postProcessFFTResults(bool noiseGateOpen, int numberOfChannels) // p
for (int i=0; i < numberOfChannels; i++) {
if (noiseGateOpen) { // noise gate open
- // Adjustment for frequency curves.
+ // Adjustment for frecuencia curves.
fftCalc[i] *= fftResultPink[i];
if (FFTScalingMode > 0) fftCalc[i] *= FFT_DOWNSCALE; // adjustment related to FFT windowing function
- // Manual linear adjustment of gain using sampleGain adjustment for different input types.
+ // Manual linear adjustment of gain usando sampleGain adjustment for different entrada types.
fftCalc[i] *= soundAgc ? multAgc : ((float)sampleGain/40.0f * (float)inputLevel/128.0f + 1.0f/16.0f); //apply gain, with inputLevel adjustment
if(fftCalc[i] < 0) fftCalc[i] = 0;
}
@@ -517,13 +517,13 @@ static void postProcessFFTResults(bool noiseGateOpen, int numberOfChannels) // p
// Peak detection //
////////////////////
-// peak detection is called from FFT task when vReal[] contains valid FFT results
+// peak detection is called from FFT tarea when vReal[] contains valid FFT results
static void detectSamplePeak(void) {
bool havePeak = false;
- // softhack007: this code continuously triggers while amplitude in the selected bin is above a certain threshold. So it does not detect peaks - it detects high activity in a frequency bin.
- // Poor man's beat detection by seeing if sample > Average + some value.
+ // softhack007: this código continuously triggers while amplitude in the selected bin is above a certain umbral. So it does not detect peaks - it detects high activity in a frecuencia bin.
+ // Poor man's beat detection by seeing if sample > Average + some valor.
// This goes through ALL of the 255 bins - but ignores stupid settings
- // Then we got a peak, else we don't. The peak has to time out on its own in order to support UDP sound sync.
+ // Then we got a peak, else we don't. The peak has to time out on its own in order to support UDP sound sincronizar.
if ((sampleAvg > 1) && (maxVol > 0) && (binNum > 4) && (vReal[binNum] > maxVol) && ((millis() - timeOfPeak) > 100)) {
havePeak = true;
}
@@ -547,10 +547,10 @@ static void autoResetPeak(void) {
////////////////////
-// usermod class //
+// usermod clase //
////////////////////
-//class name. Use something descriptive and leave the ": public Usermod" part :)
+//clase name. Use something descriptive and leave the ": public Usermod" part :)
class AudioReactive : public Usermod {
private:
@@ -589,7 +589,7 @@ class AudioReactive : public Usermod {
#endif
#endif
- // new "V2" audiosync struct - 44 Bytes
+ // new "V2" audiosync estructura - 44 Bytes
struct __attribute__ ((packed)) audioSyncPacket { // "packed" ensures that there are no additional gaps
char header[6]; // 06 Bytes offset 0
uint8_t reserved1[2]; // 02 Bytes, offset 6 - gap required by the compiler - not used yet
@@ -603,7 +603,7 @@ class AudioReactive : public Usermod {
float FFT_MajorPeak; // 04 Bytes offset 40
};
- // old "V1" audiosync struct - 83 Bytes payload, 88 bytes total (with padding added by compiler) - for backwards compatibility
+ // old "V1" audiosync estructura - 83 Bytes carga útil, 88 bytes total (with padding added by compiler) - for backwards compatibility
struct audioSyncPacket_v1 {
char header[6]; // 06 Bytes
uint8_t myVals[32]; // 32 Bytes
@@ -618,7 +618,7 @@ class AudioReactive : public Usermod {
#define UDPSOUND_MAX_PACKET 88 // max packet size for audiosync
- // set your config variables to their boot default value (this can also be done in readFromConfig() or a constructor if you prefer)
+ // set your config variables to their boot default valor (this can also be done in readFromConfig() or a constructor if you prefer)
#ifdef UM_AUDIOREACTIVE_ENABLE
bool enabled = true;
#else
@@ -629,7 +629,7 @@ class AudioReactive : public Usermod {
bool addPalettes = false;
int8_t palettes = 0;
- // variables for UDP sound sync
+ // variables for UDP sound sincronizar
WiFiUDP fftUdp; // UDP object for sound sync (from WiFi UDP, not Async UDP!)
unsigned long lastTime = 0; // last time of running UDP Microphone Sync
const uint16_t delayMs = 10; // I don't want to sample too often and overload WLED
@@ -658,14 +658,14 @@ class AudioReactive : public Usermod {
int16_t volumeRaw = 0; // either sampleRaw or rawSampleAgc depending on soundAgc
float my_magnitude =0.0f; // FFT_Magnitude, scaled by multAgc
- // used to feed "Info" Page
+ // used to feed "Información" Page
unsigned long last_UDPTime = 0; // time of last valid UDP sound sync datapacket
int receivedFormat = 0; // last received UDP sound sync format - 0=none, 1=v1 (0.13.x), 2=v2 (0.14.x)
float maxSample5sec = 0.0f; // max sample (after AGC) in last 5 seconds
unsigned long sampleMaxTimer = 0; // last time maxSample5sec was reset
#define CYCLE_SAMPLEMAX 3500 // time window for merasuring
- // strings to reduce flash memory usage (used more than twice)
+ // strings to reduce flash memoria usage (used more than twice)
static const char _name[];
static const char _enabled[];
static const char _config[];
@@ -687,13 +687,13 @@ class AudioReactive : public Usermod {
void fillAudioPalettes(void);
////////////////////
- // Debug support //
+ // Depuración support //
////////////////////
void logAudio()
{
if (disableSoundProcessing && (!udpSyncConnected || ((audioSyncEnabled & 0x02) == 0))) return; // no audio availeable
#ifdef MIC_LOGGER
- // Debugging functions for audio input and sound processing. Comment out the values you want to see
+ // Debugging functions for audio entrada and sound processing. Comentario out the values you want to see
PLOT_PRINT("micReal:"); PLOT_PRINT(micDataReal); PLOT_PRINT("\t");
PLOT_PRINT("volumeSmth:"); PLOT_PRINT(volumeSmth); PLOT_PRINT("\t");
//PLOT_PRINT("volumeRaw:"); PLOT_PRINT(volumeRaw); PLOT_PRINT("\t");
@@ -720,21 +720,21 @@ class AudioReactive : public Usermod {
PLOT_PRINTLN();
#endif
- // OPTIONS are in the following format: Description \n Option
+ // OPTIONS are in the following formato: Description \n Option
//
- // Set true if wanting to see all the bands in their own vertical space on the Serial Plotter, false if wanting to see values in Serial Monitor
+ // Set verdadero if wanting to see all the bands in their own vertical space on the Serie Plotter, falso if wanting to see values in Serie Monitor
const bool mapValuesToPlotterSpace = false;
- // Set true to apply an auto-gain like setting to to the data (this hasn't been tested recently)
+ // Set verdadero to apply an auto-gain like setting to to the datos (this hasn't been tested recently)
const bool scaleValuesFromCurrentMaxVal = false;
- // prints the max value seen in the current data
+ // prints the max valor seen in the current datos
const bool printMaxVal = false;
- // prints the min value seen in the current data
+ // prints the min valor seen in the current datos
const bool printMinVal = false;
- // if !scaleValuesFromCurrentMaxVal, we scale values from [0..defaultScalingFromHighValue] to [0..scalingToHighValue], lower this if you want to see smaller values easier
+ // if !scaleValuesFromCurrentMaxVal, we escala values from [0..defaultScalingFromHighValue] to [0..scalingToHighValue], lower this if you want to see smaller values easier
const int defaultScalingFromHighValue = 256;
- // Print values to terminal in range of [0..scalingToHighValue] if !mapValuesToPlotterSpace, or [(i)*scalingToHighValue..(i+1)*scalingToHighValue] if mapValuesToPlotterSpace
+ // Imprimir values to terminal in rango of [0..scalingToHighValue] if !mapValuesToPlotterSpace, or [(i)*scalingToHighValue..(i+1)*scalingToHighValue] if mapValuesToPlotterSpace
const int scalingToHighValue = 256;
- // set higher if using scaleValuesFromCurrentMaxVal and you want a small value that's also the current maxVal to look small on the plotter (can't be 0 to avoid divide by zero error)
+ // set higher if usando scaleValuesFromCurrentMaxVal and you want a small valor that's also the current maxVal to look small on the plotter (can't be 0 to avoid divide by zero error)
const int minimumMaxVal = 1;
int maxVal = minimumMaxVal;
@@ -773,11 +773,11 @@ class AudioReactive : public Usermod {
*
* A few tricks are implemented so that sampleAgc does't only utilize 0% and 100%:
* 0. don't amplify anything below squelch (but keep previous gain)
- * 1. gain input = maximum signal observed in the last 5-10 seconds
- * 2. we use two setpoints, one at ~60%, and one at ~80% of the maximum signal
- * 3. the amplification depends on signal level:
- * a) normal zone - very slow adjustment
- * b) emergency zone (<10% or >90%) - very fast adjustment
+ * 1. gain entrada = maximum señal observed in the last 5-10 seconds
+ * 2. we use two setpoints, one at ~60%, and one at ~80% of the maximum señal
+ * 3. the amplification depends on señal nivel:
+ * a) normal zona - very slow adjustment
+ * b) emergency zona (<10% or >90%) - very fast adjustment
*/
void agcAvg(unsigned long the_time)
{
@@ -792,8 +792,8 @@ class AudioReactive : public Usermod {
if (last_soundAgc != soundAgc)
control_integrated = 0.0; // new preset - reset integrator
- // For PI controller, we need to have a constant "frequency"
- // so let's make sure that the control loop is not running at insane speed
+ // For PI controller, we need to have a constante "frecuencia"
+ // so let's make sure that the control bucle is not running at insane velocidad
static unsigned long last_time = 0;
unsigned long time_now = millis();
if ((the_time > 0) && (the_time < time_now)) time_now = the_time; // allow caller to override my clock
@@ -802,9 +802,9 @@ class AudioReactive : public Usermod {
last_time = time_now;
if((fabsf(sampleReal) < 2.0f) || (sampleMax < 1.0)) {
- // MIC signal is "squelched" - deliver silence
+ // MIC señal is "squelched" - deliver silence
tmpAgc = 0;
- // we need to "spin down" the intgrated error buffer
+ // we need to "spin down" the intgrated error búfer
if (fabs(control_integrated) < 0.01) control_integrated = 0.0;
else control_integrated *= 0.91;
} else {
@@ -814,7 +814,7 @@ class AudioReactive : public Usermod {
else
multAgcTemp = agcTarget1[AGC_preset] / sampleMax; // Make the multiplier so that sampleMax * multiplier = second setpoint
}
- // limit amplification
+ // límite amplification
if (multAgcTemp > 32.0f) multAgcTemp = 32.0f;
if (multAgcTemp < 1.0f/64.0f) multAgcTemp = 1.0f/64.0f;
@@ -837,23 +837,23 @@ class AudioReactive : public Usermod {
multAgcTemp += agcFollowSlow[AGC_preset] * agcControlKi[AGC_preset] * control_integrated;
}
- // limit amplification again - PI controller sometimes "overshoots"
+ // límite amplification again - PI controller sometimes "overshoots"
//multAgcTemp = constrain(multAgcTemp, 0.015625f, 32.0f); // 1/64 < multAgcTemp < 32
if (multAgcTemp > 32.0f) multAgcTemp = 32.0f;
if (multAgcTemp < 1.0f/64.0f) multAgcTemp = 1.0f/64.0f;
}
- // NOW finally amplify the signal
+ // NOW finally amplify the señal
tmpAgc = sampleReal * multAgcTemp; // apply gain to signal
if (fabsf(sampleReal) < 2.0f) tmpAgc = 0.0f; // apply squelch threshold
//tmpAgc = constrain(tmpAgc, 0, 255);
if (tmpAgc > 255) tmpAgc = 255.0f; // limit to 8bit
if (tmpAgc < 1) tmpAgc = 0.0f; // just to be sure
- // update global vars ONCE - multAgc, sampleAGC, rawSampleAgc
+ // actualizar global vars ONCE - multAgc, sampleAGC, rawSampleAgc
multAgc = multAgcTemp;
rawSampleAgc = 0.8f * tmpAgc + 0.2f * (float)rawSampleAgc;
- // update smoothed AGC sample
+ // actualizar smoothed AGC sample
if (fabsf(tmpAgc) < 1.0f)
sampleAgc = 0.5f * tmpAgc + 0.5f * sampleAgc; // fast path to zero
else
@@ -878,8 +878,8 @@ class AudioReactive : public Usermod {
#ifdef ARDUINO_ARCH_ESP32
micIn = int(micDataReal); // micDataSm = ((micData * 3) + micData)/4;
#else
- // this is the minimal code for reading analog mic input on 8266.
- // warning!! Absolutely experimental code. Audio on 8266 is still not working. Expects a million follow-on problems.
+ // this is the minimal código for reading analog mic entrada on 8266.
+ // advertencia!! Absolutely experimental código. Audio on 8266 is still not funcionamiento. Expects a million follow-on problems.
static unsigned long lastAnalogTime = 0;
static float lastAnalogValue = 0.0f;
if (millis() - lastAnalogTime > 20) {
@@ -896,7 +896,7 @@ class AudioReactive : public Usermod {
if(micIn < micLev) micLev = ((micLev * 31.0f) + micDataReal) / 32.0f; // align MicLev to lowest input signal
micIn -= micLev; // Let's center it to 0 now
- // Using an exponential filter to smooth out the signal. We'll add controls for this in a future release.
+ // Usando an exponential filtro to smooth out the señal. We'll add controls for this in a futuro lanzamiento.
float micInNoDC = fabsf(micDataReal - micLev);
expAdjF = (weighting * micInNoDC + (1.0f-weighting) * expAdjF);
expAdjF = fabsf(expAdjF); // Now (!) take the absolute value
@@ -913,7 +913,7 @@ class AudioReactive : public Usermod {
sampleAdj = fmax(fmin(sampleAdj, 255), 0); // Question: why are we limiting the value to 8 bits ???
sampleRaw = (int16_t)sampleAdj; // ONLY update sample ONCE!!!!
- // keep "peak" sample, but decay value if current sample is below peak
+ // keep "peak" sample, but decay valor if current sample is below peak
if ((sampleMax < sampleReal) && (sampleReal > 0.5f)) {
sampleMax = sampleMax + 0.5f * (sampleReal - sampleMax); // new peak - with some filtering
// another simple way to detect samplePeak - cannot detect beats, but reacts on peak volume
@@ -968,13 +968,13 @@ class AudioReactive : public Usermod {
//////////////////////
- // UDP Sound Sync //
+ // UDP Sound Sincronizar //
//////////////////////
- // try to establish UDP sound sync connection
+ // try to establish UDP sound sincronizar conexión
void connectUDPSoundSync(void) {
- // This function tries to establish a UDP sync connection if needed
- // necessary as we also want to transmit in "AP Mode", but the standard "connected()" callback only reacts on STA connection
+ // This función tries to establish a UDP sincronizar conexión if needed
+ // necessary as we also want to transmit in "AP Mode", but the estándar "connected()" devolución de llamada only reacts on STA conexión
static unsigned long last_connection_attempt = 0;
if ((audioSyncPort <= 0) || ((audioSyncEnabled & 0x03) == 0)) return; // Sound Sync not enabled
@@ -983,7 +983,7 @@ class AudioReactive : public Usermod {
if (millis() - last_connection_attempt < 15000) return; // only try once in 15 seconds
if (updateIsRunning) return;
- // if we arrive here, we need a UDP connection but don't have one
+ // if we arrive here, we need a UDP conexión but don't have one
last_connection_attempt = millis();
connected(); // try to start UDP
}
@@ -1032,19 +1032,19 @@ class AudioReactive : public Usermod {
memset(&receivedPacket, 0, sizeof(receivedPacket)); // start clean
memcpy(&receivedPacket, fftBuff, min((unsigned)packetSize, (unsigned)sizeof(receivedPacket))); // don't violate alignment - thanks @willmmiles#
- // update samples for effects
+ // actualizar samples for effects
volumeSmth = fmaxf(receivedPacket.sampleSmth, 0.0f);
volumeRaw = fmaxf(receivedPacket.sampleRaw, 0.0f);
#ifdef ARDUINO_ARCH_ESP32
- // update internal samples
+ // actualizar internal samples
sampleRaw = volumeRaw;
sampleAvg = volumeSmth;
rawSampleAgc = volumeRaw;
sampleAgc = volumeSmth;
multAgc = 1.0f;
#endif
- // Only change samplePeak IF it's currently false.
- // If it's true already, then the animation still needs to respond.
+ // Only change samplePeak IF it's currently falso.
+ // If it's verdadero already, then the animación still needs to respond.
autoResetPeak();
if (!samplePeak) {
samplePeak = receivedPacket.samplePeak >0 ? true:false;
@@ -1060,19 +1060,19 @@ class AudioReactive : public Usermod {
void decodeAudioData_v1(int packetSize, uint8_t *fftBuff) {
audioSyncPacket_v1 *receivedPacket = reinterpret_cast(fftBuff);
- // update samples for effects
+ // actualizar samples for effects
volumeSmth = fmaxf(receivedPacket->sampleAgc, 0.0f);
volumeRaw = volumeSmth; // V1 format does not have "raw" AGC sample
#ifdef ARDUINO_ARCH_ESP32
- // update internal samples
+ // actualizar internal samples
sampleRaw = fmaxf(receivedPacket->sampleRaw, 0.0f);
sampleAvg = fmaxf(receivedPacket->sampleAvg, 0.0f);;
sampleAgc = volumeSmth;
rawSampleAgc = volumeRaw;
multAgc = 1.0f;
#endif
- // Only change samplePeak IF it's currently false.
- // If it's true already, then the animation still needs to respond.
+ // Only change samplePeak IF it's currently falso.
+ // If it's verdadero already, then the animación still needs to respond.
autoResetPeak();
if (!samplePeak) {
samplePeak = receivedPacket->samplePeak >0 ? true:false;
@@ -1096,20 +1096,20 @@ class AudioReactive : public Usermod {
if ((packetSize > 0) && ((packetSize < 5) || (packetSize > UDPSOUND_MAX_PACKET))) fftUdp.flush(); // discard invalid packets (too small or too big) - only works on esp32
#endif
if ((packetSize > 5) && (packetSize <= UDPSOUND_MAX_PACKET)) {
- //DEBUGSR_PRINTLN("Received UDP Sync Packet");
+ //DEBUGSR_PRINTLN("Received UDP Sincronizar Packet");
uint8_t fftBuff[UDPSOUND_MAX_PACKET+1] = { 0 }; // fixed-size buffer for receiving (stack), to avoid heap fragmentation caused by variable sized arrays
fftUdp.read(fftBuff, packetSize);
// VERIFY THAT THIS IS A COMPATIBLE PACKET
if (packetSize == sizeof(audioSyncPacket) && (isValidUdpSyncVersion((const char *)fftBuff))) {
decodeAudioData(packetSize, fftBuff);
- //DEBUGSR_PRINTLN("Finished parsing UDP Sync Packet v2");
+ //DEBUGSR_PRINTLN("Finished parsing UDP Sincronizar Packet v2");
haveFreshData = true;
receivedFormat = 2;
} else {
if (packetSize == sizeof(audioSyncPacket_v1) && (isValidUdpSyncVersion_v1((const char *)fftBuff))) {
decodeAudioData_v1(packetSize, fftBuff);
- //DEBUGSR_PRINTLN("Finished parsing UDP Sync Packet v1");
+ //DEBUGSR_PRINTLN("Finished parsing UDP Sincronizar Packet v1");
haveFreshData = true;
receivedFormat = 1;
} else receivedFormat = 0; // unknown format
@@ -1127,16 +1127,16 @@ class AudioReactive : public Usermod {
//Functions called by WLED or other usermods
/*
- * setup() is called once at boot. WiFi is not yet connected at this point.
- * You can use it to initialize variables, sensors or similar.
- * It is called *AFTER* readFromConfig()
+ * `configuración()` se llama una vez al arrancar. En este punto WiFi aún no está conectado.
+ * Úsalo para inicializar variables, sensores o similares.
+ * Se llama *DESPUÉS* de `readFromConfig()`.
*/
void setup() override
{
disableSoundProcessing = true; // just to be sure
if (!initDone) {
- // usermod exchangeable data
- // we will assign all usermod exportable data here as pointers to original variables or arrays and allocate memory for pointers
+ // usermod exchangeable datos
+ // we will assign all usermod exportable datos here as pointers to original variables or arrays and allocate memoria for pointers
um_data = new um_data_t;
um_data->u_size = 8;
um_data->u_type = new um_types_t[um_data->u_size];
@@ -1153,131 +1153,131 @@ class AudioReactive : public Usermod {
um_data->u_type[4] = UMT_FLOAT;
um_data->u_data[5] = &my_magnitude; // used (New)
um_data->u_type[5] = UMT_FLOAT;
- um_data->u_data[6] = &maxVol; // assigned in effect function from UI element!!! (Puddlepeak, Ripplepeak, Waterfall)
+ um_data->u_data[6] = &maxVol; // assigned in efecto función from UI element!!! (Puddlepeak, Ripplepeak, Waterfall)
um_data->u_type[6] = UMT_BYTE;
- um_data->u_data[7] = &binNum; // assigned in effect function from UI element!!! (Puddlepeak, Ripplepeak, Waterfall)
+ um_data->u_data[7] = &binNum; // assigned in efecto función from UI element!!! (Puddlepeak, Ripplepeak, Waterfall)
um_data->u_type[7] = UMT_BYTE;
}
-#ifdef ARDUINO_ARCH_ESP32
+#si está definido ARDUINO_ARCH_ESP32
- // Reset I2S peripheral for good measure
- i2s_driver_uninstall(I2S_NUM_0); // E (696) I2S: i2s_driver_uninstall(2006): I2S port 0 has not installed
+ // Restablecer I2S peripheral for good measure
+ i2s_driver_uninstall(I2S_NUM_0); // E (696) I2S: i2s_driver_uninstall(2006): I2S puerto 0 has not installed
#if !defined(CONFIG_IDF_TARGET_ESP32C3)
- delay(100);
+ retraso(100);
periph_module_reset(PERIPH_I2S0_MODULE); // not possible on -C3
- #endif
- delay(100); // Give that poor microphone some time to setup.
+ #fin si
+ retraso(100); // Give that poor microphone some time to configuración.
- useBandPassFilter = false;
+ useBandPassFilter = falso;
#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3)
- if ((i2sckPin == I2S_PIN_NO_CHANGE) && (i2ssdPin >= 0) && (i2swsPin >= 0) && ((dmType == 1) || (dmType == 4)) ) dmType = 5; // dummy user support: SCK == -1 --means--> PDM microphone
- #endif
+ if ((i2sckPin == I2S_PIN_NO_CHANGE) && (i2ssdPin >= 0) && (i2swsPin >= 0) && ((dmType == 1) || (dmType == 4)) ) dmType = 5; // dummy usuario support: SCK == -1 --means--> PDM microphone
+ #fin si
- switch (dmType) {
+ conmutador (dmType) {
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S3)
// stub cases for not-yet-supported I2S modes on other ESP32 chips
case 0: //ADC analog
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3)
case 5: //PDM Microphone
- #endif
- #endif
+ #fin si
+ #fin si
case 1:
- DEBUGSR_PRINT(F("AR: Generic I2S Microphone - ")); DEBUGSR_PRINTLN(F(I2S_MIC_CHANNEL_TEXT));
+ DEBUGSR_PRINT(F("AR: Genérico I2S Microphone - ")); DEBUGSR_PRINTLN(F(I2S_MIC_CHANNEL_TEXT));
audioSource = new I2SSource(SAMPLE_RATE, BLOCK_SIZE);
- delay(100);
- if (audioSource) audioSource->initialize(i2swsPin, i2ssdPin, i2sckPin);
- break;
+ retraso(100);
+ if (audioSource) audioSource->inicializar(i2swsPin, i2ssdPin, i2sckPin);
+ ruptura;
case 2:
DEBUGSR_PRINTLN(F("AR: ES7243 Microphone (right channel only)."));
audioSource = new ES7243(SAMPLE_RATE, BLOCK_SIZE);
- delay(100);
- if (audioSource) audioSource->initialize(i2swsPin, i2ssdPin, i2sckPin, mclkPin);
- break;
+ retraso(100);
+ if (audioSource) audioSource->inicializar(i2swsPin, i2ssdPin, i2sckPin, mclkPin);
+ ruptura;
case 3:
DEBUGSR_PRINT(F("AR: SPH0645 Microphone - ")); DEBUGSR_PRINTLN(F(I2S_MIC_CHANNEL_TEXT));
audioSource = new SPH0654(SAMPLE_RATE, BLOCK_SIZE);
- delay(100);
- audioSource->initialize(i2swsPin, i2ssdPin, i2sckPin);
- break;
+ retraso(100);
+ audioSource->inicializar(i2swsPin, i2ssdPin, i2sckPin);
+ ruptura;
case 4:
- DEBUGSR_PRINT(F("AR: Generic I2S Microphone with Master Clock - ")); DEBUGSR_PRINTLN(F(I2S_MIC_CHANNEL_TEXT));
+ DEBUGSR_PRINT(F("AR: Genérico I2S Microphone with Master Clock - ")); DEBUGSR_PRINTLN(F(I2S_MIC_CHANNEL_TEXT));
audioSource = new I2SSource(SAMPLE_RATE, BLOCK_SIZE, 1.0f/24.0f);
- delay(100);
- if (audioSource) audioSource->initialize(i2swsPin, i2ssdPin, i2sckPin, mclkPin);
- break;
+ retraso(100);
+ if (audioSource) audioSource->inicializar(i2swsPin, i2ssdPin, i2sckPin, mclkPin);
+ ruptura;
#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3)
case 5:
DEBUGSR_PRINT(F("AR: I2S PDM Microphone - ")); DEBUGSR_PRINTLN(F(I2S_PDM_MIC_CHANNEL_TEXT));
audioSource = new I2SSource(SAMPLE_RATE, BLOCK_SIZE, 1.0f/4.0f);
- useBandPassFilter = true; // this reduces the noise floor on SPM1423 from 5% Vpp (~380) down to 0.05% Vpp (~5)
- delay(100);
- if (audioSource) audioSource->initialize(i2swsPin, i2ssdPin);
- break;
- #endif
+ useBandPassFilter = verdadero; // this reduces the noise piso on SPM1423 from 5% Vpp (~380) down to 0.05% Vpp (~5)
+ retraso(100);
+ if (audioSource) audioSource->inicializar(i2swsPin, i2ssdPin);
+ ruptura;
+ #fin si
case 6:
DEBUGSR_PRINTLN(F("AR: ES8388 Source"));
audioSource = new ES8388Source(SAMPLE_RATE, BLOCK_SIZE);
- delay(100);
- if (audioSource) audioSource->initialize(i2swsPin, i2ssdPin, i2sckPin, mclkPin);
- break;
+ retraso(100);
+ if (audioSource) audioSource->inicializar(i2swsPin, i2ssdPin, i2sckPin, mclkPin);
+ ruptura;
#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3)
// ADC over I2S is only possible on "classic" ESP32
case 0:
DEBUGSR_PRINTLN(F("AR: Analog Microphone (left channel only)."));
audioSource = new I2SAdcSource(SAMPLE_RATE, BLOCK_SIZE);
- delay(100);
- useBandPassFilter = true; // PDM bandpass filter seems to help for bad quality analog
- if (audioSource) audioSource->initialize(audioPin);
- break;
- #endif
-
- case 254: // dummy "network receive only" mode
- if (audioSource) delete audioSource; audioSource = nullptr;
- disableSoundProcessing = true;
- audioSyncEnabled = 2; // force udp sound receive mode
- enabled = true;
- break;
+ retraso(100);
+ useBandPassFilter = verdadero; // PDM bandpass filtro seems to help for bad quality analog
+ if (audioSource) audioSource->inicializar(audioPin);
+ ruptura;
+ #fin si
+
+ case 254: // dummy "red recibir only" mode
+ if (audioSource) eliminar audioSource; audioSource = nullptr;
+ disableSoundProcessing = verdadero;
+ audioSyncEnabled = 2; // force UDP sound recibir mode
+ enabled = verdadero;
+ ruptura;
case 255: // 255 = -1 = no audio source
// falls through to default
default:
- if (audioSource) delete audioSource; audioSource = nullptr;
- disableSoundProcessing = true;
- enabled = false;
- break;
+ if (audioSource) eliminar audioSource; audioSource = nullptr;
+ disableSoundProcessing = verdadero;
+ enabled = falso;
+ ruptura;
}
- delay(250); // give microphone enough time to initialise
+ retraso(250); // give microphone enough time to initialise
- if (!audioSource && (dmType != 254)) enabled = false;// audio failed to initialise
-#endif
- if (enabled) onUpdateBegin(false); // create FFT task, and initialize network
+ if (!audioSource && (dmType != 254)) enabled = falso;// audio failed to initialise
+#fin si
+ if (enabled) onUpdateBegin(falso); // crear FFT tarea, and inicializar red
-#ifdef ARDUINO_ARCH_ESP32
- if (FFT_Task == nullptr) enabled = false; // FFT task creation failed
- if((!audioSource) || (!audioSource->isInitialized())) { // audio source failed to initialize. Still stay "enabled", as there might be input arriving via UDP Sound Sync
- #ifdef WLED_DEBUG
- DEBUG_PRINTLN(F("AR: Failed to initialize sound input driver. Please check input PIN settings."));
+#si está definido ARDUINO_ARCH_ESP32
+ if (FFT_Task == nullptr) enabled = falso; // FFT tarea creation failed
+ if((!audioSource) || (!audioSource->isInitialized())) { // audio source failed to inicializar. Still stay "enabled", as there might be entrada arriving via UDP Sound Sincronizar
+ #si está definido WLED_DEBUG
+ DEBUG_PRINTLN(F("AR: Failed to inicializar sound entrada controlador. Please verificar entrada PIN settings."));
#else
- DEBUGSR_PRINTLN(F("AR: Failed to initialize sound input driver. Please check input PIN settings."));
- #endif
- disableSoundProcessing = true;
+ DEBUGSR_PRINTLN(F("AR: Failed to inicializar sound entrada controlador. Please verificar entrada PIN settings."));
+ #fin si
+ disableSoundProcessing = verdadero;
}
-#endif
- if (enabled) disableSoundProcessing = false; // all good - enable audio processing
+#fin si
+ if (enabled) disableSoundProcessing = falso; // all good - habilitar audio processing
if (enabled) connectUDPSoundSync();
if (enabled && addPalettes) createAudioPalettes();
- initDone = true;
+ initDone = verdadero;
}
/*
* connected() is called every time the WiFi is (re)connected
- * Use it to initialize network interfaces
+ * Use it to inicializar red interfaces
*/
void connected() override
{
@@ -1297,14 +1297,14 @@ class AudioReactive : public Usermod {
/*
- * loop() is called continuously. Here you can check for events, read sensors, etc.
+ * bucle() is called continuously. Here you can verificar for events, leer sensors, etc.
*
* Tips:
- * 1. You can use "if (WLED_CONNECTED)" to check for a successful network connection.
- * Additionally, "if (WLED_MQTT_CONNECTED)" is available to check for a connection to an MQTT broker.
+ * 1. You can use "if (WLED_CONNECTED)" to verificar for a successful red conexión.
+ * Additionally, "if (WLED_MQTT_CONNECTED)" is available to verificar for a conexión to an MQTT broker.
*
- * 2. Try to avoid using the delay() function. NEVER use delays longer than 10 milliseconds.
- * Instead, use a timer check as shown here.
+ * 2. Intentar to avoid usando the retraso() función. NEVER use delays longer than 10 milliseconds.
+ * Instead, use a temporizador verificar as shown here.
*/
void loop() override
{
@@ -1315,7 +1315,7 @@ class AudioReactive : public Usermod {
lastUMRun = millis(); // update time keeping
return;
}
- // We cannot wait indefinitely before processing audio data
+ // We cannot wait indefinitely before processing audio datos
if (strip.isUpdating() && (millis() - lastUMRun < 2)) return; // be nice, but not too nice
// suspend local sound processing when "real time mode" is active (E131, UDP, ADALIGHT, ARTNET)
@@ -1350,7 +1350,7 @@ class AudioReactive : public Usermod {
if (!audioSource || !audioSource->isInitialized()) disableSoundProcessing = true; // no audio source
- // Only run the sampling code IF we're not in Receive mode or realtime mode
+ // Only run the sampling código IF we're not in Recibir mode or realtime mode
if (!(audioSyncEnabled & 0x02) && !disableSoundProcessing) {
if (soundAgc > AGC_NUM_PRESETS) soundAgc = 0; // make sure that AGC preset is valid (to avoid array bounds violation)
@@ -1366,7 +1366,7 @@ class AudioReactive : public Usermod {
//}
#endif
- // run filters, and repeat in case of loop delays (hick-up compensation)
+ // run filters, and repeat in case of bucle delays (hick-up compensation)
if (userloopDelay <2) userloopDelay = 0; // minor glitch, no problem
if (userloopDelay >200) userloopDelay = 200; // limit number of filter re-runs
do {
@@ -1376,10 +1376,10 @@ class AudioReactive : public Usermod {
} while (userloopDelay > 0);
lastUMRun = t_now; // update time keeping
- // update samples for effects (raw, smooth)
+ // actualizar samples for effects (raw, smooth)
volumeSmth = (soundAgc) ? sampleAgc : sampleAvg;
volumeRaw = (soundAgc) ? rawSampleAgc: sampleRaw;
- // update FFTMagnitude, taking into account AGC amplification
+ // actualizar FFTMagnitude, taking into account AGC amplification
my_magnitude = FFT_Magnitude; // / 16.0f, 8.0f, 4.0f done in effects
if (soundAgc) my_magnitude *= multAgc;
if (volumeSmth < 1 ) my_magnitude = 0.001f; // noise gate closed - mute
@@ -1393,9 +1393,9 @@ class AudioReactive : public Usermod {
connectUDPSoundSync(); // ensure we have a connection - if needed
- // UDP Microphone Sync - receive mode
+ // UDP Microphone Sincronizar - recibir mode
if ((audioSyncEnabled & 0x02) && udpSyncConnected) {
- // Only run the audio listener code if we're in Receive mode
+ // Only run the audio escuchador código if we're in Recibir mode
static float syncVolumeSmth = 0;
bool have_new_sample = false;
if (millis() - lastTime > delayMs) {
@@ -1419,7 +1419,7 @@ class AudioReactive : public Usermod {
}
#endif
- // Info Page: keep max sample from last 5 seconds
+ // Información Page: keep max sample from last 5 seconds
#ifdef ARDUINO_ARCH_ESP32
if ((millis() - sampleMaxTimer) > CYCLE_SAMPLEMAX) {
sampleMaxTimer = millis();
@@ -1440,9 +1440,9 @@ class AudioReactive : public Usermod {
#endif
#ifdef ARDUINO_ARCH_ESP32
- //UDP Microphone Sync - transmit mode
+ //UDP Microphone Sincronizar - transmit mode
if ((audioSyncEnabled & 0x01) && (millis() - lastTime > 20)) {
- // Only run the transmit code IF we're in Transmit mode
+ // Only run the transmit código IF we're in Transmit mode
transmitAudioData();
lastTime = millis();
}
@@ -1465,17 +1465,17 @@ class AudioReactive : public Usermod {
#ifdef WLED_DEBUG
fftTime = sampleTime = 0;
#endif
- // gracefully suspend FFT task (if running)
+ // gracefully suspend FFT tarea (if running)
disableSoundProcessing = true;
- // reset sound data
+ // restablecer sound datos
micDataReal = 0.0f;
volumeRaw = 0; volumeSmth = 0;
sampleAgc = 0; sampleAvg = 0;
sampleRaw = 0; rawSampleAgc = 0;
my_magnitude = 0; FFT_Magnitude = 0; FFT_MajorPeak = 1;
multAgc = 1;
- // reset FFT data
+ // restablecer FFT datos
memset(fftCalc, 0, sizeof(fftCalc));
memset(fftAvg, 0, sizeof(fftAvg));
memset(fftResult, 0, sizeof(fftResult));
@@ -1491,7 +1491,7 @@ class AudioReactive : public Usermod {
fftUdp.stop();
}
} else {
- // update has failed or create task requested
+ // actualizar has failed or crear tarea requested
if (FFT_Task) {
vTaskResume(FFT_Task);
connected(); // resume UDP
@@ -1516,7 +1516,7 @@ class AudioReactive : public Usermod {
{
// gracefully suspend audio (if running)
disableSoundProcessing = true;
- // reset sound data
+ // restablecer sound datos
volumeRaw = 0; volumeSmth = 0;
for(int i=(init?0:1); i=0
@@ -1553,13 +1553,13 @@ class AudioReactive : public Usermod {
#endif
////////////////////////////
- // Settings and Info Page //
+ // Settings and Información Page //
////////////////////////////
/*
- * addToJsonInfo() can be used to add custom entries to the /json/info part of the JSON API.
- * Creating an "u" object allows you to add custom key/value pairs to the Info section of the WLED web UI.
- * Below it is shown how this could be used for e.g. a light sensor
+ * `addToJsonInfo()` puede usarse para añadir entradas personalizadas a /JSON/información de la API JSON.
+ * Crear un objeto "u" permite añadir pares clave/valor a la sección Información de la UI web de WLED.
+ * A continuación se muestra un ejemplo.
*/
void addToJsonInfo(JsonObject& root) override
{
@@ -1584,7 +1584,7 @@ class AudioReactive : public Usermod {
if (enabled) {
#ifdef ARDUINO_ARCH_ESP32
- // Input Level Slider
+ // Entrada Nivel Slider
if (disableSoundProcessing == false) { // only show slider when audio processing is running
if (soundAgc > 0) {
infoArr = user.createNestedArray(F("GEQ Input Level")); // if AGC is on, this slider only affects fftResult[] frequencies
@@ -1601,12 +1601,12 @@ class AudioReactive : public Usermod {
infoArr.add(uiDomString);
}
#endif
- // The following can be used for troubleshooting user errors and is so not enclosed in #ifdef WLED_DEBUG
+ // The following can be used for troubleshooting usuario errors and is so not enclosed in #si está definido WLED_DEBUG
- // current Audio input
+ // current Audio entrada
infoArr = user.createNestedArray(F("Audio Source"));
if (audioSyncEnabled & 0x02) {
- // UDP sound sync - receive mode
+ // UDP sound sincronizar - recibir mode
infoArr.add(F("UDP sound sync"));
if (udpSyncConnected) {
if (millis() - last_UDPTime < 2500)
@@ -1622,7 +1622,7 @@ class AudioReactive : public Usermod {
}
#else // ESP32 only
} else {
- // Analog or I2S digital input
+ // Analog or I2S digital entrada
if (audioSource && (audioSource->isInitialized())) {
// audio source successfully configured
if (audioSource->getType() == AudioSource::Type_I2SAdc) {
@@ -1630,7 +1630,7 @@ class AudioReactive : public Usermod {
} else {
infoArr.add(F("I2S digital"));
}
- // input level or "silence"
+ // entrada nivel or "silence"
if (maxSample5sec > 1.0f) {
float my_usage = 100.0f * (maxSample5sec / 255.0f);
snprintf_P(myStringBuffer, 15, PSTR(" - peak %3d%%"), int(my_usage));
@@ -1639,13 +1639,13 @@ class AudioReactive : public Usermod {
infoArr.add(F(" - quiet"));
}
} else {
- // error during audio source setup
+ // error during audio source configuración
infoArr.add(F("not initialized"));
infoArr.add(F(" - check pin settings"));
}
}
- // Sound processing (FFT and input filters)
+ // Sound processing (FFT and entrada filters)
infoArr = user.createNestedArray(F("Sound Processing"));
if (audioSource && (disableSoundProcessing == false)) {
infoArr.add(F("running"));
@@ -1666,7 +1666,7 @@ class AudioReactive : public Usermod {
infoArr.add("x");
}
#endif
- // UDP Sound Sync status
+ // UDP Sound Sincronizar estado
infoArr = user.createNestedArray(F("UDP Sound Sync"));
if (audioSyncEnabled) {
if (audioSyncEnabled & 0x01) {
@@ -1707,8 +1707,8 @@ class AudioReactive : public Usermod {
/*
- * addToJsonState() can be used to add custom entries to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * addToJsonState() can be used to add custom entries to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
void addToJsonState(JsonObject& root) override
{
@@ -1722,8 +1722,8 @@ class AudioReactive : public Usermod {
/*
- * readFromJsonState() can be used to receive data clients send to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * readFromJsonState() can be used to recibir datos clients enviar to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
void readFromJsonState(JsonObject& root) override
{
@@ -1735,7 +1735,7 @@ class AudioReactive : public Usermod {
enabled = usermod[FPSTR(_enabled)].as();
if (prevEnabled != enabled) onUpdateBegin(!enabled);
if (addPalettes) {
- // add/remove custom/audioreactive palettes
+ // add/eliminar custom/audioreactive palettes
if (prevEnabled && !enabled) removeAudioPalettes();
if (!prevEnabled && enabled) createAudioPalettes();
}
@@ -1747,7 +1747,7 @@ class AudioReactive : public Usermod {
#endif
}
if (root.containsKey(F("rmcpal")) && root[F("rmcpal")].as()) {
- // handle removal of custom palettes from JSON call so we don't break things
+ // handle removal of custom palettes from JSON call so we don't ruptura things
removeAudioPalettes();
}
}
@@ -1760,37 +1760,37 @@ class AudioReactive : public Usermod {
}
/*
- * addToConfig() can be used to add custom persistent settings to the cfg.json file in the "um" (usermod) object.
+ * addToConfig() can be used to add custom persistent settings to the cfg.JSON archivo in the "um" (usermod) object.
* It will be called by WLED when settings are actually saved (for example, LED settings are saved)
- * If you want to force saving the current state, use serializeConfig() in your loop().
+ * If you want to force saving the current estado, use serializeConfig() in your bucle().
*
- * CAUTION: serializeConfig() will initiate a filesystem write operation.
+ * CAUTION: serializeConfig() will initiate a filesystem escribir operation.
* It might cause the LEDs to stutter and will cause flash wear if called too often.
- * Use it sparingly and always in the loop, never in network callbacks!
+ * Use it sparingly and always in the bucle, never in red callbacks!
*
* addToConfig() will make your settings editable through the Usermod Settings page automatically.
*
* Usermod Settings Overview:
* - Numeric values are treated as floats in the browser.
- * - If the numeric value entered into the browser contains a decimal point, it will be parsed as a C float
- * before being returned to the Usermod. The float data type has only 6-7 decimal digits of precision, and
- * doubles are not supported, numbers will be rounded to the nearest float value when being parsed.
- * The range accepted by the input field is +/- 1.175494351e-38 to +/- 3.402823466e+38.
- * - If the numeric value entered into the browser doesn't contain a decimal point, it will be parsed as a
- * C int32_t (range: -2147483648 to 2147483647) before being returned to the usermod.
- * Overflows or underflows are truncated to the max/min value for an int32_t, and again truncated to the type
- * used in the Usermod when reading the value from ArduinoJson.
- * - Pin values can be treated differently from an integer value by using the key name "pin"
- * - "pin" can contain a single or array of integer values
+ * - If the numeric valor entered into the browser contains a decimal point, it will be parsed as a C flotante
+ * before being returned to the Usermod. The flotante datos tipo has only 6-7 decimal digits of precisión, and
+ * doubles are not supported, numbers will be rounded to the nearest flotante valor when being parsed.
+ * The rango accepted by the entrada campo is +/- 1.175494351e-38 to +/- 3.402823466e+38.
+ * - If the numeric valor entered into the browser doesn't contain a decimal point, it will be parsed as a
+ * C int32_t (rango: -2147483648 to 2147483647) before being returned to the usermod.
+ * Overflows or underflows are truncated to the max/min valor for an int32_t, and again truncated to the tipo
+ * used in the Usermod when reading the valor from ArduinoJson.
+ * - Pin values can be treated differently from an entero valor by usando the key name "pin"
+ * - "pin" can contain a single or matriz of entero values
* - On the Usermod Settings page there is simple checking for pin conflicts and warnings for special pins
- * - Red color indicates a conflict. Yellow color indicates a pin with a warning (e.g. an input-only pin)
- * - Tip: use int8_t to store the pin value in the Usermod, so a -1 value (pin not set) can be used
+ * - Red color indicates a conflicto. Yellow color indicates a pin with a advertencia (e.g. an entrada-only pin)
+ * - Tip: use int8_t to store the pin valor in the Usermod, so a -1 valor (pin not set) can be used
*
* See usermod_v2_auto_save.h for an example that saves Flash space by reusing ArduinoJson key name strings
*
* If you need a dedicated settings page with custom layout for your Usermod, that takes a lot more work.
- * You will have to add the setting to the HTML, xml.cpp and set.cpp manually.
- * See the WLED Soundreactive fork (code and wiki) for reference. https://github.com/atuline/WLED
+ * You will have to add the setting to the HTML, XML.cpp and set.cpp manually.
+ * See the WLED Soundreactive bifurcación (código and wiki) for reference. https://github.com/atuline/WLED
*
* I highly recommend checking out the basics of ArduinoJson serialization and deserialization in order to use custom settings!
*/
@@ -1835,19 +1835,19 @@ class AudioReactive : public Usermod {
/*
- * readFromConfig() can be used to read back the custom settings you added with addToConfig().
+ * readFromConfig() can be used to leer back the custom settings you added with addToConfig().
* This is called by WLED when settings are loaded (currently this only happens immediately after boot, or after saving on the Usermod Settings page)
*
- * readFromConfig() is called BEFORE setup(). This means you can use your persistent values in setup() (e.g. pin assignments, buffer sizes),
- * but also that if you want to write persistent values to a dynamic buffer, you'd need to allocate it here instead of in setup.
+ * readFromConfig() is called BEFORE configuración(). This means you can use your persistent values in configuración() (e.g. pin assignments, búfer sizes),
+ * but also that if you want to escribir persistent values to a dynamic búfer, you'd need to allocate it here instead of in configuración.
* If you don't know what that is, don't fret. It most likely doesn't affect your use case :)
*
- * Return true in case the config values returned from Usermod Settings were complete, or false if you'd like WLED to save your defaults to disk (so any missing values are editable in Usermod Settings)
+ * Retorno verdadero in case the config values returned from Usermod Settings were complete, or falso if you'd like WLED to guardar your defaults to disk (so any missing values are editable in Usermod Settings)
*
- * getJsonValue() returns false if the value is missing, or copies the value into the variable provided and returns true if the value is present
- * The configComplete variable is true only if the "exampleUsermod" object and all values are present. If any values are missing, WLED will know to call addToConfig() to save them
+ * getJsonValue() returns falso if the valor is missing, or copies the valor into the variable provided and returns verdadero if the valor is present
+ * The configComplete variable is verdadero only if the "exampleUsermod" object and all values are present. If any values are missing, WLED will know to call addToConfig() to guardar them
*
- * This function is guaranteed to be called on boot, but could also be called every time settings are updated
+ * This función is guaranteed to be called on boot, but could also be called every time settings are updated
*/
bool readFromConfig(JsonObject& root) override
{
@@ -1893,7 +1893,7 @@ class AudioReactive : public Usermod {
configComplete &= getJsonValue(top["sync"]["mode"], audioSyncEnabled);
if (initDone) {
- // add/remove custom/audioreactive palettes
+ // add/eliminar custom/audioreactive palettes
if ((oldAddPalettes && !addPalettes) || (oldAddPalettes && !enabled)) removeAudioPalettes();
if ((addPalettes && !oldAddPalettes && enabled) || (addPalettes && !oldEnabled && enabled)) createAudioPalettes();
} // else setup() will create palettes
@@ -1960,19 +1960,19 @@ class AudioReactive : public Usermod {
/*
- * handleOverlayDraw() is called just before every show() (LED strip update frame) after effects have set the colors.
- * Use this to blank out some LEDs or set them to a different color regardless of the set effect mode.
- * Commonly used for custom clocks (Cronixie, 7 segment)
+ * handleOverlayDraw() is called just before every show() (LED tira actualizar frame) after effects have set the colors.
+ * Use this to blank out some LEDs or set them to a different color regardless of the set efecto mode.
+ * Commonly used for custom clocks (Cronixie, 7 segmento)
*/
- //void handleOverlayDraw() override
+ //void handleOverlayDraw() anular
//{
- //strip.setPixelColor(0, RGBW32(0,0,0,0)) // set the first pixel to black
+ //tira.setPixelColor(0, RGBW32(0,0,0,0)) // set the first píxel to black
//}
/*
- * getId() allows you to optionally give your V2 usermod an unique ID (please define it in const.h!).
- * This could be used in the future for the system to determine whether your usermod is installed.
+ * getId() allows you to optionally give your V2 usermod an unique ID (please definir it in constante.h!).
+ * This could be used in the futuro for the sistema to determine whether your usermod is installed.
*/
uint16_t getId() override
{
@@ -2066,7 +2066,7 @@ void AudioReactive::fillAudioPalettes() {
}
}
-// strings to reduce flash memory usage (used more than twice)
+// strings to reduce flash memoria usage (used more than twice)
const char AudioReactive::_name[] PROGMEM = "AudioReactive";
const char AudioReactive::_enabled[] PROGMEM = "enabled";
const char AudioReactive::_config[] PROGMEM = "config";
diff --git a/usermods/audioreactive/audio_source.h b/usermods/audioreactive/audio_source.h
index a14f8def0b..cc51590a8e 100644
--- a/usermods/audioreactive/audio_source.h
+++ b/usermods/audioreactive/audio_source.h
@@ -9,23 +9,23 @@
#include
#include
#endif
-// type of i2s_config_t.SampleRate was changed from "int" to "unsigned" in IDF 4.4.x
+// tipo of i2s_config_t.SampleRate was changed from "int" to "unsigned" in IDF 4.4.x
#define SRate_t uint32_t
#else
#define SRate_t int
#endif
-//#include
-//#include
-//#include
-//#include
+//#incluir
+//#incluir
+//#incluir
+//#incluir
-// see https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/chip-series-comparison.html#related-documents
-// and https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-reference/peripherals/i2s.html#overview-of-all-modes
+// see https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/chip-series-comparison.HTML#related-documents
+// and https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/API-reference/peripherals/i2s.HTML#overview-of-all-modes
#if defined(CONFIG_IDF_TARGET_ESP32C2) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C5) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32H2) || defined(ESP8266) || defined(ESP8265)
// there are two things in these MCUs that could lead to problems with audio processing:
- // * no floating point hardware (FPU) support - FFT uses float calculations. If done in software, a strong slow-down can be expected (between 8x and 20x)
- // * single core, so FFT task might slow down other things like LED updates
+ // * no floating point hardware (FPU) support - FFT uses flotante calculations. If done in software, a strong slow-down can be expected (between 8x and 20x)
+ // * single core, so FFT tarea might slow down other things like LED updates
#if !defined(SOC_I2S_NUM) || (SOC_I2S_NUM < 1)
#error This audio reactive usermod does not support ESP32-C2 or ESP32-C3.
#else
@@ -33,21 +33,21 @@
#endif
#endif
-/* ToDo: remove. ES7243 is controlled via compiler defines
+/* ToDo: eliminar. ES7243 is controlled via compiler defines
Until this configuration is moved to the webinterface
*/
// if you have problems to get your microphone work on the left channel, uncomment the following line
-//#define I2S_USE_RIGHT_CHANNEL // (experimental) define this to use right channel (digital mics only)
+//#definir I2S_USE_RIGHT_CHANNEL // (experimental) definir this to use right channel (digital mics only)
-// Uncomment the line below to utilize ADC1 _exclusively_ for I2S sound input.
-// benefit: analog mic inputs will be sampled contiously -> better response times and less "glitches"
-// WARNING: this option WILL lock-up your device in case that any other analogRead() operation is performed;
-// for example if you want to read "analog buttons"
-//#define I2S_GRAB_ADC1_COMPLETELY // (experimental) continuously sample analog ADC microphone. WARNING will cause analogRead() lock-up
+// Uncomment the line below to utilize ADC1 _exclusively_ for I2S sound entrada.
+// benefit: analog mic inputs will be sampled contiously -> better respuesta times and less "glitches"
+// ADVERTENCIA: this option WILL bloqueo-up your dispositivo in case that any other analogRead() operation is performed;
+// for example if you want to leer "analog buttons"
+//#definir I2S_GRAB_ADC1_COMPLETELY // (experimental) continuously sample analog ADC microphone. ADVERTENCIA will cause analogRead() bloqueo-up
-// data type requested from the I2S driver - currently we always use 32bit
-//#define I2S_USE_16BIT_SAMPLES // (experimental) define this to request 16bit - more efficient but possibly less compatible
+// datos tipo requested from the I2S controlador - currently we always use 32bit
+//#definir I2S_USE_16BIT_SAMPLES // (experimental) definir this to solicitud 16bit - more efficient but possibly less compatible
#ifdef I2S_USE_16BIT_SAMPLES
#define I2S_SAMPLE_RESOLUTION I2S_BITS_PER_SAMPLE_16BIT
@@ -57,7 +57,7 @@
#undef I2S_SAMPLE_DOWNSCALE_TO_16BIT
#else
#define I2S_SAMPLE_RESOLUTION I2S_BITS_PER_SAMPLE_32BIT
-//#define I2S_SAMPLE_RESOLUTION I2S_BITS_PER_SAMPLE_24BIT
+//#definir I2S_SAMPLE_RESOLUTION I2S_BITS_PER_SAMPLE_24BIT
#define I2S_datatype int32_t
#define I2S_unsigned_datatype uint32_t
#define I2S_data_size I2S_BITS_PER_CHAN_32BIT
@@ -65,25 +65,25 @@
#endif
/* There are several (confusing) options in IDF 4.4.x:
- * I2S_CHANNEL_FMT_RIGHT_LEFT, I2S_CHANNEL_FMT_ALL_RIGHT and I2S_CHANNEL_FMT_ALL_LEFT stands for stereo mode, which means two channels will transport different data.
- * I2S_CHANNEL_FMT_ONLY_RIGHT and I2S_CHANNEL_FMT_ONLY_LEFT they are mono mode, both channels will only transport same data.
+ * I2S_CHANNEL_FMT_RIGHT_LEFT, I2S_CHANNEL_FMT_ALL_RIGHT and I2S_CHANNEL_FMT_ALL_LEFT stands for stereo mode, which means two channels will transport different datos.
+ * I2S_CHANNEL_FMT_ONLY_RIGHT and I2S_CHANNEL_FMT_ONLY_LEFT they are mono mode, both channels will only transport same datos.
* I2S_CHANNEL_FMT_MULTIPLE means TDM channels, up to 16 channel will available, and they are stereo as default.
- * if you want to receive two channels, one is the actual data from microphone and another channel is suppose to receive 0, it's different data in two channels, you need to choose I2S_CHANNEL_FMT_RIGHT_LEFT in this case.
+ * if you want to recibir two channels, one is the actual datos from microphone and another channel is suppose to recibir 0, it's different datos in two channels, you need to choose I2S_CHANNEL_FMT_RIGHT_LEFT in this case.
*/
#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 0)) && (ESP_IDF_VERSION <= ESP_IDF_VERSION_VAL(4, 4, 6))
// espressif bug: only_left has no sound, left and right are swapped
-// https://github.com/espressif/esp-idf/issues/9635 I2S mic not working since 4.4 (IDFGH-8138)
+// https://github.com/espressif/esp-idf/issues/9635 I2S mic not funcionamiento since 4.4 (IDFGH-8138)
// https://github.com/espressif/esp-idf/issues/8538 I2S channel selection issue? (IDFGH-6918)
-// https://github.com/espressif/esp-idf/issues/6625 I2S: left/right channels are swapped for read (IDFGH-4826)
+// https://github.com/espressif/esp-idf/issues/6625 I2S: left/right channels are swapped for leer (IDFGH-4826)
#ifdef I2S_USE_RIGHT_CHANNEL
#define I2S_MIC_CHANNEL I2S_CHANNEL_FMT_ONLY_LEFT
#define I2S_MIC_CHANNEL_TEXT "right channel only (work-around swapped channel bug in IDF 4.4)."
#define I2S_PDM_MIC_CHANNEL I2S_CHANNEL_FMT_ONLY_RIGHT
#define I2S_PDM_MIC_CHANNEL_TEXT "right channel only"
#else
-//#define I2S_MIC_CHANNEL I2S_CHANNEL_FMT_ALL_LEFT
-//#define I2S_MIC_CHANNEL I2S_CHANNEL_FMT_RIGHT_LEFT
+//#definir I2S_MIC_CHANNEL I2S_CHANNEL_FMT_ALL_LEFT
+//#definir I2S_MIC_CHANNEL I2S_CHANNEL_FMT_RIGHT_LEFT
#define I2S_MIC_CHANNEL I2S_CHANNEL_FMT_ONLY_RIGHT
#define I2S_MIC_CHANNEL_TEXT "left channel only (work-around swapped channel bug in IDF 4.4)."
#define I2S_PDM_MIC_CHANNEL I2S_CHANNEL_FMT_ONLY_LEFT
@@ -105,49 +105,49 @@
#endif
-/* Interface class
- AudioSource serves as base class for all microphone types
- This enables accessing all microphones with one single interface
- which simplifies the caller code
+/* Interfaz clase
+ AudioSource serves as base clase for all microphone types
+ This enables accessing all microphones with one single interfaz
+ which simplifies the caller código
*/
class AudioSource {
public:
/* All public methods are virtual, so they can be overridden
Everything but the destructor is also removed, to make sure each mic
- Implementation provides its version of this function
+ Implementación provides its versión of this función
*/
virtual ~AudioSource() {};
- /* Initialize
- This function needs to take care of anything that needs to be done
+ /* Inicializar
+ This función needs to take care of anything that needs to be done
before samples can be obtained from the microphone.
*/
virtual void initialize(int8_t = I2S_PIN_NO_CHANGE, int8_t = I2S_PIN_NO_CHANGE, int8_t = I2S_PIN_NO_CHANGE, int8_t = I2S_PIN_NO_CHANGE) = 0;
/* Deinitialize
- Release all resources and deactivate any functionality that is used
+ Lanzamiento all resources and deactivate any functionality that is used
by this microphone
*/
virtual void deinitialize() = 0;
/* getSamples
- Read num_samples from the microphone, and store them in the provided
- buffer
+ Leer num_samples from the microphone, and store them in the provided
+ búfer
*/
virtual void getSamples(float *buffer, uint16_t num_samples) = 0;
- /* check if the audio source driver was initialized successfully */
+ /* verificar if the audio source controlador was initialized successfully */
virtual bool isInitialized(void) {return(_initialized);}
- /* identify Audiosource type - I2S-ADC or I2S-digital */
+ /* identify Audiosource tipo - I2S-ADC or I2S-digital */
typedef enum{Type_unknown=0, Type_I2SAdc=1, Type_I2SDigital=2} AudioSourceType;
virtual AudioSourceType getType(void) {return(Type_I2SDigital);} // default is "I2S digital source" - ADC type overrides this method
protected:
- /* Post-process audio sample - currently on needed for I2SAdcSource*/
+ /* Post-proceso audio sample - currently on needed for I2SAdcSource*/
virtual I2S_datatype postProcessSample(I2S_datatype sample_in) {return(sample_in);} // default method can be overriden by instances (ADC) that need sample postprocessing
- // Private constructor, to make sure it is not callable except from derived classes
+ // Privado constructor, to make sure it is not callable except from derived classes
AudioSource(SRate_t sampleRate, int blockSize, float sampleScale) :
_sampleRate(sampleRate),
_blockSize(blockSize),
@@ -162,7 +162,7 @@ class AudioSource {
};
/* Basic I2S microphone source
- All functions are marked virtual, so derived classes can replace them
+ All functions are marked virtual, so derived classes can reemplazar them
*/
class I2SSource : public AudioSource {
public:
@@ -215,13 +215,13 @@ class I2SSource : public AudioSource {
#endif
#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3)
// This is an I2S PDM microphone, these microphones only use a clock and
- // data line, to make it simpler to debug, use the WS pin as CLK and SD pin as DATA
- // example from espressif: https://github.com/espressif/esp-idf/blob/release/v4.4/examples/peripherals/i2s/i2s_audio_recorder_sdcard/main/i2s_recorder_main.c
+ // datos line, to make it simpler to depuración, use the WS pin as CLK and SD pin as DATOS
+ // example from espressif: https://github.com/espressif/esp-idf/blob/lanzamiento/v4.4/examples/peripherals/i2s/i2s_audio_recorder_sdcard/principal/i2s_recorder_main.c
// note to self: PDM has known bugs on S3, and does not work on C3
// * S3: PDM sample rate only at 50% of expected rate: https://github.com/espressif/esp-idf/issues/9893
// * S3: I2S PDM has very low amplitude: https://github.com/espressif/esp-idf/issues/8660
- // * C3: does not support PDM to PCM input. SoC would allow PDM RX, but there is no hardware to directly convert to PCM so it will not work. https://github.com/espressif/esp-idf/issues/8796
+ // * C3: does not support PDM to PCM entrada. SoC would allow PDM RX, but there is no hardware to directly convertir to PCM so it will not work. https://github.com/espressif/esp-idf/issues/8796
_config.mode = i2s_mode_t(I2S_MODE_MASTER | I2S_MODE_RX | I2S_MODE_PDM); // Change mode to pdm if clock pin not provided. PDM is not supported on ESP32-S2. PDM RX not supported on ESP32-C3
_config.channel_format =I2S_PDM_MIC_CHANNEL; // seems that PDM mono mode always uses left channel.
@@ -310,15 +310,15 @@ class I2SSource : public AudioSource {
if (_pinConfig.ws_io_num != I2S_PIN_NO_CHANGE) PinManager::deallocatePin(_pinConfig.ws_io_num, PinOwner::UM_Audioreactive);
if (_pinConfig.data_in_num != I2S_PIN_NO_CHANGE) PinManager::deallocatePin(_pinConfig.data_in_num, PinOwner::UM_Audioreactive);
if (_pinConfig.bck_io_num != I2S_PIN_NO_CHANGE) PinManager::deallocatePin(_pinConfig.bck_io_num, PinOwner::UM_Audioreactive);
- // Release the master clock pin
+ // Lanzamiento the master clock pin
if (_mclkPin != I2S_PIN_NO_CHANGE) PinManager::deallocatePin(_mclkPin, PinOwner::UM_Audioreactive);
}
virtual void getSamples(float *buffer, uint16_t num_samples) {
if (_initialized) {
esp_err_t err;
- size_t bytes_read = 0; /* Counter variable to check if we actually got enough data */
- I2S_datatype newSamples[num_samples]; /* Intermediary sample storage */
+ size_t bytes_read = 0; /* Contador variable to verificar if we actually got enough datos */
+ I2S_datatype newSamples[num_samples]; /* Intermediary sample almacenamiento */
err = i2s_read(I2S_NUM_0, (void *)newSamples, sizeof(newSamples), &bytes_read, portMAX_DELAY);
if (err != ESP_OK) {
@@ -326,13 +326,13 @@ class I2SSource : public AudioSource {
return;
}
- // For correct operation, we need to read exactly sizeof(samples) bytes from i2s
+ // For correct operation, we need to leer exactly sizeof(samples) bytes from i2s
if (bytes_read != sizeof(newSamples)) {
DEBUGSR_PRINTF("Failed to get enough samples: wanted: %d read: %d\n", sizeof(newSamples), bytes_read);
return;
}
- // Store samples in sample buffer and update DC offset
+ // Store samples in sample búfer and actualizar DC desplazamiento
for (int i = 0; i < num_samples; i++) {
newSamples[i] = postProcessSample(newSamples[i]); // perform postprocessing (needed for ADC samples)
@@ -355,7 +355,7 @@ class I2SSource : public AudioSource {
// MCLK routing by writing registers is not needed any more with IDF > 4.4.0
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(4, 4, 0)
// this way of MCLK routing only works on "classic" ESP32
- /* Enable the mclk routing depending on the selected mclk pin (ESP32: only 0,1,3)
+ /* Habilitar the mclk routing depending on the selected mclk pin (ESP32: only 0,1,3)
Only I2S_NUM_0 is supported
*/
if (mclkPin == GPIO_NUM_0) {
@@ -379,7 +379,7 @@ class I2SSource : public AudioSource {
/* ES7243 Microphone
This is an I2S microphone that requires initialization over
- I2C before I2S data can be received
+ I2C before I2S datos can be received
*/
class ES7243 : public I2SSource {
private:
@@ -419,7 +419,7 @@ class ES7243 : public I2SSource {
return;
}
- // First route mclk, then configure ADC over I2C, then configure I2S
+ // First route mclk, then configurar ADC over I2C, then configurar I2S
_es7243InitAdc();
I2SSource::initialize(i2swsPin, i2ssdPin, i2sckPin, mclkPin);
}
@@ -429,9 +429,9 @@ class ES7243 : public I2SSource {
}
};
-/* ES8388 Sound Module
+/* ES8388 Sound Módulo
This is an I2S sound processing unit that requires initialization over
- I2C before I2S data can be received.
+ I2C before I2S datos can be received.
*/
class ES8388Source : public I2SSource {
private:
@@ -452,8 +452,8 @@ class ES8388Source : public I2SSource {
}
void _es8388InitAdc() {
- // https://dl.radxa.com/rock2/docs/hw/ds/ES8388%20user%20Guide.pdf Section 10.1
- // http://www.everest-semi.com/pdf/ES8388%20DS.pdf Better spec sheet, more clear.
+ // https://dl.radxa.com/rock2/docs/hw/ds/ES8388%20user%20Guide.pdf Sección 10.1
+ // HTTP://www.everest-semi.com/pdf/ES8388%20DS.pdf Better spec sheet, more limpiar.
// https://docs.google.com/spreadsheets/d/1CN3MvhkcPVESuxKyx1xRYqfUit5hOdsG45St9BCUm-g/edit#gid=0 generally
// Sets ADC to around what AudioReactive expects, and loops line-in to line-out/headphone for monitoring.
// Registries are decimal, settings are binary as that's how everything is listed in the docs
@@ -469,7 +469,7 @@ class ES8388Source : public I2SSource {
_es8388I2cWrite( 4,0b11111100); // Power down DAC, Turn on LOUT1 and ROUT1 and LOUT2 and ROUT2 power
_es8388I2cWrite( 2,0b01000000); // Power up DEM and STM and undocumented bit for "turn on line-out amp"
- // #define use_es8388_mic
+ // #definir use_es8388_mic
#ifdef use_es8388_mic
// The mics *and* line-in are BOTH connected to LIN2/RIN2 on the AudioKit
@@ -479,11 +479,11 @@ class ES8388Source : public I2SSource {
// the mics on the AudioKit WILL pick up sound even in line-in mode.
// TL;DR: Don't use the AudioKit for anything, use the LyraT.
//
- // The LyraT does a reasonable job with mic input as configured below.
+ // The LyraT does a reasonable trabajo with mic entrada as configured below.
// Pick one of these. If you have to use the mics, use a LyraT over an AudioKit if you can:
_es8388I2cWrite(10,0b00000000); // Use Lin1/Rin1 for ADC input (mic on LyraT)
- //_es8388I2cWrite(10,0b01010000); // Use Lin2/Rin2 for ADC input (mic *and* line-in on AudioKit)
+ //_es8388I2cWrite(10,0b01010000); // Use Lin2/Rin2 for ADC entrada (mic *and* line-in on AudioKit)
_es8388I2cWrite( 9,0b10001000); // Select Analog Input PGA Gain for ADC to +24dB (L+R)
_es8388I2cWrite(16,0b00000000); // Set ADC digital volume attenuation to 0dB (left)
@@ -497,7 +497,7 @@ class ES8388Source : public I2SSource {
_es8388I2cWrite(48,0b00100001); // LOUT2VOL - 0b00100001 = +4.5dB
_es8388I2cWrite(49,0b00100001); // ROUT2VOL - 0b00100001 = +4.5dB
- // Music ALC - the mics like Auto Level Control
+ // Music ALC - the mics like Auto Nivel Control
// You can also use this for line-in, but it's not really needed.
//
_es8388I2cWrite(18,0b11111000); // ALC: stereo, max gain +35.5dB, min gain -12dB
@@ -535,7 +535,7 @@ class ES8388Source : public I2SSource {
return;
}
- // First route mclk, then configure ADC over I2C, then configure I2S
+ // First route mclk, then configurar ADC over I2C, then configurar I2S
_es8388InitAdc();
I2SSource::initialize(i2swsPin, i2ssdPin, i2sckPin, mclkPin);
}
@@ -556,7 +556,7 @@ class ES8388Source : public I2SSource {
// ADC over I2S is only availeable in "classic" ESP32
/* ADC over I2S Microphone
- This microphone is an ADC pin sampled via the I2S interval
+ This microphone is an ADC pin sampled via the I2S intervalo
This allows to use the I2S API to obtain ADC samples with high sample rates
without the need of manual timing of the samples
*/
@@ -583,7 +583,7 @@ class I2SAdcSource : public I2SSource {
};
}
- /* identify Audiosource type - I2S-ADC*/
+ /* identify Audiosource tipo - I2S-ADC*/
AudioSourceType getType(void) {return(Type_I2SAdc);}
void initialize(int8_t audioPin, int8_t = I2S_PIN_NO_CHANGE, int8_t = I2S_PIN_NO_CHANGE, int8_t = I2S_PIN_NO_CHANGE) {
@@ -605,7 +605,7 @@ class I2SAdcSource : public I2SSource {
_myADCchannel = channel;
}
- // Install Driver
+ // Install Controlador
esp_err_t err = i2s_driver_install(I2S_NUM_0, &_config, 0, nullptr);
if (err != ESP_OK) {
DEBUGSR_PRINTF("Failed to install i2s driver: %d\n", err);
@@ -614,7 +614,7 @@ class I2SAdcSource : public I2SSource {
adc1_config_width(ADC_WIDTH_BIT_12); // ensure that ADC runs with 12bit resolution
- // Enable I2S mode of ADC
+ // Habilitar I2S mode of ADC
err = i2s_set_adc_mode(ADC_UNIT_1, adc1_channel_t(channel));
if (err != ESP_OK) {
DEBUGSR_PRINTF("Failed to set i2s adc mode: %d\n", err);
@@ -630,14 +630,14 @@ class I2SAdcSource : public I2SSource {
err = i2s_adc_enable(I2S_NUM_0);
if (err != ESP_OK) {
DEBUGSR_PRINTF("Failed to enable i2s adc: %d\n", err);
- //return;
+ //retorno;
}
#else
- // bugfix: do not disable ADC initially - its already disabled after driver install.
+ // bugfix: do not deshabilitar ADC initially - its already disabled after controlador install.
//err = i2s_adc_disable(I2S_NUM_0);
// //err = i2s_stop(I2S_NUM_0);
//if (err != ESP_OK) {
- // DEBUGSR_PRINTF("Failed to initially disable i2s adc: %d\n", err);
+ // DEBUGSR_PRINTF("Failed to initially deshabilitar i2s adc: %d\n", err);
//}
#endif
@@ -660,7 +660,7 @@ class I2SAdcSource : public I2SSource {
I2S_datatype lastGoodSample = lastADCsample * 4; // prepare "last good sample" accordingly (10bit-> 12bit)
#endif
- // decode ADC sample data fields
+ // decode ADC sample datos fields
uint16_t the_channel = (rawData >> 12) & 0x000F; // upper 4 bit = ADC channel
uint16_t the_sample = rawData & 0x0FFF; // lower 12bit -> ADC sample (unsigned)
I2S_datatype finalSample = (int(the_sample) - 2048); // convert unsigned sample to signed (centered at 0);
@@ -670,17 +670,17 @@ class I2SAdcSource : public I2SSource {
finalSample = lastGoodSample; // replace with last good ADC sample
broken_samples_counter ++;
if (broken_samples_counter > 256) _myADCchannel = 0x0F; // too many bad samples in a row -> disable sample corrections
- //Serial.print("\n!ADC rogue sample 0x"); Serial.print(rawData, HEX); Serial.print("\tchannel:");Serial.println(the_channel);
+ //Serie.imprimir("\n!ADC rogue sample 0x"); Serie.imprimir(rawData, HEX); Serie.imprimir("\tchannel:");Serie.println(the_channel);
} else broken_samples_counter = 0; // good sample - reset counter
- // back to original resolution
+ // back to original resolución
#ifndef I2S_USE_16BIT_SAMPLES
finalSample = finalSample << 16; // scale up from 16bit -> 32bit;
#endif
finalSample = finalSample / 4; // mimic old analog driver behaviour (12bit -> 10bit)
sample_out = (3 * finalSample + lastADCsample) / 4; // apply low-pass filter (2-tap FIR)
- //sample_out = (finalSample + lastADCsample) / 2; // apply stronger low-pass filter (2-tap FIR)
+ //sample_out = (finalSample + lastADCsample) / 2; // apply stronger low-pass filtro (2-tap FIR)
lastADCsample = sample_out; // update ADC last sample
return(sample_out);
@@ -688,12 +688,12 @@ class I2SAdcSource : public I2SSource {
void getSamples(float *buffer, uint16_t num_samples) {
- /* Enable ADC. This has to be enabled and disabled directly before and
- * after sampling, otherwise Wifi dies
+ /* Habilitar ADC. This has to be enabled and disabled directly before and
+ * after sampling, otherwise WiFi dies
*/
if (_initialized) {
#if !defined(I2S_GRAB_ADC1_COMPLETELY)
- // old code - works for me without enable/disable, at least on ESP32.
+ // old código - works for me without habilitar/deshabilitar, at least on ESP32.
//esp_err_t err = i2s_start(I2S_NUM_0);
esp_err_t err = i2s_adc_enable(I2S_NUM_0);
if (err != ESP_OK) {
@@ -705,7 +705,7 @@ class I2SAdcSource : public I2SSource {
I2SSource::getSamples(buffer, num_samples);
#if !defined(I2S_GRAB_ADC1_COMPLETELY)
- // old code - works for me without enable/disable, at least on ESP32.
+ // old código - works for me without habilitar/deshabilitar, at least on ESP32.
err = i2s_adc_disable(I2S_NUM_0); //i2s_adc_disable() may cause crash with IDF 4.4 (https://github.com/espressif/arduino-esp32/issues/6832)
//err = i2s_stop(I2S_NUM_0);
if (err != ESP_OK) {
@@ -750,8 +750,8 @@ class I2SAdcSource : public I2SSource {
special consideration.
*/
-// https://github.com/espressif/esp-idf/issues/7192 SPH0645 i2s microphone issue when migrate from legacy esp-idf version (IDFGH-5453)
-// a user recommended this: Try to set .communication_format to I2S_COMM_FORMAT_STAND_I2S and call i2s_set_clk() after i2s_set_pin().
+// https://github.com/espressif/esp-idf/issues/7192 SPH0645 i2s microphone issue when migrate from legacy esp-idf versión (IDFGH-5453)
+// a usuario recommended this: Intentar to set .communication_format to I2S_COMM_FORMAT_STAND_I2S and call i2s_set_clk() after i2s_set_pin().
class SPH0654 : public I2SSource {
public:
SPH0654(SRate_t sampleRate, int blockSize, float sampleScale = 1.0f) :
diff --git a/usermods/boblight/boblight.cpp b/usermods/boblight/boblight.cpp
index 5980443d37..efbda06b12 100644
--- a/usermods/boblight/boblight.cpp
+++ b/usermods/boblight/boblight.cpp
@@ -1,9 +1,9 @@
#include "wled.h"
/*
- * Usermod that implements BobLight "ambilight" protocol
+ * Usermod that implements BobLight "ambilight" protocolo
*
- * See the accompanying README.md file for more info.
+ * See the accompanying README.md archivo for more información.
*/
#ifndef BOB_PORT
@@ -41,20 +41,20 @@ class BobLightUsermod : public Usermod {
# makeboblight.sh created by Adam Boeglin
#
# boblight is free software: you can redistribute it and/or modify it
- # under the terms of the GNU General Public License as published by the
- # Free Software Foundation, either version 3 of the License, or
- # (at your option) any later version.
+ # under the terms of the GNU General Público License as published by the
+ # Free Software Foundation, either versión 3 of the License, or
+ # (at your option) any later versión.
#
# boblight is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- # See the GNU General Public License for more details.
+ # See the GNU General Público License for more details.
#
- # You should have received a copy of the GNU General Public License along
- # with this program. If not, see .
+ # You should have received a copy of the GNU General Público License along
+ # with this program. If not, see .
*/
- // fills the lights[] array with position & depth of scan for each LED
+ // fills the lights[] matriz with posición & depth of scan for each LED
void fillBobLights(int bottom, int left, int top, int right, float pct_scan) {
int lightcount = 0;
@@ -66,7 +66,7 @@ class BobLightUsermod : public Usermod {
return;
}
- // start left part of bottom strip (clockwise direction, 1st half)
+ // iniciar left part of bottom tira (clockwise direction, 1st half)
if (bottom > 0) {
bcount = 1;
float brange = 100.0/bottom;
@@ -147,7 +147,7 @@ class BobLightUsermod : public Usermod {
}
}
- // right side of bottom strip (2nd half)
+ // right side of bottom tira (2nd half)
if (bottom > 0) {
float brange = 100.0/bottom;
float bcurrent = 100;
@@ -201,7 +201,7 @@ class BobLightUsermod : public Usermod {
}
void connected() override {
- // we can only start server when WiFi is connected
+ // we can only iniciar servidor when WiFi is connected
if (!bob) bob = new WiFiServer(bobPort, 1);
bob->begin();
bob->setNoDelay(true);
@@ -219,19 +219,19 @@ class BobLightUsermod : public Usermod {
#ifndef WLED_DISABLE_MQTT
/**
- * handling of MQTT message
- * topic only contains stripped topic (part after /wled/MAC)
+ * handling of MQTT mensaje
+ * topic only contains stripped topic (part after /WLED/MAC)
* topic should look like: /swipe with amessage of [up|down]
*/
bool onMqttMessage(char* topic, char* payload) override {
//if (strlen(topic) == 6 && strncmp_P(topic, PSTR("/subtopic"), 6) == 0) {
- // String action = payload;
- // if (action == "on") {
- // enable(true);
- // return true;
- // } else if (action == "off") {
- // enable(false);
- // return true;
+ // Cadena acción = carga útil;
+ // if (acción == "on") {
+ // habilitar(verdadero);
+ // retorno verdadero;
+ // } else if (acción == "off") {
+ // habilitar(falso);
+ // retorno verdadero;
// }
//}
return false;
@@ -245,7 +245,7 @@ class BobLightUsermod : public Usermod {
//if (mqttDeviceTopic[0] != 0) {
// strcpy(subuf, mqttDeviceTopic);
// strcat_P(subuf, PSTR("/subtopic"));
- // mqtt->subscribe(subuf, 0);
+ // MQTT->subscribe(subuf, 0);
//}
}
#endif
@@ -268,16 +268,16 @@ class BobLightUsermod : public Usermod {
}
/*
- * addToJsonState() can be used to add custom entries to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * addToJsonState() can be used to add custom entries to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
void addToJsonState(JsonObject& root) override
{
}
/*
- * readFromJsonState() can be used to receive data clients send to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * readFromJsonState() can be used to recibir datos clients enviar to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
void readFromJsonState(JsonObject& root) override {
if (!initDone) return; // prevent crash on boot applyPreset()
@@ -304,8 +304,8 @@ class BobLightUsermod : public Usermod {
void appendConfigData() override {
//oappend(F("dd=addDropdown('usermod','selectfield');"));
- //oappend(F("addOption(dd,'1st value',0);"));
- //oappend(F("addOption(dd,'2nd value',1);"));
+ //oappend(F("addOption(dd,'1st valor',0);"));
+ //oappend(F("addOption(dd,'2nd valor',1);"));
oappend(F("addInfo('BobLight:top',1,'LEDs');")); // 0 is field type, 1 is actual field
oappend(F("addInfo('BobLight:bottom',1,'LEDs');")); // 0 is field type, 1 is actual field
oappend(F("addInfo('BobLight:left',1,'LEDs');")); // 0 is field type, 1 is actual field
@@ -349,28 +349,28 @@ class BobLightUsermod : public Usermod {
}
/*
- * handleOverlayDraw() is called just before every show() (LED strip update frame) after effects have set the colors.
- * Use this to blank out some LEDs or set them to a different color regardless of the set effect mode.
- * Commonly used for custom clocks (Cronixie, 7 segment)
+ * handleOverlayDraw() is called just before every show() (LED tira actualizar frame) after effects have set the colors.
+ * Use this to blank out some LEDs or set them to a different color regardless of the set efecto mode.
+ * Commonly used for custom clocks (Cronixie, 7 segmento)
*/
void handleOverlayDraw() override {
- //strip.setPixelColor(0, RGBW32(0,0,0,0)) // set the first pixel to black
+ //tira.setPixelColor(0, RGBW32(0,0,0,0)) // set the first píxel to black
}
uint16_t getId() override { return USERMOD_ID_BOBLIGHT; }
};
-// strings to reduce flash memory usage (used more than twice)
+// strings to reduce flash memoria usage (used more than twice)
const char BobLightUsermod::_name[] PROGMEM = "BobLight";
const char BobLightUsermod::_enabled[] PROGMEM = "enabled";
-// main boblight handling (definition here prevents inlining)
+// principal boblight handling (definition here prevents inlining)
void BobLightUsermod::pollBob() {
- //check if there are any new clients
+ //verificar if there are any new clients
if (bob && bob->hasClient()) {
- //find free/disconnected spot
+ //encontrar free/disconnected spot
if (!bobClient || !bobClient.connected()) {
if (bobClient) bobClient.stop();
bobClient = bob->available();
@@ -383,14 +383,14 @@ void BobLightUsermod::pollBob() {
exitRealtime();
}
- //check clients for data
+ //verificar clients for datos
if (bobClient && bobClient.connected()) {
realtimeLock(realtimeTimeoutMs); // lock strip as we have a client connected
- //get data from the client
+ //get datos from the cliente
while (bobClient.available()) {
String input = bobClient.readStringUntil('\n');
- // DEBUG_PRINT(F("Client: ")); DEBUG_PRINTLN(input); // may be to stressful on Serial
+ // DEBUG_PRINT(F("Cliente: ")); DEBUG_PRINTLN(entrada); // may be to stressful on Serie
if (input.startsWith(F("hello"))) {
DEBUG_PRINTLN(F("hello"));
bobClient.print(F("hello\n"));
@@ -440,13 +440,13 @@ void BobLightUsermod::pollBob() {
tmp = input.substring(0,input.indexOf(' '));
uint8_t blue = (uint8_t)(255.0f*tmp.toFloat());
- //strip.setPixelColor(light_id, RGBW32(red, green, blue, 0));
+ //tira.setPixelColor(light_id, RGBW32(red, green, blue, 0));
setRealtimePixel(light_id, red, green, blue, 0);
} // currently no support for interpolation or speed, we just ignore this
} else if (input.startsWith("sync")) {
BobSync();
} else {
- // Client sent gibberish
+ // Cliente sent gibberish
DEBUG_PRINTLN(F("Client sent gibberish."));
bobClient.stop();
bobClient = bob->available();
diff --git a/usermods/buzzer/buzzer.cpp b/usermods/buzzer/buzzer.cpp
index 9d62fc20c8..17006ae170 100644
--- a/usermods/buzzer/buzzer.cpp
+++ b/usermods/buzzer/buzzer.cpp
@@ -14,7 +14,7 @@
/*
* Usermods allow you to add own functionality to WLED more easily
- * See: https://github.com/wled-dev/WLED/wiki/Add-own-functionality
+ * See: https://github.com/WLED-dev/WLED/wiki/Add-own-functionality
*
*/
@@ -25,11 +25,11 @@ class BuzzerUsermod : public Usermod {
std::deque> sequence_ {};
public:
/*
- * setup() is called once at boot. WiFi is not yet connected at this point.
- * You can use it to initialize variables, sensors or similar.
+ * `configuración()` se llama una vez al arrancar. En este punto WiFi aún no está conectado.
+ * Úsalo para inicializar variables, sensores o similares.
*/
void setup() {
- // Setup the pin, and default to LOW
+ // Configuración the pin, and default to LOW
pinMode(USERMOD_BUZZER_PIN, OUTPUT);
digitalWrite(USERMOD_BUZZER_PIN, LOW);
@@ -40,11 +40,11 @@ class BuzzerUsermod : public Usermod {
/*
- * connected() is called every time the WiFi is (re)connected
- * Use it to initialize network interfaces
+ * `connected()` se llama cada vez que el WiFi se (re)conecta.
+ * Úsalo para inicializar interfaces de red.
*/
void connected() {
- // Double beep on WiFi
+ // Doble beep on WiFi
sequence_.push_back({ LOW, 100 });
sequence_.push_back({ HIGH, 50 });
sequence_.push_back({ LOW, 30 });
@@ -53,7 +53,7 @@ class BuzzerUsermod : public Usermod {
}
/*
- * loop() is called continuously. Here you can check for events, read sensors, etc.
+ * `bucle()` se llama de forma continua. Aquí puedes comprobar eventos, leer sensores, etc.
*/
void loop() {
if (sequence_.size() < 1) return; // Wait until there is a sequence
@@ -70,8 +70,8 @@ class BuzzerUsermod : public Usermod {
/*
- * getId() allows you to optionally give your V2 usermod an unique ID (please define it in const.h!).
- * This could be used in the future for the system to determine whether your usermod is installed.
+ * getId() allows you to optionally give your V2 usermod an unique ID (please definir it in constante.h!).
+ * This could be used in the futuro for the sistema to determine whether your usermod is installed.
*/
uint16_t getId()
{
diff --git a/usermods/deep_sleep/deep_sleep.cpp b/usermods/deep_sleep/deep_sleep.cpp
index f6f3604fba..14467cfb5e 100644
--- a/usermods/deep_sleep/deep_sleep.cpp
+++ b/usermods/deep_sleep/deep_sleep.cpp
@@ -36,7 +36,7 @@ class DeepSleepUsermod : public Usermod {
int sleepDelay = DEEPSLEEP_DELAY; // in seconds, 0 = immediate
int delaycounter = 5; // delay deep sleep at bootup until preset settings are applied
uint32_t lastLoopTime = 0;
- // string that are used multiple time (this will save some flash memory)
+ // cadena that are used multiple time (this will guardar some flash memoria)
static const char _name[];
static const char _enabled[];
@@ -65,7 +65,7 @@ class DeepSleepUsermod : public Usermod {
inline void enable(bool enable) { enabled = enable; } // Enable/Disable the usermod
inline bool isEnabled() { return enabled; } //Get usermod enabled/disabled state
- // setup is called at boot (or in this case after every exit of sleep mode)
+ // configuración is called at boot (or in this case after every salida of sleep mode)
void setup() {
//TODO: if the de-init of RTC pins is required to do it could be done here
//rtc_gpio_deinit(wakeupPin);
@@ -153,7 +153,7 @@ void addToConfig(JsonObject& root) override
{
JsonObject top = root.createNestedObject(FPSTR(_name));
top[FPSTR(_enabled)] = enabled;
- //save these vars persistently whenever settings are saved
+ //guardar these vars persistently whenever settings are saved
top["gpio"] = wakeupPin;
top["wakeWhen"] = wakeWhenHigh;
top["pull"] = noPull;
@@ -163,8 +163,8 @@ void addToConfig(JsonObject& root) override
bool readFromConfig(JsonObject& root) override
{
- // default settings values could be set here (or below using the 3-argument getJsonValue()) instead of in the class definition or constructor
- // setting them inside readFromConfig() is slightly more robust, handling the rare but plausible use case of single value being missing after boot (e.g. if the cfg.json was manually edited and a value was removed)
+ // default settings values could be set here (or below usando the 3-argumento getJsonValue()) instead of in the clase definition or constructor
+ // setting them inside readFromConfig() is slightly more robust, handling the rare but plausible use case of single valor being missing after boot (e.g. if the cfg.JSON was manually edited and a valor was removed)
JsonObject top = root[FPSTR(_name)];
bool configComplete = !top.isNull();
@@ -183,9 +183,9 @@ void addToConfig(JsonObject& root) override
}
/*
- * appendConfigData() is called when user enters usermod settings page
+ * appendConfigData() is called when usuario enters usermod settings page
* it may add additional metadata for certain entry fields (adding drop down is possible)
- * be careful not to add too much as oappend() buffer is limited to 3k
+ * be careful not to add too much as oappend() búfer is limited to 3k
*/
void appendConfigData() override
{
@@ -211,8 +211,8 @@ void addToConfig(JsonObject& root) override
}
/*
- * getId() allows you to optionally give your V2 usermod an unique ID (please define it in const.h!).
- * This could be used in the future for the system to determine whether your usermod is installed.
+ * getId() allows you to optionally give your V2 usermod an unique ID (please definir it in constante.h!).
+ * This could be used in the futuro for the sistema to determine whether your usermod is installed.
*/
uint16_t getId() {
return USERMOD_ID_DEEP_SLEEP;
@@ -220,7 +220,7 @@ void addToConfig(JsonObject& root) override
};
-// add more strings here to reduce flash memory usage
+// add more strings here to reduce flash memoria usage
const char DeepSleepUsermod::_name[] PROGMEM = "DeepSleep";
const char DeepSleepUsermod::_enabled[] PROGMEM = "enabled";
diff --git a/usermods/mpu6050_imu/mpu6050_imu.cpp b/usermods/mpu6050_imu/mpu6050_imu.cpp
index 6df5d64e12..7fb2e8bb11 100644
--- a/usermods/mpu6050_imu/mpu6050_imu.cpp
+++ b/usermods/mpu6050_imu/mpu6050_imu.cpp
@@ -1,8 +1,8 @@
#include "wled.h"
-/* This driver reads quaternion data from the MPU6060 and adds it to the JSON
+/* This controlador reads quaternion datos from the MPU6060 and adds it to the JSON
This example is adapted from:
- https://github.com/jrowberg/i2cdevlib/tree/master/Arduino/MPU6050/examples/MPU6050_DMP6_ESPWiFi
+ https://github.com/jrowberg/i2cdevlib/árbol/master/Arduino/MPU6050/examples/MPU6050_DMP6_ESPWiFi
Tested with a d1 mini esp-12f
@@ -13,19 +13,19 @@
VCC VU (5V USB) Not available on all boards so use 3.3V if needed.
GND G Ground
SCL D1 (GPIO05) I2C clock
- SDA D2 (GPIO04) I2C data
+ SDA D2 (GPIO04) I2C datos
XDA not connected
XCL not connected
AD0 not connected
- INT D8 (GPIO15) Interrupt pin
-
- Using usermod:
- 1. Copy the usermod into the sketch folder (same folder as wled00.ino)
- 2. Register the usermod by adding #include "usermod_filename.h" in the top and registerUsermod(new MyUsermodClass()) in the bottom of usermods_list.cpp
- 3. I2Cdev and MPU6050 must be installed as libraries, or else the .cpp/.h file
- for both classes must be in the include path of your project. To install the
- libraries add I2Cdevlib-MPU6050@fbde122cc5 to lib_deps in the platformio.ini file.
- 4. You also need to change lib_compat_mode from strict to soft in platformio.ini (This ignores that I2Cdevlib-MPU6050 doesn't list platform compatibility)
+ INT D8 (GPIO15) Interrupción pin
+
+ Usando usermod:
+ 1. Copy the usermod into the sketch carpeta (same carpeta as wled00.ino)
+ 2. Register the usermod by adding #incluir "usermod_filename.h" in the top and registerUsermod(new MyUsermodClass()) in the bottom of usermods_list.cpp
+ 3. I2Cdev and MPU6050 must be installed as libraries, or else the .cpp/.h archivo
+ for both classes must be in the incluir ruta of your project. To install the
+ libraries add I2Cdevlib-MPU6050@fbde122cc5 to lib_deps in the platformio.ini archivo.
+ 4. You also need to change lib_compat_mode from strict to soft in platformio.ini (This ignores that I2Cdevlib-MPU6050 doesn't lista plataforma compatibility)
5. Wire up the MPU6050 as detailed above.
*/
@@ -35,15 +35,15 @@
#undef DEBUG_PRINTLN
#undef DEBUG_PRINTF
#include "MPU6050_6Axis_MotionApps20.h"
-//#include "MPU6050.h" // not necessary if using MotionApps include file
+//#incluir "MPU6050.h" // not necessary if usando MotionApps incluir archivo
-// Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation
+// Arduino Wire biblioteca is required if I2Cdev I2CDEV_ARDUINO_WIRE implementación
// is used in I2Cdev.h
#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
#include "Wire.h"
#endif
-// Restore debug macros
+// Restore depuración macros
// MPU6050 unfortunately uses the same macro names as WLED :(
#undef DEBUG_PRINT
#undef DEBUG_PRINTLN
@@ -61,7 +61,7 @@
// ================================================================
-// === INTERRUPT DETECTION ROUTINE ===
+// === INTERRUPCIÓN DETECTION RUTINA ===
// ================================================================
volatile bool mpuInterrupt = false; // indicates whether MPU interrupt pin has gone high
@@ -75,9 +75,9 @@ class MPU6050Driver : public Usermod {
private:
MPU6050 mpu;
- // configuration state
+ // configuration estado
// default values are set in readFromConfig
- // By making this a struct, we enable easy backup and comparison in the readFromConfig class
+ // By making this a estructura, we habilitar easy backup and comparison in the readFromConfig clase
struct config_t {
bool enabled;
int8_t interruptPin;
@@ -87,14 +87,14 @@ class MPU6050Driver : public Usermod {
config_t config;
bool configDirty = true; // does the configuration need an update?
- // MPU control/status vars
+ // MPU control/estado vars
bool irqBound = false; // set true if we have bound the IRQ pin
bool dmpReady = false; // set true if DMP init was successful
uint16_t packetSize; // expected DMP packet size (default is 42 bytes)
uint16_t fifoCount; // count of all bytes currently in FIFO
uint8_t fifoBuffer[64]; // FIFO storage buffer
- // TODO: some of these can be removed to save memory, processing time if the measurement isn't needed
+ // TODO: some of these can be removed to guardar memoria, processing time if the measurement isn't needed
Quaternion qat; // [w, x, y, z] quaternion container
float euler[3]; // [psi, theta, phi] Euler angle container
float ypr[3]; // [yaw, pitch, roll] yaw/pitch/roll container
@@ -105,7 +105,7 @@ class MPU6050Driver : public Usermod {
VectorFloat gravity; // [x, y, z] gravity vector
uint32_t sample_count;
- // Usermod output
+ // Usermod salida
um_data_t um_data;
// config element names as progmem strs
@@ -125,7 +125,7 @@ class MPU6050Driver : public Usermod {
//Functions called by WLED
/*
- * setup() is called once at boot. WiFi is not yet connected at this point.
+ * `configuración()` se llama una vez al arrancar. En este punto WiFi aún no está conectado.
*/
void setup() {
dmpReady = false; // Start clean
@@ -160,7 +160,7 @@ class MPU6050Driver : public Usermod {
if (!config.enabled) return;
// TODO: notice if these have changed ??
if (i2c_scl<0 || i2c_sda<0) { DEBUG_PRINTLN(F("MPU6050: I2C is no good.")); return; }
- // Check the interrupt pin
+ // Verificar the interrupción pin
if (config.interruptPin >= 0) {
irqBound = PinManager::allocatePin(config.interruptPin, false, PinOwner::UM_IMU);
if (!irqBound) { DEBUG_PRINTLN(F("MPU6050: IRQ pin already in use.")); return; }
@@ -173,15 +173,15 @@ class MPU6050Driver : public Usermod {
Fastwire::setup(400, true);
#endif
- // initialize device
+ // inicializar dispositivo
DEBUG_PRINTLN(F("Initializing I2C devices..."));
mpu.initialize();
- // verify connection
+ // verify conexión
DEBUG_PRINTLN(F("Testing device connections..."));
DEBUG_PRINTLN(mpu.testConnection() ? F("MPU6050 connection successful") : F("MPU6050 connection failed"));
- // load and configure the DMP
+ // carga and configurar the DMP
DEBUG_PRINTLN(F("Initializing DMP..."));
auto devStatus = mpu.dmpInitialize();
@@ -204,22 +204,22 @@ class MPU6050Driver : public Usermod {
mpuInterrupt = true;
if (irqBound) {
- // enable Arduino interrupt detection
+ // habilitar Arduino interrupción detection
DEBUG_PRINTLN(F("Enabling interrupt detection (Arduino external interrupt 0)..."));
attachInterrupt(digitalPinToInterrupt(config.interruptPin), dmpDataReady, RISING);
}
- // get expected DMP packet size for later comparison
+ // get expected DMP packet tamaño for later comparison
packetSize = mpu.dmpGetFIFOPacketSize();
- // set our DMP Ready flag so the main loop() function knows it's okay to use it
+ // set our DMP Ready bandera so the principal bucle() función knows it's okay to use it
DEBUG_PRINTLN(F("DMP ready!"));
dmpReady = true;
} else {
// ERROR!
- // 1 = initial memory load failed
+ // 1 = initial memoria carga failed
// 2 = DMP configuration updates failed
- // (if it's going to break, usually the code will be 1)
+ // (if it's going to ruptura, usually the código will be 1)
DEBUG_PRINT(F("DMP Initialization failed (code "));
DEBUG_PRINT(devStatus);
DEBUG_PRINTLN(")");
@@ -231,7 +231,7 @@ class MPU6050Driver : public Usermod {
/*
* connected() is called every time the WiFi is (re)connected
- * Use it to initialize network interfaces
+ * Use it to inicializar red interfaces
*/
void connected() {
//DEBUG_PRINTLN(F("Connected to WiFi!"));
@@ -239,7 +239,7 @@ class MPU6050Driver : public Usermod {
/*
- * loop() is called continuously. Here you can check for events, read sensors, etc.
+ * bucle() is called continuously. Here you can verificar for events, leer sensors, etc.
*/
void loop() {
if (configDirty) setup();
@@ -247,38 +247,38 @@ class MPU6050Driver : public Usermod {
// if programming failed, don't try to do anything
if (!config.enabled || !dmpReady || strip.isUpdating()) return;
- // wait for MPU interrupt or extra packet(s) available
- // mpuInterrupt is fixed on if interrupt pin is disabled
+ // wait for MPU interrupción or extra packet(s) available
+ // mpuInterrupt is fixed on if interrupción pin is disabled
if (!mpuInterrupt && fifoCount < packetSize) return;
- // reset interrupt flag and get INT_STATUS byte
+ // restablecer interrupción bandera and get INT_STATUS byte
auto mpuIntStatus = mpu.getIntStatus();
- // Update current FIFO count
+ // Actualizar current FIFO conteo
fifoCount = mpu.getFIFOCount();
- // check for overflow (this should never happen unless our code is too inefficient)
+ // verificar for desbordamiento (this should never happen unless our código is too inefficient)
if ((mpuIntStatus & 0x10) || fifoCount == 1024) {
- // reset so we can continue cleanly
+ // restablecer so we can continuar cleanly
mpu.resetFIFO();
DEBUG_PRINTLN(F("MPU6050: FIFO overflow!"));
- // otherwise, check for data ready
+ // otherwise, verificar for datos ready
} else if (fifoCount >= packetSize) {
- // clear local interrupt pending status, if not polling
+ // limpiar local interrupción pending estado, if not polling
mpuInterrupt = !irqBound;
// DEBUG_PRINT(F("MPU6050: Processing packet: "));
// DEBUG_PRINT(fifoCount);
// DEBUG_PRINTLN(F(" bytes in FIFO"));
- // read a packet from FIFO
+ // leer a packet from FIFO
mpu.getFIFOBytes(fifoBuffer, packetSize);
- // track FIFO count here in case there is > 1 packet available
- // (this lets us immediately read more without waiting for an interrupt)
+ // track FIFO conteo here in case there is > 1 packet available
+ // (this lets us immediately leer more without waiting for an interrupción)
fifoCount -= packetSize;
- //NOTE: some of these can be removed to save memory, processing time
+ //NOTE: some of these can be removed to guardar memoria, processing time
// if the measurement isn't needed
mpu.dmpGetQuaternion(&qat, fifoBuffer);
mpu.dmpGetEuler(euler, &qat);
@@ -297,13 +297,13 @@ class MPU6050Driver : public Usermod {
JsonObject user = root["u"];
if (user.isNull()) user = root.createNestedObject("u");
- // Unfortunately the web UI doesn't know how to print sub-objects: you just see '[object Object]'
+ // Unfortunately the web UI doesn't know how to imprimir sub-objects: you just see '[object Object]'
// For now, we just put everything in the root userdata object.
- //auto imu_meas = user.createNestedObject("IMU");
+ //auto imu_meas = usuario.createNestedObject("IMU");
auto& imu_meas = user;
- // If an element is an array, the UI expects two elements in the form [value, unit]
- // Since our /value/ is an array, wrap it, eg. [[a, b, c]]
+ // If an element is an matriz, the UI expects two elements in the form [valor, unit]
+ // Since our /valor/ is an matriz, wrap it, eg. [[a, b, c]]
JsonArray quat_json = imu_meas.createNestedArray("Quat").createNestedArray();
quat_json.add(qat.w);
quat_json.add(qat.x);
@@ -341,7 +341,7 @@ class MPU6050Driver : public Usermod {
/*
- * addToConfig() can be used to add custom persistent settings to the cfg.json file in the "um" (usermod) object.
+ * addToConfig() can be used to add custom persistent settings to the cfg.JSON archivo in the "um" (usermod) object.
* It will be called by WLED when settings are actually saved (for example, LED settings are saved)
* I highly recommend checking out the basics of ArduinoJson serialization and deserialization in order to use custom settings!
*/
@@ -349,7 +349,7 @@ class MPU6050Driver : public Usermod {
{
JsonObject top = root.createNestedObject(FPSTR(_name));
- //save these vars persistently whenever settings are saved
+ //guardar these vars persistently whenever settings are saved
top[FPSTR(_enabled)] = config.enabled;
top[FPSTR(_interrupt_pin)] = config.interruptPin;
top[FPSTR(_x_acc_bias)] = config.accel_offset[0];
@@ -361,24 +361,24 @@ class MPU6050Driver : public Usermod {
}
/*
- * readFromConfig() can be used to read back the custom settings you added with addToConfig().
+ * readFromConfig() can be used to leer back the custom settings you added with addToConfig().
* This is called by WLED when settings are loaded (currently this only happens immediately after boot, or after saving on the Usermod Settings page)
*
- * readFromConfig() is called BEFORE setup(). This means you can use your persistent values in setup() (e.g. pin assignments, buffer sizes),
- * but also that if you want to write persistent values to a dynamic buffer, you'd need to allocate it here instead of in setup.
+ * readFromConfig() is called BEFORE configuración(). This means you can use your persistent values in configuración() (e.g. pin assignments, búfer sizes),
+ * but also that if you want to escribir persistent values to a dynamic búfer, you'd need to allocate it here instead of in configuración.
* If you don't know what that is, don't fret. It most likely doesn't affect your use case :)
*
- * Return true in case the config values returned from Usermod Settings were complete, or false if you'd like WLED to save your defaults to disk (so any missing values are editable in Usermod Settings)
+ * Retorno verdadero in case the config values returned from Usermod Settings were complete, or falso if you'd like WLED to guardar your defaults to disk (so any missing values are editable in Usermod Settings)
*
- * getJsonValue() returns false if the value is missing, or copies the value into the variable provided and returns true if the value is present
- * The configComplete variable is true only if the "exampleUsermod" object and all values are present. If any values are missing, WLED will know to call addToConfig() to save them
+ * getJsonValue() returns falso if the valor is missing, or copies the valor into the variable provided and returns verdadero if the valor is present
+ * The configComplete variable is verdadero only if the "exampleUsermod" object and all values are present. If any values are missing, WLED will know to call addToConfig() to guardar them
*
- * This function is guaranteed to be called on boot, but could also be called every time settings are updated
+ * This función is guaranteed to be called on boot, but could also be called every time settings are updated
*/
bool readFromConfig(JsonObject& root)
{
- // default settings values could be set here (or below using the 3-argument getJsonValue()) instead of in the class definition or constructor
- // setting them inside readFromConfig() is slightly more robust, handling the rare but plausible use case of single value being missing after boot (e.g. if the cfg.json was manually edited and a value was removed)
+ // default settings values could be set here (or below usando the 3-argumento getJsonValue()) instead of in the clase definition or constructor
+ // setting them inside readFromConfig() is slightly more robust, handling the rare but plausible use case of single valor being missing after boot (e.g. if the cfg.JSON was manually edited and a valor was removed)
auto old_cfg = config;
JsonObject top = root[FPSTR(_name)];
@@ -410,7 +410,7 @@ class MPU6050Driver : public Usermod {
irqBound = false;
}
- // Re-call setup on the next loop()
+ // Re-call configuración on the next bucle()
configDirty = true;
}
@@ -425,7 +425,7 @@ class MPU6050Driver : public Usermod {
}
/*
- * getId() allows you to optionally give your V2 usermod an unique ID (please define it in const.h!).
+ * getId() allows you to optionally give your V2 usermod an unique ID (please definir it in constante.h!).
*/
uint16_t getId()
{
diff --git a/usermods/mpu6050_imu/usermod_gyro_surge.h b/usermods/mpu6050_imu/usermod_gyro_surge.h
index c19358de74..c5847bde26 100644
--- a/usermods/mpu6050_imu/usermod_gyro_surge.h
+++ b/usermods/mpu6050_imu/usermod_gyro_surge.h
@@ -1,14 +1,14 @@
#pragma once
-/* This usermod uses gyro data to provide a "surge" effect on movement
+/* Este usermod usa datos del giroscopio para proporcionar un efecto de "surge" basado en movimiento
-Requires lib_deps = bolderflight/Bolder Flight Systems Eigen@^3.0.0
+Requiere lib_deps = bolderflight/Bolder Flight Systems Eigen@^3.0.0
*/
#include "wled.h"
-// Eigen include block
+// Eigen incluir block
#ifdef A0
namespace { constexpr size_t A0_temp {A0}; }
#undef A0
@@ -64,8 +64,8 @@ constexpr auto ESTIMATED_G = 9.801; // m/s^2
constexpr auto ESTIMATED_G_COUNTS = 8350.;
constexpr auto ESTIMATED_ANGULAR_RATE = (M_PI * 2000) / (INT16_MAX * 180); // radians per second
-// Horribly lame digital filter code
-// Currently implements a static IIR filter.
+// Horribly lame digital filtro código
+// Currently implements a estático IIR filtro.
template
class xir_filter {
typedef Eigen::Array array_t;
@@ -99,56 +99,55 @@ class GyroSurge : public Usermod {
uint8_t max = 0;
float sensitivity = 0;
- // State
+ // Estado
uint32_t last_sample;
- // 100hz input
- // butterworth low pass filter at 20hz
+ // 100hz entrada
+ // butterworth low pass filtro at 20hz
xir_filter filter = { 1., { -0.36952738, 0.19581571, 1.}, {0.20657208, 0.41314417, 0.20657208} };
- // { 1., { 0., 0., 1.}, { 0., 0., 1. } }; // no filter
+ // { 1., { 0., 0., 1.}, { 0., 0., 1. } }; // no filtro
public:
/*
- * setup() is called once at boot. WiFi is not yet connected at this point.
+ * `configuración()` se llama una vez al arrancar. En este punto WiFi aún no está conectado.
*/
void setup() {};
/*
- * addToConfig() can be used to add custom persistent settings to the cfg.json file in the "um" (usermod) object.
- * It will be called by WLED when settings are actually saved (for example, LED settings are saved)
- * I highly recommend checking out the basics of ArduinoJson serialization and deserialization in order to use custom settings!
+ * `addToConfig()` puede usarse para añadir ajustes persistentes personalizados al fichero `cfg.JSON` en el objeto "um" (usermod).
+ * Será llamada por WLED cuando los ajustes se guarden (por ejemplo, al guardar ajustes de LED).
+ * Se recomienda revisar ArduinoJson para serialización/deserialización si se usan ajustes personalizados.
*/
void addToConfig(JsonObject& root)
{
JsonObject top = root.createNestedObject(FPSTR(_name));
- //save these vars persistently whenever settings are saved
+ //guardar these vars persistently whenever settings are saved
top["max"] = max;
top["sensitivity"] = sensitivity;
}
/*
- * readFromConfig() can be used to read back the custom settings you added with addToConfig().
- * This is called by WLED when settings are loaded (currently this only happens immediately after boot, or after saving on the Usermod Settings page)
- *
- * readFromConfig() is called BEFORE setup(). This means you can use your persistent values in setup() (e.g. pin assignments, buffer sizes),
- * but also that if you want to write persistent values to a dynamic buffer, you'd need to allocate it here instead of in setup.
- * If you don't know what that is, don't fret. It most likely doesn't affect your use case :)
- *
- * Return true in case the config values returned from Usermod Settings were complete, or false if you'd like WLED to save your defaults to disk (so any missing values are editable in Usermod Settings)
- *
- * getJsonValue() returns false if the value is missing, or copies the value into the variable provided and returns true if the value is present
- * The configComplete variable is true only if the "exampleUsermod" object and all values are present. If any values are missing, WLED will know to call addToConfig() to save them
- *
- * This function is guaranteed to be called on boot, but could also be called every time settings are updated
+ * `readFromConfig()` puede usarse para leer los ajustes personalizados añadidos con `addToConfig()`.
+ * Es llamada por WLED cuando se cargan los ajustes (actualmente al arrancar o tras guardar desde la página de Usermod Settings).
+ *
+ * `readFromConfig()` se llama ANTES de `configuración()`. Esto permite usar valores persistentes en `configuración()` (p. ej. asignación de pines),
+ * pero si necesitas escribir valores persistentes en un búfer dinámico deberás asignarlo aquí en lugar de en `configuración()`.
+ *
+ * Devuelve `verdadero` si los valores de configuración estaban completos, o `falso` si quieres que WLED guarde los valores por defecto en disco.
+ *
+ * `getJsonValue()` devuelve falso si falta el valor, o copia el valor en la variable proporcionada y devuelve verdadero si está presente.
+ * `configComplete` será verdadero sólo si el objeto del usermod y todos sus valores están presentes. Si faltan valores, WLED llamará a `addToConfig()` para guardarlos.
+ *
+ * Esta función se garantiza que se llame en el arranque, pero también puede ser llamada cada vez que se actualizan los ajustes.
*/
bool readFromConfig(JsonObject& root)
{
- // default settings values could be set here (or below using the 3-argument getJsonValue()) instead of in the class definition or constructor
- // setting them inside readFromConfig() is slightly more robust, handling the rare but plausible use case of single value being missing after boot (e.g. if the cfg.json was manually edited and a value was removed)
+ // default settings values could be set here (or below usando the 3-argumento getJsonValue()) instead of in the clase definition or constructor
+ // setting them inside readFromConfig() is slightly more robust, handling the rare but plausible use case of single valor being missing after boot (e.g. if the cfg.JSON was manually edited and a valor was removed)
JsonObject top = root[FPSTR(_name)];
@@ -161,7 +160,7 @@ class GyroSurge : public Usermod {
}
void loop() {
- // get IMU data
+ // get IMU datos
um_data_t *um_data;
if (!UsermodManager::getUMData(&um_data, USERMOD_ID_IMU)) {
// Apply max
@@ -172,46 +171,46 @@ class GyroSurge : public Usermod {
if (sample_count != last_sample) {
last_sample = sample_count;
- // Calculate based on new data
- // We use the raw gyro data (angular rate)
+ // Calculate based on new datos
+ // We use the raw gyro datos (angular rate)
auto gyros = (int16_t*)um_data->u_data[4]; // 16384 == 2000 deg/s
// Compute the overall rotation rate
- // For my application (a plasma sword) we ignore X axis rotations (eg. around the long axis)
+ // For my aplicación (a plasma sword) we ignorar X axis rotations (eg. around the long axis)
auto gyro_q = Eigen::AngleAxis {
- //Eigen::AngleAxis(ESTIMATED_ANGULAR_RATE * gyros[0], Eigen::Vector3f::UnitX()) *
+ //Eigen::AngleAxis(ESTIMATED_ANGULAR_RATE * gyros[0], Eigen::Vector3f::UnitX()) *
Eigen::AngleAxis(ESTIMATED_ANGULAR_RATE * gyros[1], Eigen::Vector3f::UnitY()) *
Eigen::AngleAxis(ESTIMATED_ANGULAR_RATE * gyros[2], Eigen::Vector3f::UnitZ()) };
- // Filter the results
+ // Filtro the results
filter(std::min(sensitivity * gyro_q.angle(), 1.0f)); // radians per second
/*
- Serial.printf("[%lu] Gy: %d, %d, %d -- ", millis(), (int)gyros[0], (int)gyros[1], (int)gyros[2]);
- Serial.print(gyro_q.angle());
- Serial.print(", ");
- Serial.print(sensitivity * gyro_q.angle());
- Serial.print(" --> ");
- Serial.println(filter.last());
+ Serie.printf("[%lu] Gy: %d, %d, %d -- ", millis(), (int)gyros[0], (int)gyros[1], (int)gyros[2]);
+ Serie.imprimir(gyro_q.angle());
+ Serie.imprimir(", ");
+ Serie.imprimir(sensitivity * gyro_q.angle());
+ Serie.imprimir(" --> ");
+ Serie.println(filtro.last());
*/
}
}; // noop
/*
- * handleOverlayDraw() is called just before every show() (LED strip update frame) after effects have set the colors.
- * Use this to blank out some LEDs or set them to a different color regardless of the set effect mode.
- * Commonly used for custom clocks (Cronixie, 7 segment)
+ * `handleOverlayDraw()` se llama justo antes de cada `show()` (actualización del frame de la tira LED) después de que los efectos hayan definido los colores.
+ * Úsalo para enmascarar LEDs o fijarles un color diferente independientemente del efecto activo.
+ * Comúnmente usado para relojes personalizados (Cronixie, 7 segmentos)
*/
void handleOverlayDraw()
{
- // TODO: some kind of timing analysis for filtering ...
+ // TODO: some kind of timing análisis for filtering ...
- // Calculate brightness boost
+ // Calculate brillo boost
auto r_float = std::max(std::min(filter.last(), 1.0f), 0.f);
auto result = (uint8_t) (r_float * max);
- //Serial.printf("[%lu] %d -- ", millis(), result);
- //Serial.println(r_float);
- // TODO - multiple segment handling??
+ //Serie.printf("[%lu] %d -- ", millis(), resultado);
+ //Serie.println(r_float);
+ // TODO - multiple segmento handling??
strip.getSegment(0).fadeToBlackBy(max - result);
}
};
diff --git a/usermods/multi_relay/multi_relay.cpp b/usermods/multi_relay/multi_relay.cpp
index 4cbdb2fe39..7785df5312 100644
--- a/usermods/multi_relay/multi_relay.cpp
+++ b/usermods/multi_relay/multi_relay.cpp
@@ -53,11 +53,11 @@
#endif
/*
- * This usermod handles multiple relay outputs.
- * These outputs complement built-in relay output in a way that the activation can be delayed.
- * They can also activate/deactivate in reverse logic independently.
- *
- * Written and maintained by @blazoncek
+ * Este usermod gestiona múltiples salidas de relé.
+ * Estas salidas complementan la salida de relé integrada permitiendo retrasar la activación.
+ * También pueden activarse/desactivarse con lógica invertida de forma independiente.
+ *
+ * Escrito y mantenido por @blazoncek
*/
@@ -77,7 +77,7 @@ typedef struct relay_t {
class MultiRelay : public Usermod {
private:
- // array of relays
+ // matriz of relays
Relay _relay[MULTI_RELAY_MAX_RELAYS];
uint32_t _switchTimerStart; // switch timer start time
@@ -90,7 +90,7 @@ class MultiRelay : public Usermod {
uint16_t periodicBroadcastSec;
unsigned long lastBroadcast;
- // strings to reduce flash memory usage (used more than twice)
+ // strings to reduce flash memoria usage (used more than twice)
static const char _name[];
static const char _enabled[];
static const char _relay_str[];
@@ -121,57 +121,57 @@ class MultiRelay : public Usermod {
public:
/**
- * constructor
+ * Constructor
*/
MultiRelay();
/**
- * desctructor
+ * Destructor
*/
//~MultiRelay() {}
/**
- * Enable/Disable the usermod
+ * Habilitar/Deshabilitar el usermod
*/
inline void enable(bool enable) { enabled = enable; }
/**
- * Get usermod enabled/disabled state
+ * Obtener estado habilitado/deshabilitado del usermod
*/
inline bool isEnabled() { return enabled; }
/**
- * getId() allows you to optionally give your V2 usermod an unique ID (please define it in const.h!).
- * This could be used in the future for the system to determine whether your usermod is installed.
+ * getId() permite dar opcionalmente a tu usermod V2 un ID único (defínelo en `constante.h`).
+ * Esto puede usarse en el futuro para que el sistema determine si el usermod está instalado.
*/
inline uint16_t getId() override { return USERMOD_ID_MULTI_RELAY; }
/**
- * switch relay on/off
+ * Encender/apagar un relé
*/
void switchRelay(uint8_t relay, bool mode);
/**
- * toggle relay
+ * Alternar el estado de un relé
*/
inline void toggleRelay(uint8_t relay) {
switchRelay(relay, !_relay[relay].state);
}
/**
- * setup() is called once at boot. WiFi is not yet connected at this point.
- * You can use it to initialize variables, sensors or similar.
+ * `configuración()` se llama una vez al arrancar. En este punto WiFi aún no está conectado.
+ * Úsalo para inicializar variables, sensores o similares.
*/
void setup() override;
/**
- * connected() is called every time the WiFi is (re)connected
- * Use it to initialize network interfaces
+ * `connected()` se llama cada vez que el WiFi se (re)conecta.
+ * Úsalo para inicializar interfaces de red.
*/
inline void connected() override { InitHtmlAPIHandle(); }
/**
- * loop() is called continuously. Here you can check for events, read sensors, etc.
+ * `bucle()` se llama de forma continua. Aquí puedes comprobar eventos, leer sensores, etc.
*/
void loop() override;
@@ -181,51 +181,51 @@ class MultiRelay : public Usermod {
#endif
/**
- * handleButton() can be used to override default button behaviour. Returning true
- * will prevent button working in a default way.
- * Replicating button.cpp
+ * `handleButton()` puede usarse para sobrescribir el comportamiento por defecto del botón.
+ * Devolver `verdadero` evitará que el botón actúe de la forma predeterminada.
+ * Implementación similar a `button.cpp`.
*/
bool handleButton(uint8_t b) override;
/**
- * addToJsonInfo() can be used to add custom entries to the /json/info part of the JSON API.
+ * `addToJsonInfo()` puede usarse para añadir entradas personalizadas a la sección /JSON/información de la API JSON.
*/
void addToJsonInfo(JsonObject &root) override;
/**
- * addToJsonState() can be used to add custom entries to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * `addToJsonState()` puede usarse para añadir entradas personalizadas a la sección /JSON/estado de la API JSON (objeto estado).
+ * Los valores en el objeto estado pueden ser modificados por clientes conectados.
*/
void addToJsonState(JsonObject &root) override;
/**
- * readFromJsonState() can be used to receive data clients send to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * `readFromJsonState()` puede recibir datos enviados por clientes a la sección /JSON/estado de la API JSON (objeto estado).
+ * Los valores en el objeto estado pueden ser modificados por clientes conectados.
*/
void readFromJsonState(JsonObject &root) override;
/**
- * provide the changeable values
+ * Proporciona los valores configurables (cambiables)
*/
void addToConfig(JsonObject &root) override;
void appendConfigData() override;
/**
- * restore the changeable values
- * readFromConfig() is called before setup() to populate properties from values stored in cfg.json
- *
- * The function should return true if configuration was successfully loaded or false if there was no configuration.
+ * Restaurar los valores configurables
+ * `readFromConfig()` se llama antes de `configuración()` para rellenar propiedades desde los valores guardados en `cfg.JSON`.
+ *
+ * La función debe devolver `verdadero` si la configuración se cargó correctamente o `falso` si no había configuración.
*/
bool readFromConfig(JsonObject &root) override;
};
-// class implementation
+// clase implementación
void MultiRelay::publishMqtt(int relay) {
#ifndef WLED_DISABLE_MQTT
- //Check if MQTT Connected, otherwise it will crash the 8266
+ //Verificar if MQTT Connected, otherwise it will bloqueo the 8266
if (WLED_MQTT_CONNECTED){
char subuf[64];
sprintf_P(subuf, PSTR("%s/relay/%d"), mqttDeviceTopic, relay);
@@ -235,7 +235,7 @@ void MultiRelay::publishMqtt(int relay) {
}
/**
- * switch off the strip if the delay has elapsed
+ * conmutador off the tira if the retraso has elapsed
*/
void MultiRelay::handleOffTimer() {
unsigned long now = millis();
@@ -254,7 +254,7 @@ void MultiRelay::handleOffTimer() {
}
/**
- * HTTP API handler
+ * HTTP API manejador
* borrowed from:
* https://github.com/gsieben/WLED/blob/master/usermods/GeoGab-Relays/usermod_GeoGab.h
*/
@@ -266,14 +266,14 @@ void MultiRelay::InitHtmlAPIHandle() { // https://github.com/me-no-dev/ESPAsync
DEBUG_PRINTLN(F("Relays: HTML API"));
String janswer;
String error = "";
- //int params = request->params();
+ //int params = solicitud->params();
janswer = F("{\"NoOfRelays\":");
janswer += String(MULTI_RELAY_MAX_RELAYS) + ",";
if (getActiveRelayCount()) {
// Commands
if (request->hasParam(FPSTR(_switch))) {
- /**** Switch ****/
+ /**** Conmutador ****/
AsyncWebParameter* p = request->getParam(FPSTR(_switch));
// Get Values
for (int i=0; iindex ? data.substring(strIndex[0], strIndex[1]).toInt() : -1;
}
-//Write a byte to the IO expander
+//Escribir a byte to the IO expander
byte MultiRelay::IOexpanderWrite(byte address, byte _data ) {
Wire.beginTransmission(address);
Wire.write(_data);
return Wire.endTransmission();
}
-//Read a byte from the IO expander
+//Leer a byte from the IO expander
byte MultiRelay::IOexpanderRead(int address) {
byte _data = 0;
Wire.requestFrom(address, 1);
@@ -383,13 +383,13 @@ MultiRelay::MultiRelay()
}
/**
- * switch relay on/off
+ * conmutador relay on/off
*/
void MultiRelay::switchRelay(uint8_t relay, bool mode) {
if (relay>=MULTI_RELAY_MAX_RELAYS || _relay[relay].pin<0) return;
_relay[relay].state = mode;
if (usePcf8574 && _relay[relay].pin >= 100) {
- // we need to send all outputs at the same time
+ // we need to enviar all outputs at the same time
uint8_t state = 0;
for (int i=0; i 600) { //long press
//longPressAction(b); //not exposed
- //handled = false; //use if you want to pass to default behaviour
+ //handled = falso; //use if you want to pass to default behaviour
buttons[b].longPressed = true;
}
@@ -624,10 +624,10 @@ bool MultiRelay::handleButton(uint8_t b) {
buttons[b].waitTime = 0;
if (!buttons[b].longPressed) { //short press
- // if this is second release within 350ms it is a double press (buttonWaitTime!=0)
+ // if this is second lanzamiento within 350ms it is a doble press (buttonWaitTime!=0)
if (doublePress) {
//doublePressAction(b); //not exposed
- //handled = false; //use if you want to pass to default behaviour
+ //handled = falso; //use if you want to pass to default behaviour
} else {
buttons[b].waitTime = now;
}
@@ -635,7 +635,7 @@ bool MultiRelay::handleButton(uint8_t b) {
buttons[b].pressedBefore = false;
buttons[b].longPressed = false;
}
- // if 350ms elapsed since last press/release it is a short press
+ // if 350ms elapsed since last press/lanzamiento it is a short press
if (buttons[b].waitTime && now - buttons[b].waitTime > 350 && !buttons[b].pressedBefore) {
buttons[b].waitTime = 0;
//shortPressAction(b); //not exposed
@@ -649,7 +649,7 @@ bool MultiRelay::handleButton(uint8_t b) {
}
/**
- * addToJsonInfo() can be used to add custom entries to the /json/info part of the JSON API.
+ * `addToJsonInfo()` puede usarse para añadir entradas personalizadas a /JSON/información de la API JSON.
*/
void MultiRelay::addToJsonInfo(JsonObject &root) {
if (enabled) {
@@ -685,8 +685,8 @@ void MultiRelay::addToJsonInfo(JsonObject &root) {
}
/**
- * addToJsonState() can be used to add custom entries to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * addToJsonState() can be used to add custom entries to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
void MultiRelay::addToJsonState(JsonObject &root) {
if (!initDone || !enabled) return; // prevent crash on boot applyPreset()
@@ -709,8 +709,8 @@ void MultiRelay::addToJsonState(JsonObject &root) {
}
/**
- * readFromJsonState() can be used to receive data clients send to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * readFromJsonState() can be used to recibir datos clients enviar to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
void MultiRelay::readFromJsonState(JsonObject &root) {
if (!initDone || !enabled) return; // prevent crash on boot applyPreset()
@@ -771,9 +771,9 @@ void MultiRelay::appendConfigData() {
/**
* restore the changeable values
- * readFromConfig() is called before setup() to populate properties from values stored in cfg.json
+ * readFromConfig() is called before configuración() to populate properties from values stored in cfg.JSON
*
- * The function should return true if configuration was successfully loaded or false if there was no configuration.
+ * The función should retorno verdadero if configuration was successfully loaded or falso if there was no configuration.
*/
bool MultiRelay::readFromConfig(JsonObject &root) {
int8_t oldPin[MULTI_RELAY_MAX_RELAYS];
@@ -790,7 +790,7 @@ bool MultiRelay::readFromConfig(JsonObject &root) {
enabled = top[FPSTR(_enabled)] | enabled;
usePcf8574 = top[FPSTR(_pcf8574)] | usePcf8574;
addrPcf8574 = top[FPSTR(_pcfAddress)] | addrPcf8574;
- // if I2C is not globally initialised just ignore
+ // if I2C is not globally initialised just ignorar
if (i2c_sda<0 || i2c_scl<0) usePcf8574 = false;
periodicBroadcastSec = top[FPSTR(_broadcast)] | periodicBroadcastSec;
periodicBroadcastSec = min(900,max(0,(int)periodicBroadcastSec));
@@ -809,7 +809,7 @@ bool MultiRelay::readFromConfig(JsonObject &root) {
DEBUG_PRINT(FPSTR(_name));
if (!initDone) {
- // reading config prior to setup()
+ // reading config prior to configuración()
DEBUG_PRINTLN(F(" config loaded."));
} else {
// deallocate all pins 1st
@@ -821,11 +821,11 @@ bool MultiRelay::readFromConfig(JsonObject &root) {
setup();
DEBUG_PRINTLN(F(" config (re)loaded."));
}
- // use "return !top["newestParameter"].isNull();" when updating Usermod with new features
+ // use "retorno !top["newestParameter"].isNull();" when updating Usermod with new features
return !top[FPSTR(_pcf8574)].isNull();
}
-// strings to reduce flash memory usage (used more than twice)
+// strings to reduce flash memoria usage (used more than twice)
const char MultiRelay::_name[] PROGMEM = "MultiRelay";
const char MultiRelay::_enabled[] PROGMEM = "enabled";
const char MultiRelay::_relay_str[] PROGMEM = "relay";
diff --git a/usermods/multi_relay/readme.md b/usermods/multi_relay/readme.md
index 543809d8cf..814bf0fa34 100644
--- a/usermods/multi_relay/readme.md
+++ b/usermods/multi_relay/readme.md
@@ -48,7 +48,7 @@ You can override the default maximum number of relays (which is 4) by defining M
Some settings can be defined (defaults) at compile time by setting the following defines:
```cpp
-// enable or disable HA discovery for externally controlled relays
+// habilitar or deshabilitar HA discovery for externally controlled relays
#define MULTI_RELAY_HA_DISCOVERY true
```
diff --git a/usermods/photoresistor_sensor_mqtt_v1/usermod.cpp b/usermods/photoresistor_sensor_mqtt_v1/usermod.cpp
index bbbefc1015..676465d4c5 100644
--- a/usermods/photoresistor_sensor_mqtt_v1/usermod.cpp
+++ b/usermods/photoresistor_sensor_mqtt_v1/usermod.cpp
@@ -1,8 +1,8 @@
#include "wled.h"
/*
- * This v1 usermod file allows you to add own functionality to WLED more easily
- * See: https://github.com/wled-dev/WLED/wiki/Add-own-functionality
- * EEPROM bytes 2750+ are reserved for your custom use case. (if you extend #define EEPSIZE in const.h)
+ * This v1 usermod archivo allows you to add own functionality to WLED more easily
+ * See: https://github.com/WLED-dev/WLED/wiki/Add-own-functionality
+ * EEPROM bytes 2750+ are reserved for your custom use case. (if you extend #definir EEPSIZE in constante.h)
* If you just need 8 bytes, use 2551-2559 (you do not need to increase EEPSIZE)
*
* Consider the v2 usermod API if you need a more advanced feature set!
@@ -23,13 +23,13 @@ int lightValue = 0;
float lightPercentage = 0;
float lastPercentage = 0;
-//gets called once at boot. Do all initialization that doesn't depend on network here
+//gets called once at boot. Do all initialization that doesn't depend on red here
void userSetup()
{
pinMode(LIGHT_PIN, INPUT);
}
-//gets called every time WiFi is (re-)connected. Initialize own network interfaces here
+//gets called every time WiFi is (re-)connected. Inicializar own red interfaces here
void userConnected()
{
@@ -37,7 +37,7 @@ void userConnected()
void publishMqtt(float state)
{
- //Check if MQTT Connected, otherwise it will crash the 8266
+ //Verificar if MQTT Connected, otherwise it will bloqueo the 8266
if (mqtt != nullptr){
char subuf[38];
strcpy(subuf, mqttDeviceTopic);
@@ -46,20 +46,20 @@ void publishMqtt(float state)
}
}
-//loop. You can use "if (WLED_CONNECTED)" to check for successful connection
+//bucle. You can use "if (WLED_CONNECTED)" to verificar for successful conexión
void userLoop()
{
- // Read only every 500ms, otherwise it causes the board to hang
+ // Leer only every 500ms, otherwise it causes the board to hang
if (millis() - readTime > 500)
{
readTime = millis();
timeDiff = millis() - lastTime;
- // Convert value to percentage
+ // Convertir valor to percentage
lightValue = analogRead(LIGHT_PIN);
lightPercentage = ((float)lightValue * -1 + 1024)/(float)1024 *100;
- // Send MQTT message on significant change or after UPDATE_MS
+ // Enviar MQTT mensaje on significant change or after UPDATE_MS
if (abs(lightPercentage - lastPercentage) > CHANGE_THRESHOLD || timeDiff > UPDATE_MS)
{
publishMqtt(lightPercentage);
diff --git a/usermods/pixels_dice_tray/README.md b/usermods/pixels_dice_tray/README.md
index 6daa4fa726..1295f54242 100644
--- a/usermods/pixels_dice_tray/README.md
+++ b/usermods/pixels_dice_tray/README.md
@@ -21,7 +21,7 @@ I also set up a custom web installer for the usermod at
+
* [Demos](#demos)
+ [TFT GUI](#tft-gui)
+ [Multiple Die Controlling Different Segments](#multiple-die-controlling-different-segments)
diff --git a/usermods/pixels_dice_tray/dice_state.h b/usermods/pixels_dice_tray/dice_state.h
index eee4759fd8..1a45c7556a 100644
--- a/usermods/pixels_dice_tray/dice_state.h
+++ b/usermods/pixels_dice_tray/dice_state.h
@@ -1,5 +1,5 @@
/**
- * Structs for passing around usermod state
+ * Structs for passing around usermod estado
*/
#pragma once
@@ -7,45 +7,45 @@
/**
* Here's how the rolls are tracked in this usermod.
- * 1. The arduino-pixels-dice library reports rolls and state mapped to
+ * 1. The arduino-pixels-dice biblioteca reports rolls and estado mapped to
* PixelsDieID.
- * 2. The "configured_die_names" sets which die to connect to and their order.
+ * 2. The "configured_die_names" sets which die to conectar to and their order.
* 3. The rest of the usermod references the die by this order (ie. the LED
- * effect is triggered for rolls for die 0).
+ * efecto is triggered for rolls for die 0).
*/
static constexpr size_t MAX_NUM_DICE = 2;
static constexpr uint8_t INVALID_ROLL_VALUE = 0xFF;
/**
- * The state of the connected die, and new events since the last update.
+ * The estado of the connected die, and new events since the last actualizar.
*/
struct DiceUpdate {
- // The vectors to hold results queried from the library
- // Since vectors allocate data, it's more efficient to keep reusing an instance
- // instead of declaring them on the stack.
+ // The vectors to hold results queried from the biblioteca
+ // Since vectors allocate datos, it's more efficient to keep reusing an instancia
+ // instead of declaring them on the pila.
std::vector dice_list;
pixels::RollUpdates roll_updates;
pixels::BatteryUpdates battery_updates;
- // The PixelsDieID for each dice index. 0 if the die isn't connected.
+ // The PixelsDieID for each dice índice. 0 if the die isn't connected.
// The ordering here matches configured_die_names.
std::array connected_die_ids{0, 0};
};
struct DiceSettings {
- // The mapping of dice names, to the index of die used for effects (ie. The
- // die named "Cat" is die 0). BLE discovery will stop when all the dice are
+ // The mapping of dice names, to the índice of die used for effects (ie. The
+ // die named "Cat" is die 0). BLE discovery will detener when all the dice are
// found. The die slot is disabled if the name is empty. If the name is "*",
// the slot will use the first unassociated die it sees.
std::array configured_die_names{"*", "*"};
- // A label set to describe the next die roll. Index into GetRollName().
+ // A label set to describe the next die roll. Índice into GetRollName().
uint8_t roll_label = INVALID_ROLL_VALUE;
};
-// These are updated in the main loop, but accessed by the effect functions as
+// These are updated in the principal bucle, but accessed by the efecto functions as
// well. My understand is that both of these accesses should be running on the
-// same "thread/task" since WLED doesn't directly create additional threads. The
-// exception would be network callbacks and interrupts, but I don't believe
+// same "hilo/tarea" since WLED doesn't directly crear additional threads. The
+// excepción would be red callbacks and interrupts, but I don't believe
// these accesses are triggered by those. If synchronization was needed, I could
// look at the example in `requestJSONBufferLock()`.
std::array last_die_events;
@@ -61,7 +61,7 @@ static pixels::RollEvent GetLastRoll() {
}
/**
- * Returns true if the container has an item that matches the value.
+ * Returns verdadero if the container has an item that matches the valor.
*/
template
static bool Contains(const C& container, T value) {
diff --git a/usermods/pixels_dice_tray/led_effects.h b/usermods/pixels_dice_tray/led_effects.h
index 7553d6817f..72d791df6b 100644
--- a/usermods/pixels_dice_tray/led_effects.h
+++ b/usermods/pixels_dice_tray/led_effects.h
@@ -15,18 +15,18 @@ extern uint16_t mode_gravcenter();
static constexpr uint8_t USER_ANY_DIE = 0xFF;
/**
- * Two custom effect parameters are used.
- * c1 - Source Die. Sets which die from [0 - MAX_NUM_DICE) controls this effect.
- * If this is set to 0xFF, use the latest event regardless of which die it
+ * Two custom efecto parameters are used.
+ * c1 - Source Die. Sets which die from [0 - MAX_NUM_DICE) controls this efecto.
+ * If this is set to 0xFF, use the latest evento regardless of which die it
* came from.
- * c2 - Target Roll. Sets the "success" criteria for a roll to >= this value.
+ * c2 - Target Roll. Sets the "success" criteria for a roll to >= this valor.
*/
/**
- * Return the last die roll based on the custom1 effect setting.
+ * Retorno the last die roll based on the custom1 efecto setting.
*/
static pixels::RollEvent GetLastRollForSegment() {
- // If an invalid die is selected, fallback to using the most recent roll from
+ // If an invalid die is selected, fallback to usando the most recent roll from
// any die.
if (SEGMENT.custom1 >= MAX_NUM_DICE) {
return GetLastRoll();
@@ -37,9 +37,9 @@ static pixels::RollEvent GetLastRollForSegment() {
/*
- * Alternating pixels running function (copied static function).
+ * Alternating pixels running función (copied estático función).
*/
-// paletteBlend: 0 - wrap when moving, 1 - always wrap, 2 - never wrap, 3 - none (undefined)
+// paletteBlend: 0 - wrap when moving, 1 - always wrap, 2 - never wrap, 3 - none (indefinido)
#define PALETTE_SOLID_WRAP (strip.paletteBlend == 1 || strip.paletteBlend == 3)
static uint16_t running_copy(uint32_t color1, uint32_t color2, bool theatre = false) {
int width = (theatre ? 3 : 1) + (SEGMENT.intensity >> 4); // window
@@ -81,13 +81,13 @@ static uint16_t simple_roll() {
}
return FRAMETIME;
}
-// See https://kno.wled.ge/interfaces/json-api/#effect-metadata
+// See https://kno.WLED.ge/interfaces/JSON-API/#efecto-metadata
// Name - DieSimple
// Parameters -
// * Selected Die (custom1)
// Colors - Uses color1 and color2
-// Palette - Not used
-// Flags - Effect is optimized for use on 1D LED strips.
+// Paleta - Not used
+// Flags - Efecto is optimized for use on 1D LED strips.
// Defaults - Selected Die set to 0xFF (USER_ANY_DIE)
static const char _data_FX_MODE_SIMPLE_DIE[] PROGMEM =
"DieSimple@,,Selected Die;!,!;;1;c1=255";
diff --git a/usermods/pixels_dice_tray/pixels_dice_tray.cpp b/usermods/pixels_dice_tray/pixels_dice_tray.cpp
index 2e97aff650..5831872626 100644
--- a/usermods/pixels_dice_tray/pixels_dice_tray.cpp
+++ b/usermods/pixels_dice_tray/pixels_dice_tray.cpp
@@ -5,7 +5,7 @@
#include "led_effects.h"
#include "tft_menu.h"
-// Set this parameter to rotate the display. 1-3 rotate by 90,180,270 degrees.
+// Set this parámetro to rotate the display. 1-3 rotate by 90,180,270 degrees.
#ifndef USERMOD_PIXELS_DICE_TRAY_ROTATION
#define USERMOD_PIXELS_DICE_TRAY_ROTATION 0
#endif
@@ -15,17 +15,17 @@
#define USERMOD_PIXELS_DICE_TRAY_REFRESH_RATE_MS 200
#endif
-// Time with no updates before screen turns off (-1 to disable)
+// Hora with no updates before screen turns off (-1 to deshabilitar)
#ifndef USERMOD_PIXELS_DICE_TRAY_TIMEOUT_MS
#define USERMOD_PIXELS_DICE_TRAY_TIMEOUT_MS 5 * 60 * 1000
#endif
-// Duration of each search for BLE devices.
+// Duración of each buscar for BLE devices.
#ifndef BLE_SCAN_DURATION_SEC
#define BLE_SCAN_DURATION_SEC 4
#endif
-// Time between searches for BLE devices.
+// Hora between searches for BLE devices.
#ifndef BLE_TIME_BETWEEN_SCANS_SEC
#define BLE_TIME_BETWEEN_SCANS_SEC 5
#endif
@@ -62,11 +62,11 @@ class PixelsDiceTrayUsermod : public Usermod {
}
// NOTE: THIS MOD DOES NOT SUPPORT CHANGING THE SPI PINS FROM THE UI! The
- // TFT_eSPI library requires that they are compiled in.
+ // TFT_eSPI biblioteca requires that they are compiled in.
static void SetSPIPinsFromMacros() {
#if USING_TFT_DISPLAY
spi_mosi = TFT_MOSI;
- // Done in TFT library.
+ // Done in TFT biblioteca.
if (TFT_MISO == TFT_MOSI) {
spi_miso = -1;
}
@@ -77,8 +77,8 @@ class PixelsDiceTrayUsermod : public Usermod {
void UpdateDieNames(
const std::array& new_die_names) {
for (size_t i = 0; i < MAX_NUM_DICE; i++) {
- // If the saved setting was a wildcard, and that connected to a die, use
- // the new name instead of the wildcard. Saving this "locks" the name in.
+ // If the saved setting was a comodín, and that connected to a die, use
+ // the new name instead of the comodín. Saving this "locks" the name in.
bool overriden_wildcard =
new_die_names[i] == "*" && dice_update.connected_die_ids[i] != 0;
if (!overriden_wildcard &&
@@ -101,8 +101,8 @@ class PixelsDiceTrayUsermod : public Usermod {
// Functions called by WLED
/*
- * setup() is called once at boot. WiFi is not yet connected at this point.
- * You can use it to initialize variables, sensors or similar.
+ * `configuración()` se llama una vez al arrancar. En este punto WiFi aún no está conectado.
+ * Úsalo para inicializar variables, sensores o similares.
*/
void setup() override {
DEBUG_PRINTLN(F("DiceTray: init"));
@@ -129,8 +129,8 @@ class PixelsDiceTrayUsermod : public Usermod {
}
#endif
- // Need to enable WiFi sleep:
- // "E (1513) wifi:Error! Should enable WiFi modem sleep when both WiFi and Bluetooth are enabled!!!!!!"
+ // Need to habilitar WiFi sleep:
+ // "E (1513) WiFi:Error! Should habilitar WiFi modem sleep when both WiFi and Bluetooth are enabled!!!!!!"
noWifiSleep = false;
// Get the mode indexes that the effects are registered to.
@@ -139,7 +139,7 @@ class PixelsDiceTrayUsermod : public Usermod {
FX_MODE_CHECK_D20 = strip.addEffect(255, &check_roll, _data_FX_MODE_CHECK_DIE);
DIE_LED_MODES = {FX_MODE_SIMPLE_D20, FX_MODE_PULSE_D20, FX_MODE_CHECK_D20};
- // Start a background task scanning for dice.
+ // Iniciar a background tarea scanning for dice.
// On completion the discovered dice are connected to.
pixels::ScanForDice(ble_scan_duration_sec, BLE_TIME_BETWEEN_SCANS_SEC);
@@ -149,24 +149,22 @@ class PixelsDiceTrayUsermod : public Usermod {
}
/*
- * connected() is called every time the WiFi is (re)connected
- * Use it to initialize network interfaces
+ * `connected()` se llama cada vez que el WiFi se (re)conecta.
+ * Úsalo para inicializar interfaces de red.
*/
void connected() override {
- // Serial.println("Connected to WiFi!");
+ // Serie.println("Connected to WiFi!");
}
/*
- * loop() is called continuously. Here you can check for events, read sensors,
- * etc.
+ * `bucle()` se llama de forma continua. Aquí puedes comprobar eventos, leer sensores, etc.
*
- * Tips:
- * 1. You can use "if (WLED_CONNECTED)" to check for a successful network
- * connection. Additionally, "if (WLED_MQTT_CONNECTED)" is available to check
- * for a connection to an MQTT broker.
+ * Consejos:
+ * 1. Puedes usar "if (WLED_CONNECTED)" para comprobar una conexión de red.
+ * Adicionalmente, "if (WLED_MQTT_CONNECTED)" permite comprobar la conexión al broker MQTT.
*
- * 2. Try to avoid using the delay() function. NEVER use delays longer than 10
- * milliseconds. Instead, use a timer check as shown here.
+ * 2. Evita usar `retraso()`; NUNCA uses delays mayores a 10 ms.
+ * En su lugar usa comprobaciones temporizadas como en este ejemplo.
*/
void loop() override {
static long last_loop_time = 0;
@@ -175,25 +173,25 @@ class PixelsDiceTrayUsermod : public Usermod {
char mqtt_topic_buffer[MQTT_MAX_TOPIC_LEN + 16];
char mqtt_data_buffer[128];
- // Check if we time interval for redrawing passes.
+ // Verificar if we time intervalo for redrawing passes.
if (millis() - last_loop_time < USERMOD_PIXELS_DICE_TRAY_REFRESH_RATE_MS) {
return;
}
last_loop_time = millis();
- // Update dice_list with the connected dice
+ // Actualizar dice_list with the connected dice
pixels::ListDice(dice_update.dice_list);
- // Get all the roll/battery updates since the last loop
+ // Get all the roll/battery updates since the last bucle
pixels::GetDieRollUpdates(dice_update.roll_updates);
pixels::GetDieBatteryUpdates(dice_update.battery_updates);
- // Go through list of connected die.
- // TODO: Blacklist die that are connected to, but don't match the configured
+ // Go through lista of connected die.
+ // TODO: Blacklist die that are connected to, but don't coincidir the configured
// names.
std::array die_connected = {false, false};
for (auto die_id : dice_update.dice_list) {
bool matched = false;
- // First check if we've already matched this ID to a connected die.
+ // First verificar if we've already matched this ID to a connected die.
for (size_t i = 0; i < MAX_NUM_DICE; i++) {
if (die_id == dice_update.connected_die_ids[i]) {
die_connected[i] = true;
@@ -202,7 +200,7 @@ class PixelsDiceTrayUsermod : public Usermod {
}
}
- // If this isn't already matched, check if its name matches an expected name.
+ // If this isn't already matched, verificar if its name matches an expected name.
if (!matched) {
auto die_name = pixels::GetDieDescription(die_id).name;
for (size_t i = 0; i < MAX_NUM_DICE; i++) {
@@ -217,7 +215,7 @@ class PixelsDiceTrayUsermod : public Usermod {
}
}
- // If it doesn't match any expected names, check if there's any wildcards to match.
+ // If it doesn't coincidir any expected names, verificar if there's any wildcards to coincidir.
if (!matched) {
auto description = pixels::GetDieDescription(die_id);
for (size_t i = 0; i < MAX_NUM_DICE; i++) {
@@ -234,7 +232,7 @@ class PixelsDiceTrayUsermod : public Usermod {
}
}
- // Clear connected die that aren't still present.
+ // Limpiar connected die that aren't still present.
bool all_found = true;
bool none_found = true;
for (size_t i = 0; i < MAX_NUM_DICE; i++) {
@@ -253,7 +251,7 @@ class PixelsDiceTrayUsermod : public Usermod {
}
}
- // Update last_die_events
+ // Actualizar last_die_events
for (const auto& roll : dice_update.roll_updates) {
for (size_t i = 0; i < MAX_NUM_DICE; i++) {
if (dice_update.connected_die_ids[i] == roll.first) {
@@ -279,7 +277,7 @@ class PixelsDiceTrayUsermod : public Usermod {
USERMOD_PIXELS_DICE_TRAY_TIMEOUT_MS) {
// Turn off LEDs and backlight and go to sleep.
// Since none of the wake up pins are wired up, expect to sleep
- // until power cycle or reset, so don't need to handle normal
+ // until power cycle or restablecer, so don't need to handle normal
// wakeup.
bri = 0;
applyFinalBri();
@@ -306,9 +304,9 @@ class PixelsDiceTrayUsermod : public Usermod {
}
/*
- * addToJsonInfo() can be used to add custom entries to the /json/info part of
- * the JSON API. Creating an "u" object allows you to add custom key/value
- * pairs to the Info section of the WLED web UI. Below it is shown how this
+ * addToJsonInfo() can be used to add custom entries to the /JSON/información part of
+ * the JSON API. Creating an "u" object allows you to add custom key/valor
+ * pairs to the Información section of the WLED web UI. Below it is shown how this
* could be used for e.g. a light sensor
*/
void addToJsonInfo(JsonObject& root) override {
@@ -321,8 +319,8 @@ class PixelsDiceTrayUsermod : public Usermod {
}
/*
- * addToJsonState() can be used to add custom entries to the /json/state part
- * of the JSON API (state object). Values in the state object may be modified
+ * addToJsonState() can be used to add custom entries to the /JSON/estado part
+ * of the JSON API (estado object). Values in the estado object may be modified
* by connected clients
*/
void addToJsonState(JsonObject& root) override {
@@ -330,29 +328,29 @@ class PixelsDiceTrayUsermod : public Usermod {
}
/*
- * readFromJsonState() can be used to receive data clients send to the
- * /json/state part of the JSON API (state object). Values in the state object
+ * readFromJsonState() can be used to recibir datos clients enviar to the
+ * /JSON/estado part of the JSON API (estado object). Values in the estado object
* may be modified by connected clients
*/
void readFromJsonState(JsonObject& root) override {
// userVar0 = root["user0"] | userVar0; //if "user0" key exists in JSON,
- // update, else keep old value if (root["bri"] == 255)
- // Serial.println(F("Don't burn down your garage!"));
+ // actualizar, else keep old valor if (root["bri"] == 255)
+ // Serie.println(F("Don't burn down your garage!"));
}
/*
- * addToConfig() can be used to add custom persistent settings to the cfg.json
- * file in the "um" (usermod) object. It will be called by WLED when settings
+ * addToConfig() can be used to add custom persistent settings to the cfg.JSON
+ * archivo in the "um" (usermod) object. It will be called by WLED when settings
* are actually saved (for example, LED settings are saved) If you want to
- * force saving the current state, use serializeConfig() in your loop().
+ * force saving the current estado, use serializeConfig() in your bucle().
*
- * CAUTION: serializeConfig() will initiate a filesystem write operation.
+ * CAUTION: serializeConfig() will initiate a filesystem escribir operation.
* It might cause the LEDs to stutter and will cause flash wear if called too
- * often. Use it sparingly and always in the loop, never in network callbacks!
+ * often. Use it sparingly and always in the bucle, never in red callbacks!
*
* addToConfig() will also not yet add your setting to one of the settings
* pages automatically. To make that work you still have to add the setting to
- * the HTML, xml.cpp and set.cpp manually.
+ * the HTML, XML.cpp and set.cpp manually.
*
* I highly recommend checking out the basics of ArduinoJson serialization and
* deserialization in order to use custom settings!
@@ -373,18 +371,18 @@ class PixelsDiceTrayUsermod : public Usermod {
}
void appendConfigData() override {
- // Slightly annoying that you can't put text before an element.
+ // Slightly annoying that you can't put texto before an element.
// The an item on the usermod config page has the following HTML:
- // ```html
+ // ```HTML
// Die 0
- //
- //
+ //
+ //
// ```
- // addInfo let's you add data before or after the two input fields.
+ // addInfo let's you add datos before or after the two entrada fields.
//
- // To work around this, add info text to the end of the preceding item.
+ // To work around this, add información texto to the end of the preceding item.
//
- // See addInfo in wled00/data/settings_um.htm for details on what this function does.
+ // See addInfo in wled00/datos/settings_um.htm for details on what this función does.
oappend(F(
"addInfo('DiceTray:ble_scan_duration',1,'
Set to \"*\" to "
"connect to any die. Leave Blank to disable. WLED_DOUBLE_PRESS &&
!buttons[b].pressedBefore) {
buttons[b].waitTime = 0;
@@ -522,14 +520,14 @@ class PixelsDiceTrayUsermod : public Usermod {
/*
* getId() allows you to optionally give your V2 usermod an unique ID (please
- * define it in const.h!). This could be used in the future for the system to
+ * definir it in constante.h!). This could be used in the futuro for the sistema to
* determine whether your usermod is installed.
*/
uint16_t getId() { return USERMOD_ID_PIXELS_DICE_TRAY; }
- // More methods can be added in the future, this example will then be
+ // More methods can be added in the futuro, this example will then be
// extended. Your usermod will remain compatible as it does not need to
- // implement all methods from the Usermod base class!
+ // implement all methods from the Usermod base clase!
};
diff --git a/usermods/pixels_dice_tray/tft_menu.h b/usermods/pixels_dice_tray/tft_menu.h
index 0b8fd8394d..18f201e99a 100644
--- a/usermods/pixels_dice_tray/tft_menu.h
+++ b/usermods/pixels_dice_tray/tft_menu.h
@@ -1,5 +1,5 @@
/**
- * Code for using the 128x128 LCD and two buttons on the T-QT Pro as a GUI.
+ * Código for usando the 128x128 LCD and two buttons on the T-QT Pro as a GUI.
*/
#pragma once
@@ -28,9 +28,9 @@ const uint8_t LIGHTNING_ICON_8X8[] PROGMEM = {
TFT_eSPI tft = TFT_eSPI(TFT_WIDTH, TFT_HEIGHT);
/**
- * Print text with box surrounding it.
+ * Imprimir texto with box surrounding it.
*
- * @param txt Text to draw
+ * @param txt Texto to dibujar
* @param color Color for box lines
*/
static void PrintLnInBox(const char* txt, uint32_t color) {
@@ -45,8 +45,8 @@ static void PrintLnInBox(const char* txt, uint32_t color) {
}
/**
- * Override the current colors for the selected segment to the defaults for the
- * selected die effect.
+ * Anular the current colors for the selected segmento to the defaults for the
+ * selected die efecto.
*/
void SetDefaultColors(uint8_t mode) {
Segment& seg = strip.getFirstSelectedSeg();
@@ -64,7 +64,7 @@ void SetDefaultColors(uint8_t mode) {
}
/**
- * Get the pointer to the custom2 value for the current LED segment. This is
+ * Get the pointer to the custom2 valor for the current LED segmento. This is
* used to set the target roll for relevant effects.
*/
static uint8_t* GetCurrentRollTarget() {
@@ -72,7 +72,7 @@ static uint8_t* GetCurrentRollTarget() {
}
/**
- * Class for drawing a histogram of roll results.
+ * Clase for drawing a histogram of roll results.
*/
class RollCountWidget {
private:
@@ -120,12 +120,12 @@ class RollCountWidget {
tft.drawRect(xs, ys, bar_width * 20 + 2, max_bar_height + 2, border_color);
for (size_t i = 0; i < 20; i++) {
if (roll_counts[i] > 0) {
- // Scale bar by highest count.
+ // Escala bar by highest conteo.
uint16_t bar_height = round(float(roll_counts[i]) / float(max_count) *
float(max_bar_height));
// Add space between bars
uint16_t padding = (bar_width > 1) ? 1 : 0;
- // Need to start from top of bar and draw down
+ // Need to iniciar from top of bar and dibujar down
tft.fillRect(xs + 1 + bar_width * i,
ys + 1 + max_bar_height - bar_height, bar_width - padding,
bar_height, bar_color);
@@ -136,7 +136,7 @@ class RollCountWidget {
enum class ButtonType { SINGLE, DOUBLE, LONG };
-// Base class for different menu pages.
+// Base clase for different menu pages.
class MenuBase {
public:
/**
@@ -145,7 +145,7 @@ class MenuBase {
virtual void Update(const DiceUpdate& dice_update) = 0;
/**
- * Draw menu to the screen.
+ * Dibujar menu to the screen.
*/
virtual void Draw(const DiceUpdate& dice_update, bool force_redraw) = 0;
@@ -161,7 +161,7 @@ class MenuBase {
DiceSettings* MenuBase::settings = nullptr;
/**
- * Menu to show connection status and roll histograms.
+ * Menu to show conexión estado and roll histograms.
*/
class DiceStatusMenu : public MenuBase {
public:
@@ -174,7 +174,7 @@ class DiceStatusMenu : public MenuBase {
for (size_t i = 0; i < MAX_NUM_DICE; i++) {
const auto die_id = dice_update.connected_die_ids[i];
const auto connected = die_id != 0;
- // Redraw if connection status changed.
+ // Redraw if conexión estado changed.
die_updated[i] |= die_id != last_die_ids[i];
last_die_ids[i] = die_id;
@@ -207,7 +207,7 @@ class DiceStatusMenu : public MenuBase {
const int16_t ys = SECTION_HEIGHT * i;
const auto die_id = dice_update.connected_die_ids[i];
const auto connected = die_id != 0;
- // Screen updates might be slow, yield in case network task needs to do
+ // Screen updates might be slow, yield in case red tarea needs to do
// work.
yield();
bool battery_update =
@@ -277,7 +277,7 @@ class DiceStatusMenu : public MenuBase {
/**
* Some limited controls for setting the die effects on the current LED
- * segment.
+ * segmento.
*/
class EffectMenu : public MenuBase {
public:
@@ -286,7 +286,7 @@ class EffectMenu : public MenuBase {
void Update(const DiceUpdate& dice_update) override {}
void Draw(const DiceUpdate& dice_update, bool force_redraw) override {
- // NOTE: This doesn't update automatically if the effect is updated on the
+ // NOTE: This doesn't actualizar automatically if the efecto is updated on the
// web UI and vice-versa.
if (force_redraw) {
tft.fillScreen(TFT_BLACK);
@@ -315,10 +315,10 @@ class EffectMenu : public MenuBase {
}
/**
- * Button 0 navigates up and down the settings for the effect.
- * Button 1 changes the value for the selected settings.
- * Long pressing a button resets the effect parameters to their defaults for
- * the current die effect.
+ * Button 0 navigates up and down the settings for the efecto.
+ * Button 1 changes the valor for the selected settings.
+ * Long pressing a button resets the efecto parameters to their defaults for
+ * the current die efecto.
*/
void HandleButton(ButtonType type, uint8_t b) override {
Segment& seg = strip.getFirstSelectedSeg();
@@ -332,7 +332,7 @@ class EffectMenu : public MenuBase {
seg.setMode(DIE_LED_MODES[mode_idx]);
} else {
if (type == ButtonType::LONG) {
- // Need to set mode to different value so defaults are actually loaded.
+ // Need to set mode to different valor so defaults are actually loaded.
seg.setMode(0);
seg.setMode(DIE_LED_MODES[mode_idx], true);
SetDefaultColors(DIE_LED_MODES[mode_idx]);
@@ -361,7 +361,7 @@ class EffectMenu : public MenuBase {
constexpr std::array EffectMenu::DIE_LED_MODE_NUM_FIELDS;
/**
- * Menu for setting the roll label and some info for that roll type.
+ * Menu for setting the roll label and some información for that roll tipo.
*/
class InfoMenu : public MenuBase {
public:
@@ -408,7 +408,7 @@ class InfoMenu : public MenuBase {
};
/**
- * Interface for the rest of the app to update the menus.
+ * Interfaz for the rest of the app to actualizar the menus.
*/
class MenuController {
public:
@@ -438,12 +438,12 @@ class MenuController {
}
/**
- * Double clicking navigates between menus. Button 0 goes down, and button 1
+ * Doble clicking navigates between menus. Button 0 goes down, and button 1
* goes up with wrapping.
*/
void HandleButton(ButtonType type, uint8_t b) {
force_redraw = true;
- // Switch menus with double click
+ // Conmutador menus with doble click
if (ButtonType::DOUBLE == type) {
if (b == 0) {
current_index =
diff --git a/usermods/pov_display/bmpimage.cpp b/usermods/pov_display/bmpimage.cpp
index 2aea5c8d6e..1213201aff 100644
--- a/usermods/pov_display/bmpimage.cpp
+++ b/usermods/pov_display/bmpimage.cpp
@@ -18,7 +18,7 @@ uint32_t read32(File &f) {
bool BMPimage::init(const char * fn) {
File bmpFile;
int bmpDepth;
- //first, check if filename exists
+ //first, verificar if filename exists
if (!WLED_FS.exists(fn)) {
return false;
}
@@ -29,8 +29,8 @@ bool BMPimage::init(const char * fn) {
return false;
}
- //so, the file exists and is opened
- // Parse BMP header
+ //so, the archivo exists and is opened
+ // Analizar BMP encabezado
uint16_t header = read16(bmpFile);
if(header != 0x4D42) { // BMP signature
_valid=false;
@@ -38,11 +38,11 @@ bool BMPimage::init(const char * fn) {
return false;
}
- //read and ingnore file size
+ //leer and ingnore archivo tamaño
read32(bmpFile);
(void)read32(bmpFile); // Read & ignore creator bytes
_imageOffset = read32(bmpFile); // Start of image data
- // Read DIB header
+ // Leer DIB encabezado
read32(bmpFile);
_width = read32(bmpFile);
_height = read32(bmpFile);
@@ -66,7 +66,7 @@ bool BMPimage::init(const char * fn) {
//now, we have successfully got all the basics
// BMP rows are padded (if needed) to 4-byte boundary
_rowSize = (_width * 3 + 3) & ~3;
- //check image size - if it is too large, it will be unusable
+ //verificar image tamaño - if it is too large, it will be unusable
if (_rowSize*_height>BUF_SIZE) {
_valid=false;
bmpFile.close();
@@ -74,7 +74,7 @@ bool BMPimage::init(const char * fn) {
}
bmpFile.close();
- // Ensure filename fits our buffer (segment name length constraint).
+ // Ensure filename fits our búfer (segmento name longitud restricción).
size_t len = strlen(fn);
if (len > WLED_MAX_SEGNAME_LEN) {
return false;
diff --git a/usermods/pov_display/bmpimage.h b/usermods/pov_display/bmpimage.h
index a83d1fa904..f905bf2948 100644
--- a/usermods/pov_display/bmpimage.h
+++ b/usermods/pov_display/bmpimage.h
@@ -4,19 +4,19 @@
#include "wled.h"
/*
- * This class describes a bitmap image. Each object refers to a bmp file on
+ * This clase describes a bitmap image. Each object refers to a bmp archivo on
* filesystem fatfs.
- * To initialize, call init(), passign to it name of a bitmap file
+ * To inicializar, call init(), passign to it name of a bitmap archivo
* at the root of fatfs filesystem:
*
* BMPimage myImage;
* myImage.init("logo.bmp");
*
- * For performance reasons, before actually usign the image, you need to load
+ * For rendimiento reasons, before actually usign the image, you need to carga
* it from filesystem to RAM:
- * myImage.load();
- * All load() operations use the same reserved buffer in RAM, so you can only
- * have one file loaded at a time. Before loading a new file, always unload the
+ * myImage.carga();
+ * All carga() operations use the same reserved búfer in RAM, so you can only
+ * have one archivo loaded at a time. Before loading a new archivo, always unload the
* previous one:
* myImage.unload();
*/
diff --git a/usermods/pov_display/pov.cpp b/usermods/pov_display/pov.cpp
index ea5a43ed68..40d9760b45 100644
--- a/usermods/pov_display/pov.cpp
+++ b/usermods/pov_display/pov.cpp
@@ -6,7 +6,7 @@ void POV::showLine(const byte * line, uint16_t size){
uint16_t i, pos;
uint8_t r, g, b;
if (!line) {
- // All-black frame on null input
+ // All-black frame on nulo entrada
for (i = 0; i < SEGLEN; i++) {
SEGMENT.setPixelColor(i, CRGB::Black);
}
@@ -17,7 +17,7 @@ void POV::showLine(const byte * line, uint16_t size){
for (i = 0; i < SEGLEN; i++) {
if (i < size) {
pos = 3 * i;
- // using bgr order
+ // usando bgr order
b = line[pos++];
g = line[pos++];
r = line[pos];
diff --git a/usermods/pov_display/pov.h b/usermods/pov_display/pov.h
index cb543d2ea7..93b29ed030 100644
--- a/usermods/pov_display/pov.h
+++ b/usermods/pov_display/pov.h
@@ -7,23 +7,23 @@ class POV {
public:
POV();
- /* Shows one line. line should be pointer to array which holds pixel colors
- * (3 bytes per pixel, in BGR order). Note: 3, not 4!!!
- * size should be size of array (number of pixels, not number of bytes)
+ /* Shows one line. line should be pointer to matriz which holds píxel colors
+ * (3 bytes per píxel, in BGR order). Note: 3, not 4!!!
+ * tamaño should be tamaño of matriz (number of pixels, not number of bytes)
*/
void showLine(const byte * line, uint16_t size);
- /* Reads from file an image and making it current image */
+ /* Reads from archivo an image and making it current image */
bool loadImage(const char * filename);
/* Show next line of active image
- Retunrs the index of next line to be shown (not yet shown!)
+ Retunrs the índice of next line to be shown (not yet shown!)
If it retunrs 0, it means we have completed showing the image and
- next call will start again
+ next call will iniciar again
*/
int16_t showNextLine();
- //time since strip was last updated, in micro sec
+ //time since tira was last updated, in micro sec
uint32_t timeSinceUpdate() {return (micros()-lastLineUpdate);}
diff --git a/usermods/pov_display/pov_display.cpp b/usermods/pov_display/pov_display.cpp
index ac68e1b209..202921c760 100644
--- a/usermods/pov_display/pov_display.cpp
+++ b/usermods/pov_display/pov_display.cpp
@@ -15,7 +15,7 @@ uint16_t mode_pov_image(void) {
size_t segLen = strlen(segName);
if (segLen < 4) return FRAMETIME;
const char* ext = segName + (segLen - 4);
- // compare case-insensitive to ".bmp"
+ // comparar case-insensitive to ".bmp"
if (!((ext[0]=='.') &&
(ext[1]=='b' || ext[1]=='B') &&
(ext[2]=='m' || ext[2]=='M') &&
@@ -31,7 +31,7 @@ uint16_t mode_pov_image(void) {
static unsigned long s_lastLoadAttemptMs = 0;
unsigned long nowMs = millis();
- // Retry at most twice per second if the image is not yet loaded.
+ // Reintentar at most twice per second if the image is not yet loaded.
if (nowMs - s_lastLoadAttemptMs < 500) return FRAMETIME;
s_lastLoadAttemptMs = nowMs;
s_pov.loadImage(segName);
@@ -56,8 +56,8 @@ class PovDisplayUsermod : public Usermod {
void loop() override {
- // if usermod is disabled or called during strip updating just exit
- // NOTE: on very long strips strip.isUpdating() may always return true so update accordingly
+ // if usermod is disabled or called during tira updating just salida
+ // NOTE: on very long strips tira.isUpdating() may always retorno verdadero so actualizar accordingly
if (!enabled || strip.isUpdating()) return;
// do your magic here
diff --git a/usermods/pwm_outputs/pwm_outputs.cpp b/usermods/pwm_outputs/pwm_outputs.cpp
index d94f1d848f..57c1eacf7d 100644
--- a/usermods/pwm_outputs/pwm_outputs.cpp
+++ b/usermods/pwm_outputs/pwm_outputs.cpp
@@ -9,6 +9,10 @@
#endif
+/*
+ * Clase que representa una salida PWM controlable.
+ * Permite abrir/cerrar la salida, ajustar duty y serializar su estado a JSON.
+ */
class PwmOutput {
public:
@@ -127,6 +131,9 @@ class PwmOutput {
};
+/*
+ * Usermod que agrupa varias salidas PWM y las expone a la API JSON y a la configuración.
+ */
class PwmOutputsUsermod : public Usermod {
public:
@@ -134,7 +141,7 @@ class PwmOutputsUsermod : public Usermod {
static const char PWM_STATE_NAME[];
void setup() {
- // By default all PWM outputs are disabled, no setup do be done
+ // By default all PWM outputs are disabled, no configuración do be done
}
void loop() {
diff --git a/usermods/quinled-an-penta/quinled-an-penta.cpp b/usermods/quinled-an-penta/quinled-an-penta.cpp
index a3b452bf18..1ee8eb3513 100644
--- a/usermods/quinled-an-penta/quinled-an-penta.cpp
+++ b/usermods/quinled-an-penta/quinled-an-penta.cpp
@@ -12,7 +12,7 @@ class QuinLEDAnPentaUsermod : public Usermod
U8G2 *oledDisplay = nullptr;
SHT *sht30TempHumidSensor;
- // Network info vars
+ // Red información vars
bool networkHasChanged = false;
bool lastKnownNetworkConnected;
IPAddress lastKnownIp;
@@ -25,7 +25,7 @@ class QuinLEDAnPentaUsermod : public Usermod
int lastKnownEthType;
bool lastKnownEthLinkUp;
- // Brightness / LEDC vars
+ // Brillo / LEDC vars
byte lastKnownBri = 0;
int8_t currentBussesNumPins[5] = {0, 0, 0, 0, 0};
int8_t currentLedPins[5] = {0, 0, 0, 0, 0};
@@ -274,9 +274,9 @@ class QuinLEDAnPentaUsermod : public Usermod
}
/*
- * Page 1: Overall brightness and LED outputs
- * Page 2: General info like temp, humidity and others
- * Page 3: Network info
+ * Page 1: Overall brillo and LED outputs
+ * Page 2: General información like temp, humidity and others
+ * Page 3: Red información
*/
void updateOledDisplay()
{
@@ -298,7 +298,7 @@ class QuinLEDAnPentaUsermod : public Usermod
char charCurrentBrightness[charPerRow+1] = "Brightness:";
if (oledUseProgressBars) {
oledDisplay->drawStr(0, oledRow, charCurrentBrightness);
- // There is no method to draw a filled box with rounded corners. So draw the rounded frame first, then fill that frame accordingly to LED percentage
+ // There is no método to dibujar a filled box with rounded corners. So dibujar the rounded frame first, then fill that frame accordingly to LED percentage
oledDisplay->drawRFrame(68, oledRow - 6, 60, 7, 2);
oledDisplay->drawBox(69, oledRow - 5, int(round(58*getPercentageForBrightness(bri)) / 100), 5);
}
@@ -331,7 +331,7 @@ class QuinLEDAnPentaUsermod : public Usermod
break;
}
- // Various info
+ // Various información
case 2:
{
if (isShtReady() && shtReadDataSuccess) {
@@ -352,7 +352,7 @@ class QuinLEDAnPentaUsermod : public Usermod
oledRow += 10;
}
- // Always draw these two on the bottom
+ // Always dibujar these two on the bottom
char charUptime[charPerRow+1];
sprintf(charUptime, "Uptime: %ds", int(millis()/1000 + rolloverMillis*4294967)); // From json.cpp
oledDisplay->drawStr(0, 53, charUptime);
@@ -363,7 +363,7 @@ class QuinLEDAnPentaUsermod : public Usermod
break;
}
- // Network Info
+ // Red Información
case 3:
#ifdef WLED_USE_ETHERNET
if (lastKnownEthType == WLED_ETH_NONE) {
@@ -440,7 +440,7 @@ class QuinLEDAnPentaUsermod : public Usermod
public:
- // strings to reduce flash memory usage (used more than twice)
+ // strings to reduce flash memoria usage (used more than twice)
static const char _name[];
static const char _enabled[];
static const char _oledEnabled[];
@@ -459,8 +459,8 @@ class QuinLEDAnPentaUsermod : public Usermod
/*
- * setup() is called once at boot. WiFi is not yet connected at this point.
- * You can use it to initialize variables, sensors or similar.
+ * `configuración()` se llama una vez al arrancar. En este punto WiFi aún no está conectado.
+ * Úsalo para inicializar variables, sensores o similares.
*/
void setup()
{
@@ -484,14 +484,14 @@ class QuinLEDAnPentaUsermod : public Usermod
}
/*
- * loop() is called continuously. Here you can check for events, read sensors, etc.
+ * `bucle()` se llama de forma continua. Aquí puedes comprobar eventos, leer sensores, etc.
*
- * Tips:
- * 1. You can use "if (WLED_CONNECTED)" to check for a successful network connection.
- * Additionally, "if (WLED_MQTT_CONNECTED)" is available to check for a connection to an MQTT broker.
+ * Consejos:
+ * 1. Puedes usar "if (WLED_CONNECTED)" para comprobar una conexión de red.
+ * Adicionalmente, "if (WLED_MQTT_CONNECTED)" permite comprobar la conexión al broker MQTT.
*
- * 2. Try to avoid using the delay() function. NEVER use delays longer than 10 milliseconds.
- * Instead, use a timer check as shown here.
+ * 2. Evita usar `retraso()`; NUNCA uses delays mayores a 10 ms.
+ * En su lugar usa comprobaciones temporizadas como en este ejemplo.
*/
void loop()
{
@@ -522,9 +522,9 @@ class QuinLEDAnPentaUsermod : public Usermod
}
if (isOledReady() && millis() - oledLogoDrawn > 3000) {
- // Check for changes on the current page and update the OLED if a change is detected
+ // Verificar for changes on the current page and actualizar the OLED if a change is detected
if (millis() - oledLastTimeUpdated > 150) {
- // If there was a network change, force page 3 (network page)
+ // If there was a red change, force page 3 (red page)
if (oledCheckForNetworkChanges()) {
oledCurrentPage = 3;
}
@@ -585,14 +585,14 @@ class QuinLEDAnPentaUsermod : public Usermod
top[FPSTR(_oledFixBuggedScreen)] = oledFixBuggedScreen;
top[FPSTR(_shtEnabled)] = shtEnabled;
- // Update LED pins on config save
+ // Actualizar LED pins on config guardar
getCurrentUsedLedPins();
}
/**
- * readFromConfig() is called before setup() to populate properties from values stored in cfg.json
+ * readFromConfig() is called before configuración() to populate properties from values stored in cfg.JSON
*
- * The function should return true if configuration was successfully loaded or false if there was no configuration.
+ * The función should retorno verdadero if configuration was successfully loaded or falso if there was no configuration.
*/
bool readFromConfig(JsonObject &root)
{
@@ -615,16 +615,16 @@ class QuinLEDAnPentaUsermod : public Usermod
getJsonValue(top[FPSTR(_oledFixBuggedScreen)], oledFixBuggedScreen);
getJsonValue(top[FPSTR(_shtEnabled)], shtEnabled);
- // First run: reading from cfg.json, nothing to do here, will be all done in setup()
+ // First run: reading from cfg.JSON, nothing to do here, will be all done in configuración()
if (!firstRunDone) {
DEBUG_PRINTF("[%s] First run, nothing to do\n", _name);
}
- // Check if mod has been en-/disabled
+ // Verificar if mod has been en-/disabled
else if (enabled != oldEnabled) {
enabled ? setup() : cleanup();
DEBUG_PRINTF("[%s] Usermod has been en-/disabled\n", _name);
}
- // Config has been changed, so adopt to changes
+ // Configuración has been changed, so adopt to changes
else if (enabled) {
if (oldOledEnabled != oledEnabled) {
oledEnabled ? initOledDisplay() : cleanupOledDisplay();
@@ -680,8 +680,8 @@ class QuinLEDAnPentaUsermod : public Usermod
}
/*
- * getId() allows you to optionally give your V2 usermod an unique ID (please define it in const.h!).
- * This could be used in the future for the system to determine whether your usermod is installed.
+ * getId() allows you to optionally give your V2 usermod an unique ID (please definir it in constante.h!).
+ * This could be used in the futuro for the sistema to determine whether your usermod is installed.
*/
uint16_t getId()
{
@@ -689,8 +689,8 @@ class QuinLEDAnPentaUsermod : public Usermod
}
};
-// strings to reduce flash memory usage (used more than twice)
-// Config settings
+// strings to reduce flash memoria usage (used more than twice)
+// Configuración settings
const char QuinLEDAnPentaUsermod::_name[] PROGMEM = "QuinLED-An-Penta";
const char QuinLEDAnPentaUsermod::_enabled[] PROGMEM = "Enabled";
const char QuinLEDAnPentaUsermod::_oledEnabled[] PROGMEM = "Enable-OLED";
diff --git a/usermods/readme.md b/usermods/readme.md
index eefb64dbd0..34307e4922 100644
--- a/usermods/readme.md
+++ b/usermods/readme.md
@@ -1,21 +1,21 @@
# Usermods
-This folder serves as a repository for usermods (custom `usermod.cpp` files)!
+¡Esta carpeta sirve como repositorio para usermods (archivos personalizados `usermod.cpp`)!
-If you have created a usermod you believe is useful (for example to support a particular sensor, display, feature...), feel free to contribute by opening a pull request!
+Si ha creado un usermod que cree que es útil (por ejemplo, para soportar un sensor particular, pantalla, característica...), ¡siéntase libre de contribuir abriendo una solicitud de extracción!
-In order for other people to be able to have fun with your usermod, please keep these points in mind:
+Para que otras personas puedan disfrutar de su usermod, tenga en cuenta estos puntos:
-* Create a folder in this folder with a descriptive name (for example `usermod_ds18b20_temp_sensor_mqtt`)
-* Include your custom files
-* If your usermod requires changes to other WLED files, please write a `readme.md` outlining the steps one needs to take
-* Create a pull request!
-* If your feature is useful for the majority of WLED users, I will consider adding it to the base code!
+* Cree una carpeta en esta carpeta con un nombre descriptivo (por ejemplo `usermod_ds18b20_temp_sensor_mqtt`)
+* Incluya sus archivos personalizados
+* Si su usermod requiere cambios en otros archivos de WLED, escriba un `readme.md` describiendo los pasos que debe seguir
+* ¡Cree una solicitud de extracción!
+* Si su característica es útil para la mayoría de usuarios de WLED, consideraré agregarla al código base!
-While I do my best to not break too much, keep in mind that as WLED is updated, usermods might break.
-I am not actively maintaining any usermod in this directory, that is your responsibility as the creator of the usermod.
+Aunque hago mi mejor esfuerzo para no romper demasiado, tenga en cuenta que a medida que se actualiza WLED, los usermods pueden romperse.
+No estoy manteniendo activamente ningún usermod en este directorio, esa es su responsabilidad como creador del usermod.
-For new usermods, I would recommend trying out the new v2 usermod API, which allows installing multiple usermods at once and new functions!
-You can take a look at `EXAMPLE_v2` for some documentation and at `Temperature` for a completed v2 usermod!
+Para nuevos usermods, recomiendo probar la nueva API de usermod v2, ¡que permite instalar múltiples usermods a la vez y nuevas funciones!
+Puede echar un vistazo a `EXAMPLE_v2` para algunas documentaciones y a `Temperature` para un usermod v2 completado.
-Thank you for your help :)
+¡Gracias por tu ayuda :)
diff --git a/usermods/rgb-rotary-encoder/rgb-rotary-encoder.cpp b/usermods/rgb-rotary-encoder/rgb-rotary-encoder.cpp
index 6be3a92640..a3e9786028 100644
--- a/usermods/rgb-rotary-encoder/rgb-rotary-encoder.cpp
+++ b/usermods/rgb-rotary-encoder/rgb-rotary-encoder.cpp
@@ -25,7 +25,7 @@ class RgbRotaryEncoderUsermod : public Usermod
byte ledMode = 3;
byte ledBrightness = 64;
- // This is all needed to calculate the brightness, rotary position, etc.
+ // This is all needed to calculate the brillo, rotary posición, etc.
const byte minPos = 5; // minPos is not zero, because if we want to turn the LEDs off, we use the built-in button ;)
const byte maxPos = 100; // maxPos=100, like 100%
const byte numLeds = 20;
@@ -54,7 +54,7 @@ class RgbRotaryEncoderUsermod : public Usermod
void initLedBus()
{
- // Initialize all pins to the sentinel value first…
+ // Inicializar all pins to the sentinel valor first…
byte _pins[OUTPUT_MAX_PINS];
std::fill(std::begin(_pins), std::end(_pins), 255);
// …then set only the LED pin
@@ -142,7 +142,7 @@ class RgbRotaryEncoderUsermod : public Usermod
public:
static byte currentPos;
- // strings to reduce flash memory usage (used more than twice)
+ // strings to reduce flash memoria usage (used more than twice)
static const char _name[];
static const char _enabled[];
static const char _ledIo[];
@@ -159,17 +159,17 @@ class RgbRotaryEncoderUsermod : public Usermod
}
/**
- * Enable/Disable the usermod
+ * Habilitar/Deshabilitar the usermod
*/
- // inline void enable(bool enable) { enabled = enable; }
+ // en línea void habilitar(bool habilitar) { enabled = habilitar; }
/**
- * Get usermod enabled/disabled state
+ * Get usermod enabled/disabled estado
*/
- // inline bool isEnabled() { return enabled; }
+ // en línea bool isEnabled() { retorno enabled; }
/*
- * setup() is called once at boot. WiFi is not yet connected at this point.
- * You can use it to initialize variables, sensors or similar.
+ * `configuración()` se llama una vez al arrancar. En este punto WiFi aún no está conectado.
+ * Úsalo para inicializar variables, sensores o similares.
*/
void setup()
{
@@ -180,21 +180,21 @@ class RgbRotaryEncoderUsermod : public Usermod
initRotaryEncoder();
initLedBus();
- // No updating of LEDs here, as that's sometimes not working; loop() will take care of that
+ // No updating of LEDs here, as that's sometimes not funcionamiento; bucle() will take care of that
initDone = true;
}
}
/*
- * loop() is called continuously. Here you can check for events, read sensors, etc.
- *
- * Tips:
- * 1. You can use "if (WLED_CONNECTED)" to check for a successful network connection.
- * Additionally, "if (WLED_MQTT_CONNECTED)" is available to check for a connection to an MQTT broker.
- *
- * 2. Try to avoid using the delay() function. NEVER use delays longer than 10 milliseconds.
- * Instead, use a timer check as shown here.
+ * `bucle()` se llama de forma continua. Aquí puedes comprobar eventos, leer sensores, etc.
+ *
+ * Consejos:
+ * 1. Puedes usar "if (WLED_CONNECTED)" para comprobar una conexión de red.
+ * Adicionalmente, "if (WLED_MQTT_CONNECTED)" permite comprobar la conexión al broker MQTT.
+ *
+ * 2. Evita usar `retraso()`; NUNCA uses delays mayores a 10 ms.
+ * En su lugar usa comprobaciones temporizadas como en este ejemplo.
*/
void loop()
{
@@ -213,7 +213,7 @@ class RgbRotaryEncoderUsermod : public Usermod
colorUpdated(CALL_MODE_DIRECT_CHANGE);
}
- // If the brightness is changed not with the rotary, update the rotary
+ // If the brillo is changed not with the rotary, actualizar the rotary
if (bri != lastKnownBri) {
currentPos = lastKnownPos = getPositionForBrightness();
lastKnownBri = bri;
@@ -221,7 +221,7 @@ class RgbRotaryEncoderUsermod : public Usermod
updateLeds();
}
- // Update LEDs here in loop to also validate that we can update/show
+ // Actualizar LEDs here in bucle to also validar that we can actualizar/show
if (isDirty && ledBus->canShow()) {
isDirty = false;
ledBus->show();
@@ -243,9 +243,9 @@ class RgbRotaryEncoderUsermod : public Usermod
}
/**
- * readFromConfig() is called before setup() to populate properties from values stored in cfg.json
+ * readFromConfig() is called before configuración() to populate properties from values stored in cfg.JSON
*
- * The function should return true if configuration was successfully loaded or false if there was no configuration.
+ * The función should retorno verdadero if configuration was successfully loaded or falso if there was no configuration.
*/
bool readFromConfig(JsonObject &root)
{
@@ -274,15 +274,15 @@ class RgbRotaryEncoderUsermod : public Usermod
ledBrightness = top[FPSTR(_ledBrightness)] > 0 && top[FPSTR(_ledBrightness)] <= 255 ? top[FPSTR(_ledBrightness)] : ledBrightness;
if (!initDone) {
- // First run: reading from cfg.json
- // Nothing to do here, will be all done in setup()
+ // First run: reading from cfg.JSON
+ // Nothing to do here, will be all done in configuración()
}
- // Mod was disabled, so run setup()
+ // Mod was disabled, so run configuración()
else if (enabled && enabled != oldEnabled) {
DEBUG_PRINTF("[%s] Usermod has been re-enabled\n", _name);
setup();
}
- // Config has been changed, so adopt to changes
+ // Configuración has been changed, so adopt to changes
else {
if (!enabled) {
DEBUG_PRINTF("[%s] Usermod has been disabled\n", _name);
@@ -320,20 +320,20 @@ class RgbRotaryEncoderUsermod : public Usermod
}
/*
- * getId() allows you to optionally give your V2 usermod an unique ID (please define it in const.h!).
- * This could be used in the future for the system to determine whether your usermod is installed.
+ * getId() allows you to optionally give your V2 usermod an unique ID (please definir it in constante.h!).
+ * This could be used in the futuro for the sistema to determine whether your usermod is installed.
*/
uint16_t getId()
{
return USERMOD_RGB_ROTARY_ENCODER;
}
- //More methods can be added in the future, this example will then be extended.
- //Your usermod will remain compatible as it does not need to implement all methods from the Usermod base class!
+ //More methods can be added in the futuro, this example will then be extended.
+ //Your usermod will remain compatible as it does not need to implement all methods from the Usermod base clase!
};
byte RgbRotaryEncoderUsermod::currentPos = 5;
-// strings to reduce flash memory usage (used more than twice)
+// strings to reduce flash memoria usage (used more than twice)
const char RgbRotaryEncoderUsermod::_name[] PROGMEM = "RGB-Rotary-Encoder";
const char RgbRotaryEncoderUsermod::_enabled[] PROGMEM = "Enabled";
const char RgbRotaryEncoderUsermod::_ledIo[] PROGMEM = "LED-pin";
diff --git a/usermods/sd_card/sd_card.cpp b/usermods/sd_card/sd_card.cpp
index 4e68b97a34..fe14339597 100644
--- a/usermods/sd_card/sd_card.cpp
+++ b/usermods/sd_card/sd_card.cpp
@@ -30,7 +30,7 @@ class UsermodSdCard : public Usermod {
int8_t configPinPoci = 36; // confusing names? Then have a look :)
int8_t configPinPico = 15; // https://www.oshwa.org/a-resolution-to-redefine-spi-signal-names/
- //acquired and initialize the SPI port
+ //acquired and inicializar the SPI puerto
void init_SD_SPI()
{
if(!configSdEnabled) return;
@@ -65,7 +65,7 @@ class UsermodSdCard : public Usermod {
sdInitDone = true;
}
- //deinitialize the acquired SPI port
+ //deinitialize the acquired SPI puerto
void deinit_SD_SPI()
{
if(!sdInitDone) return;
@@ -81,7 +81,7 @@ class UsermodSdCard : public Usermod {
sdInitDone = false;
}
- // some SPI pin was changed, while SPI was initialized, reinit to new port
+ // some SPI pin was changed, while SPI was initialized, reinit to new puerto
void reinit_SD_SPI()
{
deinit_SD_SPI();
@@ -191,7 +191,7 @@ const char UsermodSdCard::_name[] PROGMEM = "SD Card";
bool UsermodSdCard::configSdEnabled = true;
#ifdef SD_ADAPTER
-//checks if the file is available on SD card
+//checks if the archivo is available on SD card
bool file_onSD(const char *filepath)
{
#ifdef WLED_USE_SD_SPI
diff --git a/usermods/sensors_to_mqtt/sensors_to_mqtt.cpp b/usermods/sensors_to_mqtt/sensors_to_mqtt.cpp
index 5f7da97a98..0ff28a3b4a 100644
--- a/usermods/sensors_to_mqtt/sensors_to_mqtt.cpp
+++ b/usermods/sensors_to_mqtt/sensors_to_mqtt.cpp
@@ -113,7 +113,7 @@ class UserMod_SensorsToMQTT : public Usermod
}
/**
- * Credits: Bouke_Regnerus @ https://community.home-assistant.io/t/example-indoor-air-quality-text-sensor-using-ccs811-sensor/125854
+ * Credits: Bouke_Regnerus @ https://community.home-assistant.io/t/example-indoor-air-quality-texto-sensor-usando-ccs811-sensor/125854
*/
const char *_getIaqIndex(float humidity, int tvoc, int eco2)
{
@@ -121,7 +121,7 @@ class UserMod_SensorsToMQTT : public Usermod
/*
* Transform indoor humidity values to IAQ points according to Indoor Air Quality UK:
- * http://www.iaquk.org.uk/
+ * HTTP://www.iaquk.org.uk/
*/
if (humidity < 10 or humidity > 90)
{
@@ -146,7 +146,7 @@ class UserMod_SensorsToMQTT : public Usermod
/*
* Transform eCO2 values to IAQ points according to Indoor Air Quality UK:
- * http://www.iaquk.org.uk/
+ * HTTP://www.iaquk.org.uk/
*/
if (eco2 <= 600)
{
@@ -171,7 +171,7 @@ class UserMod_SensorsToMQTT : public Usermod
/*
* Transform TVOC values to IAQ points according to German environmental guidelines:
- * https://www.repcomsrl.com/wp-content/uploads/2017/06/Environmental_Sensing_VOC_Product_Brochure_EN.pdf
+ * https://www.repcomsrl.com/wp-contenido/uploads/2017/06/Environmental_Sensing_VOC_Product_Brochure_EN.pdf
*/
if (tvoc <= 65)
{
@@ -254,12 +254,12 @@ class UserMod_SensorsToMQTT : public Usermod
mqttInitialized = true;
}
- // Update sensor data
+ // Actualizar sensor datos
_updateSensorData();
- // Create string populated with user defined device topic from the UI,
- // and the read temperature, humidity and pressure.
- // Then publish to MQTT server.
+ // Crear cadena populated with usuario defined dispositivo topic from the UI,
+ // and the leer temperature, humidity and pressure.
+ // Then publish to MQTT servidor.
mqtt->publish(mqttTemperatureTopic.c_str(), 0, true, String(SensorTemperature).c_str());
mqtt->publish(mqttPressureTopic.c_str(), 0, true, String(SensorPressure).c_str());
mqtt->publish(mqttHumidityTopic.c_str(), 0, true, String(SensorHumidity).c_str());
diff --git a/usermods/seven_segment_display/seven_segment_display.cpp b/usermods/seven_segment_display/seven_segment_display.cpp
index 13a6306be5..6928531a0a 100644
--- a/usermods/seven_segment_display/seven_segment_display.cpp
+++ b/usermods/seven_segment_display/seven_segment_display.cpp
@@ -21,7 +21,7 @@ class SevenSegmentDisplay : public Usermod
int ssVirtualDisplayMessageIdxEnd = 0;
unsigned long resfreshTime = 497;
- // set your config variables to their boot default value (this can also be done in readFromConfig() or a constructor if you prefer)
+ // set your config variables to their boot default valor (this can also be done in readFromConfig() or a constructor if you prefer)
int ssLEDPerSegment = 1; //The number of LEDs in each segment of the 7 seg (total per digit is 7 * ssLedPerSegment)
int ssLEDPerPeriod = 1; //A Period will have 1x and a Colon will have 2x
int ssStartLED = 0; //The pixel that the display starts at.
@@ -49,7 +49,7 @@ class SevenSegmentDisplay : public Usermod
bool ssTimeEnabled = true; //If not, display message.
unsigned int ssScrollSpeed = 1000; //Time between advancement of extended message scrolling, in milliseconds.
- //String to reduce flash memory usage
+ //Cadena to reduce flash memoria usage
static const char _str_perSegment[];
static const char _str_perPeriod[];
static const char _str_startIdx[];
@@ -67,11 +67,11 @@ class SevenSegmentDisplay : public Usermod
//Do time for now.
if (ssDoDisplayTime)
{
- //Format the ssDisplayBuffer based on ssDisplayMask
+ //Formato the ssDisplayBuffer based on ssDisplayMask
int displayMaskLen = static_cast(ssDisplayMask.length());
for (int index = 0; index < displayMaskLen; index++)
{
- //Only look for time formatting if there are at least 2 characters left in the buffer.
+ //Only look for time formatting if there are at least 2 characters left in the búfer.
if ((index < displayMaskLen - 1) && (ssDisplayMask[index] == ssDisplayMask[index + 1]))
{
int timeVar = 0;
@@ -103,7 +103,7 @@ class SevenSegmentDisplay : public Usermod
ssDisplayBuffer[index] = 0x30 + (timeVar / 10);
ssDisplayBuffer[index + 1] = 0x30 + (timeVar % 10);
- //Need to increment the index because of the second digit.
+ //Need to increment the índice because of the second digit.
index++;
}
else
@@ -115,17 +115,17 @@ class SevenSegmentDisplay : public Usermod
}
else
{
- /* This will handle displaying a message and the scrolling of the message if its longer than the buffer length */
+ /* This will handle displaying a mensaje and the scrolling of the mensaje if its longer than the búfer longitud */
- //Check to see if the message has scrolled completely
+ //Verificar to see if the mensaje has scrolled completely
int len = static_cast(ssDisplayMessage.length());
if (ssDisplayMessageIdx > len)
{
- //If it has scrolled the whole message, reset it.
+ //If it has scrolled the whole mensaje, restablecer it.
setSevenSegmentMessage(ssDisplayMessage);
return REFRESHTIME;
}
- //Display message
+ //Display mensaje
int displayMaskLen = static_cast(ssDisplayMask.length());
for (int index = 0; index < displayMaskLen; index++)
{
@@ -135,7 +135,7 @@ class SevenSegmentDisplay : public Usermod
ssDisplayBuffer[index] = ' ';
}
- //Increase the displayed message index to progress it one character if the length exceeds the display length.
+ //Increase the displayed mensaje índice to progress it one carácter if the longitud exceeds the display longitud.
if (len > displayMaskLen)
ssDisplayMessageIdx++;
@@ -146,7 +146,7 @@ class SevenSegmentDisplay : public Usermod
void _overlaySevenSegmentDraw()
{
- //Start pixels at ssStartLED, Use ssLEDPerSegment, ssLEDPerPeriod, ssDisplayBuffer
+ //Iniciar pixels at ssStartLED, Use ssLEDPerSegment, ssLEDPerPeriod, ssDisplayBuffer
int indexLED = ssStartLED;
int displayMaskLen = static_cast(ssDisplayMask.length());
for (int indexBuffer = 0; indexBuffer < displayMaskLen; indexBuffer++)
@@ -155,7 +155,7 @@ class SevenSegmentDisplay : public Usermod
break;
else if (ssDisplayBuffer[indexBuffer] == '.')
{
- //Won't ever turn off LED lights for a period. (or will we?)
+ //Won't ever turn off LED lights for a período. (or will we?)
indexLED += ssLEDPerPeriod;
continue;
}
@@ -197,19 +197,19 @@ class SevenSegmentDisplay : public Usermod
char _overlaySevenSegmentGetCharMask(char var)
{
if (var >= 0x30 && var <= 0x39)
- { /*If its a number, shift to index 0.*/
+ { /*If its a number, shift to índice 0.*/
var -= 0x30;
}
else if (var >= 0x41 && var <= 0x5a)
- { /*If its an Upper case, shift to index 0xA.*/
+ { /*If its an Upper case, shift to índice 0xA.*/
var -= 0x37;
}
else if (var >= 0x61 && var <= 0x7A)
- { /*If its a lower case, shift to index 0xA.*/
+ { /*If its a lower case, shift to índice 0xA.*/
var -= 0x57;
}
else
- { /* Else unsupported, return 0; */
+ { /* Else unsupported, retorno 0; */
return 0;
}
char mask = ssCharacterMask[static_cast(var)];
@@ -344,19 +344,19 @@ class SevenSegmentDisplay : public Usermod
public:
void setSevenSegmentMessage(String message)
{
- //If the message isn't blank display it otherwise show time, if enabled.
+ //If the mensaje isn't blank display it otherwise show time, if enabled.
if (message.length() < 1 || message == "~")
ssDoDisplayTime = ssTimeEnabled;
else
ssDoDisplayTime = false;
- //Determine is the message is longer than the display, if it is configure it to scroll the message.
+ //Determine is the mensaje is longer than the display, if it is configurar it to scroll the mensaje.
if (message.length() > ssDisplayMask.length())
ssDisplayMessageIdx = -ssDisplayMask.length();
else
ssDisplayMessageIdx = 0;
- //If the message isn't the same, update runtime/mqtt (most calls will be resetting message scroll)
+ //If the mensaje isn't the same, actualizar runtime/MQTT (most calls will be resetting mensaje scroll)
if (!ssDisplayMessage.equals(message))
{
_publishMQTTstr_P(_str_displayMsg, message);
@@ -365,24 +365,24 @@ class SevenSegmentDisplay : public Usermod
}
//Functions called by WLED
- /*
- * setup() is called once at boot. WiFi is not yet connected at this point.
- * You can use it to initialize variables, sensors or similar.
- */
+ /*
+ * `configuración()` se llama una vez al arrancar. En este punto WiFi aún no está conectado.
+ * Úsalo para inicializar variables, sensores o similares.
+ */
void setup()
{
ssDisplayBuffer = ssDisplayMask;
}
- /*
- * loop() is called continuously. Here you can check for events, read sensors, etc.
- */
+ /*
+ * `bucle()` se llama de forma continua. Aquí puedes comprobar eventos, leer sensores, etc.
+ */
void loop()
{
if (millis() - lastRefresh > resfreshTime)
{
- //In theory overlaySevenSegmentProcess should return the amount of time until it changes next.
- //So we should be okay to trigger the stripi on every process loop.
+ //In theory overlaySevenSegmentProcess should retorno the amount of time until it changes next.
+ //So we should be okay to disparador the stripi on every proceso bucle.
resfreshTime = _overlaySevenSegmentProcess();
lastRefresh = millis();
strip.trigger();
@@ -400,14 +400,14 @@ class SevenSegmentDisplay : public Usermod
if (mqttDeviceTopic[0] != 0)
{
_updateMQTT();
- //subscribe for sevenseg messages on the device topic
+ //subscribe for sevenseg messages on the dispositivo topic
sprintf_P(subBuffer, PSTR("%s/%S/+/set"), mqttDeviceTopic, _str_sevenSeg);
mqtt->subscribe(subBuffer, 2);
}
if (mqttGroupTopic[0] != 0)
{
- //subscribe for sevenseg messages on the group topic
+ //subscribe for sevenseg messages on the grupo topic
sprintf_P(subBuffer, PSTR("%s/%S/+/set"), mqttGroupTopic, _str_sevenSeg);
mqtt->subscribe(subBuffer, 2);
}
@@ -415,7 +415,7 @@ class SevenSegmentDisplay : public Usermod
bool onMqttMessage(char *topic, char *payload)
{
- //If topic beings with sevenSeg cut it off, otherwise not our message.
+ //If topic beings with sevenSeg cut it off, otherwise not our mensaje.
size_t topicPrefixLen = strlen_P(PSTR("/sevenSeg/"));
if (strncmp_P(topic, PSTR("/sevenSeg/"), topicPrefixLen) == 0)
topic += topicPrefixLen;
@@ -459,7 +459,7 @@ class SevenSegmentDisplay : public Usermod
bool configComplete = !top.isNull();
- //if sevenseg section doesn't exist return
+ //if sevenseg section doesn't exist retorno
if (!configComplete)
return configComplete;
@@ -479,8 +479,8 @@ class SevenSegmentDisplay : public Usermod
}
/*
- * getId() allows you to optionally give your V2 usermod an unique ID (please define it in const.h!).
- * This could be used in the future for the system to determine whether your usermod is installed.
+ * getId() allows you to optionally give your V2 usermod an unique ID (please definir it in constante.h!).
+ * This could be used in the futuro for the sistema to determine whether your usermod is installed.
*/
uint16_t getId()
{
diff --git a/usermods/seven_segment_display_reloaded/seven_segment_display_reloaded.cpp b/usermods/seven_segment_display_reloaded/seven_segment_display_reloaded.cpp
index 893e061bc8..27c5ef61fe 100644
--- a/usermods/seven_segment_display_reloaded/seven_segment_display_reloaded.cpp
+++ b/usermods/seven_segment_display_reloaded/seven_segment_display_reloaded.cpp
@@ -12,7 +12,7 @@
class UsermodSSDR : public Usermod {
-//#define REFRESHTIME 497
+//#definir REFRESHTIME 497
private:
//Runtime variables.
@@ -49,7 +49,7 @@ class UsermodSSDR : public Usermod {
*/
String umSSDRDisplayMask = "H:m"; //This should reflect physical equipment.
- /* Segment order, seen from the front:
+ /* Segmento order, seen from the front:
< A >
/\ /\
@@ -78,7 +78,7 @@ class UsermodSSDR : public Usermod {
{ 0, 0, 0, 0, 0, 0, 0 } // blank
};
- //String to reduce flash memory usage
+ //Cadena to reduce flash memoria usage
static const char _str_name[];
static const char _str_ldrEnabled[];
static const char _str_timeEnabled[];
@@ -380,10 +380,10 @@ class UsermodSSDR : public Usermod {
public:
//Functions called by WLED
- /*
- * setup() is called once at boot. WiFi is not yet connected at this point.
- * You can use it to initialize variables, sensors or similar.
- */
+ /*
+ * `configuración()` se llama una vez al arrancar. En este punto WiFi aún no está conectado.
+ * Úsalo para inicializar variables, sensores o similares.
+ */
void setup() {
umSSDRLength = strip.getLengthTotal();
if (umSSDRMask != 0) {
@@ -402,9 +402,9 @@ class UsermodSSDR : public Usermod {
DEBUG_PRINTLN(F("Setup done"));
}
- /*
- * loop() is called continuously. Here you can check for events, read sensors, etc.
- */
+ /*
+ * `bucle()` se llama de forma continua. Aquí puedes comprobar eventos, leer sensores, etc.
+ */
void loop() {
if (!umSSDRDisplayTime || strip.isUpdating()) {
return;
@@ -445,8 +445,8 @@ class UsermodSSDR : public Usermod {
}
/*
- * addToJsonInfo() can be used to add custom entries to the /json/info part of the JSON API.
- * Creating an "u" object allows you to add custom key/value pairs to the Info section of the WLED web UI.
+ * addToJsonInfo() can be used to add custom entries to the /JSON/información part of the JSON API.
+ * Creating an "u" object allows you to add custom key/valor pairs to the Información section of the WLED web UI.
* Below it is shown how this could be used for e.g. a light sensor
*/
void addToJsonInfo(JsonObject& root) {
@@ -468,8 +468,8 @@ class UsermodSSDR : public Usermod {
}
/*
- * addToJsonState() can be used to add custom entries to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * addToJsonState() can be used to add custom entries to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
void addToJsonState(JsonObject& root) {
JsonObject user = root[F("u")];
@@ -480,8 +480,8 @@ class UsermodSSDR : public Usermod {
}
/*
- * readFromJsonState() can be used to receive data clients send to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * readFromJsonState() can be used to recibir datos clients enviar to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
void readFromJsonState(JsonObject& root) {
JsonObject user = root[F("u")];
@@ -501,21 +501,21 @@ class UsermodSSDR : public Usermod {
if (mqttDeviceTopic[0] != 0)
{
_updateMQTT();
- //subscribe for sevenseg messages on the device topic
+ //subscribe for sevenseg messages on the dispositivo topic
sprintf_P(subBuffer, PSTR("%s/%S/+/set"), mqttDeviceTopic, _str_name);
mqtt->subscribe(subBuffer, 2);
}
if (mqttGroupTopic[0] != 0)
{
- //subscribe for sevenseg messages on the group topic
+ //subscribe for sevenseg messages on the grupo topic
sprintf_P(subBuffer, PSTR("%s/%S/+/set"), mqttGroupTopic, _str_name);
mqtt->subscribe(subBuffer, 2);
}
}
bool onMqttMessage(char *topic, char *payload) {
- //If topic begins with sevenSeg cut it off, otherwise not our message.
+ //If topic begins with sevenSeg cut it off, otherwise not our mensaje.
size_t topicPrefixLen = strlen_P(PSTR("/wledSS/"));
if (strncmp_P(topic, PSTR("/wledSS/"), topicPrefixLen) == 0) {
topic += topicPrefixLen;
@@ -573,8 +573,8 @@ class UsermodSSDR : public Usermod {
return true;
}
/*
- * getId() allows you to optionally give your V2 usermod an unique ID (please define it in const.h!).
- * This could be used in the future for the system to determine whether your usermod is installed.
+ * getId() allows you to optionally give your V2 usermod an unique ID (please definir it in constante.h!).
+ * This could be used in the futuro for the sistema to determine whether your usermod is installed.
*/
uint16_t getId() {
return USERMOD_ID_SSDR;
diff --git a/usermods/sht/ShtUsermod.h b/usermods/sht/ShtUsermod.h
index 5dd83f46d6..ca119db37d 100644
--- a/usermods/sht/ShtUsermod.h
+++ b/usermods/sht/ShtUsermod.h
@@ -44,7 +44,7 @@ class ShtUsermod : public Usermod
void appendDeviceToMqttDiscoveryMessage(JsonDocument& root);
public:
- // Strings to reduce flash memory usage (used more than twice)
+ // Strings to reduce flash memoria usage (used more than twice)
static const char _name[];
static const char _enabled[];
static const char _shtType[];
diff --git a/usermods/sht/sht.cpp b/usermods/sht/sht.cpp
index e1eb9e885f..b65f814d4d 100644
--- a/usermods/sht/sht.cpp
+++ b/usermods/sht/sht.cpp
@@ -1,7 +1,7 @@
#include "ShtUsermod.h"
#include "SHT85.h"
-// Strings to reduce flash memory usage (used more than twice)
+// Strings to reduce flash memoria usage (used more than twice)
const char ShtUsermod::_name[] PROGMEM = "SHT-Sensor";
const char ShtUsermod::_enabled[] PROGMEM = "Enabled";
const char ShtUsermod::_shtType[] PROGMEM = "SHT-Type";
@@ -11,10 +11,10 @@ const char ShtUsermod::_haMqttDiscovery[] PROGMEM = "Add-To-HA-MQTT-Discovery";
/**
* Initialise SHT sensor.
*
- * Using the correct constructor according to config and initialises it using the
- * global i2c pins.
+ * Usando the correct constructor according to config and initialises it usando the
+ * global I2C pins.
*
- * @return void
+ * @retorno void
*/
void ShtUsermod::initShtTempHumiditySensor()
{
@@ -38,9 +38,9 @@ void ShtUsermod::initShtTempHumiditySensor()
/**
* Cleanup the SHT sensor.
*
- * Properly calls "reset" for the sensor then releases it from memory.
+ * Properly calls "restablecer" for the sensor then releases it from memoria.
*
- * @return void
+ * @retorno void
*/
void ShtUsermod::cleanupShtTempHumiditySensor()
{
@@ -58,7 +58,7 @@ void ShtUsermod::cleanupShtTempHumiditySensor()
* Calls ::cleanupShtTempHumiditySensor() to cleanup the SHT sensor and
* deallocates pins.
*
- * @return void
+ * @retorno void
*/
void ShtUsermod::cleanup()
{
@@ -67,12 +67,12 @@ void ShtUsermod::cleanup()
}
/**
- * Publish temperature and humidity to WLED device topic.
+ * Publish temperature and humidity to WLED dispositivo topic.
*
- * Will add a "/temperature" and "/humidity" topic to the WLED device topic.
+ * Will add a "/temperature" and "/humidity" topic to the WLED dispositivo topic.
* Temperature will be written in configured unit.
*
- * @return void
+ * @retorno void
*/
void ShtUsermod::publishTemperatureAndHumidityViaMqtt() {
if (!WLED_MQTT_CONNECTED) return;
@@ -85,13 +85,13 @@ void ShtUsermod::publishTemperatureAndHumidityViaMqtt() {
}
/**
- * If enabled, publishes HA MQTT device discovery topics.
+ * If enabled, publishes HA MQTT dispositivo discovery topics.
*
* Will make Home Assistant add temperature and humidity as entities automatically.
*
* Note: Whenever usermods are part of the WLED integration in HA, this can be dropped.
*
- * @return void
+ * @retorno void
*/
void ShtUsermod::publishHomeAssistantAutodiscovery() {
if (!WLED_MQTT_CONNECTED) return;
@@ -134,9 +134,9 @@ void ShtUsermod::publishHomeAssistantAutodiscovery() {
}
/**
- * Helper to add device information to MQTT discovery topic.
+ * Helper to add dispositivo information to MQTT discovery topic.
*
- * @return void
+ * @retorno void
*/
void ShtUsermod::appendDeviceToMqttDiscoveryMessage(JsonDocument& root) {
JsonObject device = root.createNestedObject(F("dev"));
@@ -148,20 +148,20 @@ void ShtUsermod::appendDeviceToMqttDiscoveryMessage(JsonDocument& root) {
}
/**
- * Setup the mod.
+ * Configuración the mod.
*
- * Allocates i2c pins as PinOwner::HW_I2C, so they can be allocated multiple times.
+ * Allocates I2C pins as PinOwner::HW_I2C, so they can be allocated multiple times.
* And calls ::initShtTempHumiditySensor() to initialise the sensor.
*
- * @see Usermod::setup()
- * @see UsermodManager::setup()
+ * @see Usermod::configuración()
+ * @see UsermodManager::configuración()
*
- * @return void
+ * @retorno void
*/
void ShtUsermod::setup()
{
if (enabled) {
- // GPIOs can be set to -1 , so check they're gt zero
+ // GPIOs can be set to -1 , so verificar they're gt zero
if (i2c_sda < 0 || i2c_scl < 0) {
DEBUG_PRINTF("[%s] I2C bus not initialised!\n", _name);
cleanup();
@@ -177,17 +177,17 @@ void ShtUsermod::setup()
}
/**
- * Actually reading data (async) from the sensor every 30 seconds.
+ * Actually reading datos (asíncrono) from the sensor every 30 seconds.
*
- * If last reading is at least 30 seconds, it will trigger a reading using
- * SHT::requestData(). We will then continiously check SHT::dataReady() if
- * data is ready to be read. If so, it's read, stored locally and published
+ * If last reading is at least 30 seconds, it will disparador a reading usando
+ * SHT::requestData(). We will then continiously verificar SHT::dataReady() if
+ * datos is ready to be leer. If so, it's leer, stored locally and published
* via MQTT.
*
- * @see Usermod::loop()
- * @see UsermodManager::loop()
+ * @see Usermod::bucle()
+ * @see UsermodManager::bucle()
*
- * @return void
+ * @retorno void
*/
void ShtUsermod::loop()
{
@@ -227,19 +227,19 @@ void ShtUsermod::loop()
* @see Usermod::onMqttConnect()
* @see UsermodManager::onMqttConnect()
*
- * @return void
+ * @retorno void
*/
void ShtUsermod::onMqttConnect(bool sessionPresent) {
if (haMqttDiscovery && !haMqttDiscoveryDone) publishHomeAssistantAutodiscovery();
}
/**
- * Add dropdown for sensor type and unit to UM config page.
+ * Add dropdown for sensor tipo and unit to UM config page.
*
* @see Usermod::appendConfigData()
* @see UsermodManager::appendConfigData()
*
- * @return void
+ * @retorno void
*/
void ShtUsermod::appendConfigData() {
oappend(F("dd=addDropdown('"));
@@ -261,12 +261,12 @@ void ShtUsermod::appendConfigData() {
}
/**
- * Add config data to be stored in cfg.json.
+ * Add config datos to be stored in cfg.JSON.
*
* @see Usermod::addToConfig()
* @see UsermodManager::addToConfig()
*
- * @return void
+ * @retorno void
*/
void ShtUsermod::addToConfig(JsonObject &root)
{
@@ -279,16 +279,16 @@ void ShtUsermod::addToConfig(JsonObject &root)
}
/**
- * Apply config on boot or save of UM config page.
+ * Apply config on boot or guardar of UM config page.
*
- * This is called whenever WLED boots and loads cfg.json, or when the UM config
- * page is saved. Will properly re-instantiate the SHT class upon type change and
+ * This is called whenever WLED boots and loads cfg.JSON, or when the UM config
+ * page is saved. Will properly re-instantiate the SHT clase upon tipo change and
* publish HA discovery after enabling.
*
* @see Usermod::readFromConfig()
* @see UsermodManager::readFromConfig()
*
- * @return bool
+ * @retorno bool
*/
bool ShtUsermod::readFromConfig(JsonObject &root)
{
@@ -308,16 +308,16 @@ bool ShtUsermod::readFromConfig(JsonObject &root)
getJsonValue(top[FPSTR(_unitOfTemp)], unitOfTemp);
getJsonValue(top[FPSTR(_haMqttDiscovery)], haMqttDiscovery);
- // First run: reading from cfg.json, nothing to do here, will be all done in setup()
+ // First run: reading from cfg.JSON, nothing to do here, will be all done in configuración()
if (!firstRunDone) {
DEBUG_PRINTF("[%s] First run, nothing to do\n", _name);
}
- // Check if mod has been en-/disabled
+ // Verificar if mod has been en-/disabled
else if (enabled != oldEnabled) {
enabled ? setup() : cleanup();
DEBUG_PRINTF("[%s] Usermod has been en-/disabled\n", _name);
}
- // Config has been changed, so adopt to changes
+ // Configuración has been changed, so adopt to changes
else if (enabled) {
if (oldShtType != shtType) {
cleanupShtTempHumiditySensor();
@@ -340,14 +340,14 @@ bool ShtUsermod::readFromConfig(JsonObject &root)
}
/**
- * Adds the temperature and humidity actually to the info section and /json info.
+ * Adds the temperature and humidity actually to the información section and /JSON información.
*
- * This is called every time the info section is opened ot /json is called.
+ * This is called every time the información section is opened ot /JSON is called.
*
* @see Usermod::addToJsonInfo()
* @see UsermodManager::addToJsonInfo()
*
- * @return void
+ * @retorno void
*/
void ShtUsermod::addToJsonInfo(JsonObject& root)
{
@@ -394,18 +394,18 @@ void ShtUsermod::addToJsonInfo(JsonObject& root)
}
/**
- * Getter for last read temperature for configured unit.
+ * Getter for last leer temperature for configured unit.
*
- * @return float
+ * @retorno flotante
*/
float ShtUsermod::getTemperature() {
return unitOfTemp ? getTemperatureF() : getTemperatureC();
}
/**
- * Returns the current configured unit as human readable string.
+ * Returns the current configured unit as human readable cadena.
*
- * @return const char*
+ * @retorno constante char*
*/
const char* ShtUsermod::getUnitString() {
return unitOfTemp ? "°F" : "°C";
diff --git a/usermods/smartnest/smartnest.cpp b/usermods/smartnest/smartnest.cpp
index d0cb92dcfd..98ec52b4c5 100644
--- a/usermods/smartnest/smartnest.cpp
+++ b/usermods/smartnest/smartnest.cpp
@@ -62,7 +62,7 @@ class Smartnest : public Usermod
char *token = NULL;
int position = 0;
- // We need to copy the string in order to keep it read only as strtok_r function requires mutable string
+ // We need to copy the cadena in order to keep it leer only as strtok_r función requires mutable cadena
color_ = (char *)malloc(strlen(color) + 1);
if (NULL == color_) {
return -1;
@@ -85,8 +85,8 @@ class Smartnest : public Usermod
// Functions called by WLED
/**
- * handling of MQTT message
- * topic should look like: ///
+ * Manejo de mensajes MQTT
+ * El topic debería tener la forma: ///
*/
bool onMqttMessage(char *topic, char *message)
{
@@ -126,7 +126,7 @@ class Smartnest : public Usermod
if (subtopic == "color")
{
- // Parse the message which is in the format "rgb(<0-255>,<0-255>,<0-255>)"
+ // Analizar the mensaje which is in the formato "rgb(<0-255>,<0-255>,<0-255>)"
int rgb[3] = {};
String colors = message_.substring(String("rgb(").length(), message_.lastIndexOf(')'));
if (3 != splitColor(colors.c_str(), rgb))
@@ -141,7 +141,7 @@ class Smartnest : public Usermod
}
/**
- * subscribe to MQTT topic and send publish current status.
+ * Suscribirse a topics MQTT y publicar el estado actual.
*/
void onMqttConnect(bool sessionPresent)
{
@@ -163,8 +163,8 @@ class Smartnest : public Usermod
}
/**
- * getId() allows you to optionally give your V2 usermod an unique ID (please define it in const.h!).
- * This could be used in the future for the system to determine whether your usermod is installed.
+ * `getId()` permite asignar opcionalmente un ID único a este usermod V2 (defínelo en `constante.h`).
+ * Esto puede usarse para que el sistema determine si el usermod está instalado.
*/
uint16_t getId()
{
@@ -172,30 +172,30 @@ class Smartnest : public Usermod
}
/**
- * setup() is called once at startup to initialize the usermod.
+ * `configuración()` se llama una vez en el arranque para inicializar el usermod.
*/
void setup() {
DEBUG_PRINTF("Smartnest usermod setup initializing...");
- // Publish initial status
+ // Publish initial estado
sendToBroker("report/status", "Smartnest usermod initialized");
}
/**
- * loop() is called continuously to keep the usermod running.
+ * `bucle()` se llama de forma continua para mantener el usermod en ejecución.
*/
void loop() {
- // Periodically report status to MQTT broker
+ // Periodically report estado to MQTT broker
unsigned long currentMillis = millis();
if (currentMillis - lastMqttReport >= mqttReportInterval) {
lastMqttReport = currentMillis;
- // Report current brightness
+ // Report current brillo
char brightnessMsg[11];
sprintf(brightnessMsg, "%u", bri);
sendToBroker("report/brightness", brightnessMsg);
- // Report current signal strength
+ // Report current señal strength
String signal(WiFi.RSSI(), 10);
sendToBroker("report/signal", signal.c_str());
}
diff --git a/usermods/stairway_wipe_basic/stairway_wipe_basic.cpp b/usermods/stairway_wipe_basic/stairway_wipe_basic.cpp
index cddd655d6d..82ed86600c 100644
--- a/usermods/stairway_wipe_basic/stairway_wipe_basic.cpp
+++ b/usermods/stairway_wipe_basic/stairway_wipe_basic.cpp
@@ -2,26 +2,26 @@
/*
* Usermods allow you to add own functionality to WLED more easily
- * See: https://github.com/wled-dev/WLED/wiki/Add-own-functionality
+ * See: https://github.com/WLED-dev/WLED/wiki/Add-own-functionality
*
* This is Stairway-Wipe as a v2 usermod.
*
- * Using this usermod:
- * 1. Copy the usermod into the sketch folder (same folder as wled00.ino)
- * 2. Register the usermod by adding #include "stairway-wipe-usermod-v2.h" in the top and registerUsermod(new StairwayWipeUsermod()) in the bottom of usermods_list.cpp
+ * Usando this usermod:
+ * 1. Copy the usermod into the sketch carpeta (same carpeta as wled00.ino)
+ * 2. Register the usermod by adding #incluir "stairway-wipe-usermod-v2.h" in the top and registerUsermod(new StairwayWipeUsermod()) in the bottom of usermods_list.cpp
*/
class StairwayWipeUsermod : public Usermod {
private:
- //Private class members. You can declare variables and functions only accessible to your usermod here
+ //Privado clase members. You can declare variables and functions only accessible to your usermod here
unsigned long lastTime = 0;
byte wipeState = 0; //0: inactive 1: wiping 2: solid
unsigned long timeStaticStart = 0;
uint16_t previousUserVar0 = 0;
//moved to buildflag
-//comment this out if you want the turn off effect to be just fading out instead of reverse wipe
-//#define STAIRCASE_WIPE_OFF
+//comment this out if you want the turn off efecto to be just fading out instead of reverse wipe
+//#definir STAIRCASE_WIPE_OFF
public:
void setup() {
}
@@ -29,7 +29,7 @@ void setup() {
//userVar0 (U0 in HTTP API):
//has to be set to 1 if movement is detected on the PIR that is the same side of the staircase as the ESP8266
//has to be set to 2 if movement is detected on the PIR that is the opposite side
- //can be set to 0 if no movement is detected. Otherwise LEDs will turn off after a configurable timeout (userVar1 seconds)
+ //can be set to 0 if no movement is detected. Otherwise LEDs will turn off after a configurable tiempo de espera (userVar1 seconds)
if (userVar0 > 0)
{
@@ -81,7 +81,7 @@ void setup() {
void readFromJsonState(JsonObject& root)
{
userVar0 = root["user0"] | userVar0; //if "user0" key exists in JSON, update, else keep old value
- //if (root["bri"] == 255) Serial.println(F("Don't burn down your garage!"));
+ //if (root["bri"] == 255) Serie.println(F("Don't burn down your garage!"));
}
uint16_t getId()
@@ -123,8 +123,8 @@ void setup() {
- //More methods can be added in the future, this example will then be extended.
- //Your usermod will remain compatible as it does not need to implement all methods from the Usermod base class!
+ //More methods can be added in the futuro, this example will then be extended.
+ //Your usermod will remain compatible as it does not need to implement all methods from the Usermod base clase!
};
diff --git a/usermods/udp_name_sync/udp_name_sync.cpp b/usermods/udp_name_sync/udp_name_sync.cpp
index b31b856983..1df3a80844 100644
--- a/usermods/udp_name_sync/udp_name_sync.cpp
+++ b/usermods/udp_name_sync/udp_name_sync.cpp
@@ -12,17 +12,17 @@ class UdpNameSync : public Usermod {
public:
/**
- * Enable/Disable the usermod
+ * Habilitar/Deshabilitar the usermod
*/
inline void enable(bool value) { enabled = value; }
/**
- * Get usermod enabled/disabled state
+ * Get usermod enabled/disabled estado
*/
inline bool isEnabled() const { return enabled; }
void setup() override {
- // Enabled when this usermod is compiled, set to false if you prefer runtime opt-in
+ // Enabled when this usermod is compiled, set to falso if you prefer runtime opt-in
enable(true);
}
diff --git a/usermods/user_fx/README.md b/usermods/user_fx/README.md
index 704b71df01..5eac1f3994 100644
--- a/usermods/user_fx/README.md
+++ b/usermods/user_fx/README.md
@@ -174,7 +174,7 @@ if ((strip.now - SEGENV.step) >= refresh_ms) {
Now we get to the spark generation portion, where new bursts of heat appear at the bottom of the matrix:
```cpp
if (hw_random8() > turbulence) {
- // create new sparks at bottom row
+ // crear new sparks at bottom row
for (unsigned x = 0; x < cols; x++) {
uint8_t p = hw_random8();
if (p < spark_rate) {
@@ -409,17 +409,17 @@ Notice that there are three different modes that we can define from the single e
uint16_t mode_sinelon(void) {
return sinelon_base(false);
}
-// Calls sinelon_base with dual = false and rainbow = false
+// Calls sinelon_base with dual = falso and rainbow = falso
uint16_t mode_sinelon_dual(void) {
return sinelon_base(true);
}
-// Calls sinelon_base with dual = true and rainbow = false
+// Calls sinelon_base with dual = verdadero and rainbow = falso
uint16_t mode_sinelon_rainbow(void) {
return sinelon_base(false, true);
}
-// Calls sinelon_base with dual = false and rainbow = true
+// Calls sinelon_base with dual = falso and rainbow = verdadero
```
And then the last part defines the metadata strings for each effect to specify how it will be portrayed in the UI:
@@ -442,14 +442,14 @@ class UserFxUsermod : public Usermod {
strip.addEffect(255, &mode_diffusionfire, _data_FX_MODE_DIFFUSIONFIRE);
////////////////////////////////////////
- // add your effect function(s) here //
+ // add your efecto función(s) here //
////////////////////////////////////////
- // use id=255 for all custom user FX (the final id is assigned when adding the effect)
+ // use id=255 for all custom usuario FX (the final id is assigned when adding the efecto)
- // strip.addEffect(255, &mode_your_effect, _data_FX_MODE_YOUR_EFFECT);
- // strip.addEffect(255, &mode_your_effect2, _data_FX_MODE_YOUR_EFFECT2);
- // strip.addEffect(255, &mode_your_effect3, _data_FX_MODE_YOUR_EFFECT3);
+ // tira.addEffect(255, &mode_your_effect, _data_FX_MODE_YOUR_EFFECT);
+ // tira.addEffect(255, &mode_your_effect2, _data_FX_MODE_YOUR_EFFECT2);
+ // tira.addEffect(255, &mode_your_effect3, _data_FX_MODE_YOUR_EFFECT3);
}
void loop() override {} // nothing to do in the loop
uint16_t getId() override { return USERMOD_ID_USER_FX; }
diff --git a/usermods/user_fx/user_fx.cpp b/usermods/user_fx/user_fx.cpp
index da6937c87d..e719ba3d0f 100644
--- a/usermods/user_fx/user_fx.cpp
+++ b/usermods/user_fx/user_fx.cpp
@@ -1,18 +1,18 @@
#include "wled.h"
-// for information how FX metadata strings work see https://kno.wled.ge/interfaces/json-api/#effect-metadata
+// for information how FX metadata strings work see https://kno.WLED.ge/interfaces/JSON-API/#efecto-metadata
-// static effect, used if an effect fails to initialize
+// estático efecto, used if an efecto fails to inicializar
static uint16_t mode_static(void) {
SEGMENT.fill(SEGCOLOR(0));
return strip.isOffRefreshRequired() ? FRAMETIME : 350;
}
/////////////////////////
-// User FX functions //
+// Usuario FX functions //
/////////////////////////
-// Diffusion Fire: fire effect intended for 2D setups smaller than 16x16
+// Diffusion Fire: fire efecto intended for 2D setups smaller than 16x16
static uint16_t mode_diffusionfire(void) {
if (!strip.isMatrix || !SEGMENT.is2D())
return mode_static(); // not a 2D set-up
@@ -37,7 +37,7 @@ unsigned dataSize = cols * rows; // SEGLEN (virtual length) is equivalent to vW
}
if ((strip.now - SEGENV.step) >= refresh_ms) {
- // Keep for ≤~1 KiB; otherwise consider heap or reuse SEGENV.data as scratch.
+ // Keep for ≤~1 KiB; otherwise consider montón or reuse SEGENV.datos as scratch.
uint8_t tmp_row[cols];
SEGENV.step = strip.now;
// scroll up
@@ -49,7 +49,7 @@ unsigned dataSize = cols * rows; // SEGLEN (virtual length) is equivalent to vW
}
if (hw_random8() > turbulence) {
- // create new sparks at bottom row
+ // crear new sparks at bottom row
for (unsigned x = 0; x < cols; x++) {
uint8_t p = hw_random8();
if (p < spark_rate) {
@@ -90,7 +90,7 @@ static const char _data_FX_MODE_DIFFUSIONFIRE[] PROGMEM = "Diffusion Fire@!,Spar
/////////////////////
-// UserMod Class //
+// Usermod Clase //
/////////////////////
class UserFxUsermod : public Usermod {
@@ -100,14 +100,14 @@ class UserFxUsermod : public Usermod {
strip.addEffect(255, &mode_diffusionfire, _data_FX_MODE_DIFFUSIONFIRE);
////////////////////////////////////////
- // add your effect function(s) here //
+ // add your efecto función(s) here //
////////////////////////////////////////
- // use id=255 for all custom user FX (the final id is assigned when adding the effect)
+ // use id=255 for all custom usuario FX (the final id is assigned when adding the efecto)
- // strip.addEffect(255, &mode_your_effect, _data_FX_MODE_YOUR_EFFECT);
- // strip.addEffect(255, &mode_your_effect2, _data_FX_MODE_YOUR_EFFECT2);
- // strip.addEffect(255, &mode_your_effect3, _data_FX_MODE_YOUR_EFFECT3);
+ // tira.addEffect(255, &mode_your_effect, _data_FX_MODE_YOUR_EFFECT);
+ // tira.addEffect(255, &mode_your_effect2, _data_FX_MODE_YOUR_EFFECT2);
+ // tira.addEffect(255, &mode_your_effect3, _data_FX_MODE_YOUR_EFFECT3);
}
void loop() override {} // nothing to do in the loop
uint16_t getId() override { return USERMOD_ID_USER_FX; }
diff --git a/usermods/usermod_rotary_brightness_color/usermod_rotary_brightness_color.cpp b/usermods/usermod_rotary_brightness_color/usermod_rotary_brightness_color.cpp
index 0a485152f1..b9dc3e1831 100644
--- a/usermods/usermod_rotary_brightness_color/usermod_rotary_brightness_color.cpp
+++ b/usermods/usermod_rotary_brightness_color/usermod_rotary_brightness_color.cpp
@@ -1,11 +1,11 @@
#include "wled.h"
-//v2 usermod that allows to change brightness and color using a rotary encoder,
+//v2 usermod that allows to change brillo and color usando a rotary encoder,
//change between modes by pressing a button (many encoders have one included)
class RotaryEncoderBrightnessColor : public Usermod
{
private:
- //Private class members. You can declare variables and functions only accessible to your usermod here
+ //Privado clase members. You can declare variables and functions only accessible to your usermod here
unsigned long lastTime = 0;
unsigned long currentTime;
unsigned long loopTime;
@@ -21,7 +21,7 @@ class RotaryEncoderBrightnessColor : public Usermod
unsigned char Enc_B;
unsigned char Enc_A_prev = 0;
- // private class members configurable by Usermod Settings (defaults set inside readFromConfig())
+ // private clase members configurable by Usermod Settings (defaults set inside readFromConfig())
int8_t pins[3]; // pins[0] = DT from encoder, pins[1] = CLK from encoder, pins[2] = CLK from encoder (optional)
int fadeAmount; // how many points to fade the Neopixel with each step
@@ -29,12 +29,12 @@ class RotaryEncoderBrightnessColor : public Usermod
//Functions called by WLED
/*
- * setup() is called once at boot. WiFi is not yet connected at this point.
- * You can use it to initialize variables, sensors or similar.
+ * `configuración()` se llama una vez al arrancar. En este punto WiFi aún no está conectado.
+ * Úsalo para inicializar variables, sensores o similares.
*/
void setup()
{
- //Serial.println("Hello from my usermod!");
+ //Serie.println("Hello from my usermod!");
pinMode(pins[0], INPUT_PULLUP);
pinMode(pins[1], INPUT_PULLUP);
if(pins[2] >= 0) pinMode(pins[2], INPUT_PULLUP);
@@ -43,14 +43,14 @@ class RotaryEncoderBrightnessColor : public Usermod
}
/*
- * loop() is called continuously. Here you can check for events, read sensors, etc.
- *
- * Tips:
- * 1. You can use "if (WLED_CONNECTED)" to check for a successful network connection.
- * Additionally, "if (WLED_MQTT_CONNECTED)" is available to check for a connection to an MQTT broker.
- *
- * 2. Try to avoid using the delay() function. NEVER use delays longer than 10 milliseconds.
- * Instead, use a timer check as shown here.
+ * `bucle()` se llama de forma continua. Aquí puedes comprobar eventos, leer sensores, etc.
+ *
+ * Consejos:
+ * 1. Puedes usar "if (WLED_CONNECTED)" para comprobar una conexión de red.
+ * Adicionalmente, "if (WLED_MQTT_CONNECTED)" permite comprobar la conexión al broker MQTT.
+ *
+ * 2. Evita usar `retraso()`; NUNCA uses delays mayores a 10 ms.
+ * En su lugar usa comprobaciones temporizadas como en este ejemplo.
*/
void loop()
{
@@ -155,20 +155,20 @@ class RotaryEncoderBrightnessColor : public Usermod
}
/*
- * This example uses a more robust method of checking for missing values in the config, and setting back to defaults:
- * - The getJsonValue() function copies the value to the variable only if the key requested is present, returning false with no copy if the value isn't present
- * - configComplete is used to return false if any value is missing, not just if the main object is missing
+ * This example uses a more robust método of checking for missing values in the config, and setting back to defaults:
+ * - The getJsonValue() función copies the valor to the variable only if the key requested is present, returning falso with no copy if the valor isn't present
+ * - configComplete is used to retorno falso if any valor is missing, not just if the principal object is missing
* - The defaults are loaded every time readFromConfig() is run, not just once after boot
*
* This ensures that missing values are added to the config, with their default values, in the rare but plausible cases of:
- * - a single value being missing at boot, e.g. if the Usermod was upgraded and a new setting was added
- * - a single value being missing after boot (e.g. if the cfg.json was manually edited and a value was removed)
+ * - a single valor being missing at boot, e.g. if the Usermod was upgraded and a new setting was added
+ * - a single valor being missing after boot (e.g. if the cfg.JSON was manually edited and a valor was removed)
*
- * If configComplete is false, the default values are already set, and by returning false, WLED now knows it needs to save the defaults by calling addToConfig()
+ * If configComplete is falso, the default values are already set, and by returning falso, WLED now knows it needs to guardar the defaults by calling addToConfig()
*/
bool readFromConfig(JsonObject& root)
{
- // set defaults here, they will be set before setup() is called, and if any values parsed from ArduinoJson below are missing, the default will be used instead
+ // set defaults here, they will be set before configuración() is called, and if any values parsed from ArduinoJson below are missing, the default will be used instead
fadeAmount = 5;
pins[0] = -1;
pins[1] = -1;
diff --git a/usermods/usermod_v2_HttpPullLightControl/usermod_v2_HttpPullLightControl.cpp b/usermods/usermod_v2_HttpPullLightControl/usermod_v2_HttpPullLightControl.cpp
index 44a2726ed6..3c9e8e3fa6 100644
--- a/usermods/usermod_v2_HttpPullLightControl/usermod_v2_HttpPullLightControl.cpp
+++ b/usermods/usermod_v2_HttpPullLightControl/usermod_v2_HttpPullLightControl.cpp
@@ -1,6 +1,6 @@
#include "usermod_v2_HttpPullLightControl.h"
-// add more strings here to reduce flash memory usage
+// add more strings here to reduce flash memoria usage
const char HttpPullLightControl::_name[] PROGMEM = "HttpPullLightControl";
const char HttpPullLightControl::_enabled[] PROGMEM = "Enable";
@@ -8,13 +8,13 @@ static HttpPullLightControl http_pull_usermod;
REGISTER_USERMOD(http_pull_usermod);
void HttpPullLightControl::setup() {
- //Serial.begin(115200);
+ //Serie.begin(115200);
- // Print version number
+ // Imprimir versión number
DEBUG_PRINT(F("HttpPullLightControl version: "));
DEBUG_PRINTLN(HTTP_PULL_LIGHT_CONTROL_VERSION);
- // Start a nice chase so we know its booting and searching for its first http pull.
+ // Iniciar a nice chase so we know its booting and searching for its first HTTP extraer.
DEBUG_PRINTLN(F("Starting a nice chase so we now it is booting."));
Segment& seg = strip.getMainSegment();
seg.setMode(28); // Set to chase
@@ -33,8 +33,8 @@ void HttpPullLightControl::setup() {
DEBUG_PRINTLN(F("HttpPullLightControl successfully setup"));
}
-// This is the main loop function, from here we check the URL and handle the response.
-// Effects or individual lights are set as a result from this.
+// This is the principal bucle función, from here we verificar the URL and handle the respuesta.
+// Effects or individual lights are set as a resultado from this.
void HttpPullLightControl::loop() {
if (!enabled || offMode) return; // Do nothing when not enabled or powered off
if (millis() - lastCheck >= checkInterval * 1000) {
@@ -51,7 +51,7 @@ String HttpPullLightControl::generateUniqueId() {
WiFi.macAddress(mac);
char macStr[18];
sprintf(macStr, "%02x:%02x:%02x:%02x:%02x:%02x", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
- // Set the MAC Address to a string and make it UPPERcase
+ // Set the MAC Address to a cadena and make it UPPERcase
String macString = String(macStr);
macString.toUpperCase();
DEBUG_PRINT(F("WiFi MAC address is: "));
@@ -61,12 +61,12 @@ String HttpPullLightControl::generateUniqueId() {
String input = macString + salt;
#ifdef ESP8266
- // For ESP8266 we use the Hash.h library which is built into the ESP8266 Core
+ // For ESP8266 we use the Hash.h biblioteca which is built into the ESP8266 Core
return sha1(input);
#endif
#ifdef ESP32
- // For ESP32 we use the mbedtls library which is built into the ESP32 core
+ // For ESP32 we use the mbedtls biblioteca which is built into the ESP32 core
int status = 0;
unsigned char shaResult[20]; // SHA1 produces a hash of 20 bytes (which is 40 HEX characters)
mbedtls_sha1_context ctx;
@@ -85,7 +85,7 @@ String HttpPullLightControl::generateUniqueId() {
}
mbedtls_sha1_free(&ctx);
- // Convert the Hash to a hexadecimal string
+ // Convertir the Hash to a hexadecimal cadena
char buf[41];
for (int i = 0; i < 20; i++) {
sprintf(&buf[i*2], "%02x", shaResult[i]);
@@ -94,7 +94,7 @@ String HttpPullLightControl::generateUniqueId() {
#endif
}
-// This function is called when the user updates the Sald and so we need to re-calculate the unique ID
+// This función is called when the usuario updates the Sald and so we need to re-calculate the unique ID
void HttpPullLightControl::updateSalt(String newSalt) {
DEBUG_PRINTLN(F("Salt updated"));
this->salt = newSalt;
@@ -103,20 +103,20 @@ void HttpPullLightControl::updateSalt(String newSalt) {
DEBUG_PRINTLN(uniqueId);
}
-// The function is used to separate the URL in a host part and a path part
+// The función is used to separate the URL in a host part and a ruta part
void HttpPullLightControl::parseUrl() {
int firstSlash = url.indexOf('/', 7); // Skip http(s)://
host = url.substring(7, firstSlash);
path = url.substring(firstSlash);
}
-// This function is called by WLED when the USERMOD config is read
+// This función is called by WLED when the USERMOD config is leer
bool HttpPullLightControl::readFromConfig(JsonObject& root) {
// Attempt to retrieve the nested object for this usermod
JsonObject top = root[FPSTR(_name)];
bool configComplete = !top.isNull(); // check if the object exists
- // Retrieve the values using the getJsonValue function for better error handling
+ // Retrieve the values usando the getJsonValue función for better error handling
configComplete &= getJsonValue(top[FPSTR(_enabled)], enabled, enabled); // default value=enabled
configComplete &= getJsonValue(top["checkInterval"], checkInterval, checkInterval); // default value=60
#ifndef HTTP_PULL_LIGHT_CONTROL_HIDE_URL
@@ -129,15 +129,15 @@ bool HttpPullLightControl::readFromConfig(JsonObject& root) {
return configComplete;
}
-// This function is called by WLED when the USERMOD config is saved in the frontend
+// This función is called by WLED when the USERMOD config is saved in the frontend
void HttpPullLightControl::addToConfig(JsonObject& root) {
- // Create a nested object for this usermod
+ // Crear a nested object for this usermod
JsonObject top = root.createNestedObject(FPSTR(_name));
- // Write the configuration parameters to the nested object
+ // Escribir the configuration parameters to the nested object
top[FPSTR(_enabled)] = enabled;
if (enabled==false)
- // To make it a bit more user-friendly, we unfreeze the main segment after disabling the module. Because individual light control (like for a christmas card) might have been done.
+ // To make it a bit more usuario-friendly, we unfreeze the principal segmento after disabling the módulo. Because individual light control (like for a christmas card) might have been done.
strip.getMainSegment().freeze=false;
top["checkInterval"] = checkInterval;
#ifndef HTTP_PULL_LIGHT_CONTROL_HIDE_URL
@@ -150,10 +150,10 @@ void HttpPullLightControl::addToConfig(JsonObject& root) {
parseUrl(); // Re-parse the URL, maybe path and host is changed
}
-// Do the http request here. Note that we can not do https requests with the AsyncTCP library
-// We do everything Asynchronous, so all callbacks are defined here
+// Do the HTTP solicitud here. Note that we can not do https requests with the AsyncTCP biblioteca
+// We do everything Asíncrono, so all callbacks are defined here
void HttpPullLightControl::checkUrl() {
- // Extra Inactivity check to see if AsyncCLient hangs
+ // Extra Inactivity verificar to see if AsyncCLient hangs
if (client != nullptr && ( millis() - lastActivityTime > inactivityTimeout ) ) {
DEBUG_PRINTLN(F("Inactivity detected, deleting client."));
delete client;
@@ -161,12 +161,12 @@ void HttpPullLightControl::checkUrl() {
}
if (client != nullptr && client->connected()) {
DEBUG_PRINTLN(F("We are still connected, do nothing"));
- // Do nothing, Client is still connected
+ // Do nothing, Cliente is still connected
return;
}
if (client != nullptr) {
- // Delete previous client instance if exists, just to prevent any memory leaks
+ // Eliminar previous cliente instancia if exists, just to prevent any memoria leaks
DEBUG_PRINTLN(F("Delete previous instances"));
delete client;
client = nullptr;
@@ -177,23 +177,23 @@ void HttpPullLightControl::checkUrl() {
if(client) {
client->onData([](void *arg, AsyncClient *c, void *data, size_t len) {
DEBUG_PRINTLN(F("Data received."));
- // Cast arg back to the usermod class instance
+ // Conversión arg back to the usermod clase instancia
HttpPullLightControl *instance = (HttpPullLightControl *)arg;
instance->lastActivityTime = millis(); // Update lastactivity time when data is received
- // Convertert to Safe-String
+ // Convertert to Safe-Cadena
char *strData = new char[len + 1];
strncpy(strData, (char*)data, len);
strData[len] = '\0';
String responseData = String(strData);
- //String responseData = String((char *)data);
- // Make sure its zero-terminated String
+ //Cadena responseData = Cadena((char *)datos);
+ // Make sure its zero-terminated Cadena
//responseData[len] = '\0';
delete[] strData; // Do not forget to remove this one
instance->handleResponse(responseData);
}, this);
client->onDisconnect([](void *arg, AsyncClient *c) {
DEBUG_PRINTLN(F("Disconnected."));
- //Set the class-own client pointer to nullptr if its the current client
+ //Set the clase-own cliente pointer to nullptr if its the current cliente
HttpPullLightControl *instance = static_cast(arg);
if (instance->client == c) {
delete instance->client; // Delete the client instance
@@ -202,7 +202,7 @@ void HttpPullLightControl::checkUrl() {
}, this);
client->onTimeout([](void *arg, AsyncClient *c, uint32_t time) {
DEBUG_PRINTLN(F("Timeout"));
- //Set the class-own client pointer to nullptr if its the current client
+ //Set the clase-own cliente pointer to nullptr if its the current cliente
HttpPullLightControl *instance = static_cast(arg);
if (instance->client == c) {
delete instance->client; // Delete the client instance
@@ -213,16 +213,16 @@ void HttpPullLightControl::checkUrl() {
DEBUG_PRINTLN("Connection error occurred!");
DEBUG_PRINT("Error code: ");
DEBUG_PRINTLN(error);
- //Set the class-own client pointer to nullptr if its the current client
+ //Set the clase-own cliente pointer to nullptr if its the current cliente
HttpPullLightControl *instance = static_cast(arg);
if (instance->client == c) {
delete instance->client;
instance->client = nullptr;
}
- // Do not remove client here, it is maintained by AsyncClient
+ // Do not eliminar cliente here, it is maintained by AsyncClient
}, this);
client->onConnect([](void *arg, AsyncClient *c) {
- // Cast arg back to the usermod class instance
+ // Conversión arg back to the usermod clase instancia
HttpPullLightControl *instance = (HttpPullLightControl *)arg;
instance->onClientConnect(c); // Call a method on the instance when the client connects
}, this);
@@ -232,16 +232,16 @@ void HttpPullLightControl::checkUrl() {
DEBUG_PRINT(host);
DEBUG_PRINT(F(" via port "));
DEBUG_PRINTLN((url.startsWith("https")) ? 443 : 80);
- // Update lastActivityTime just before sending the request
+ // Actualizar lastActivityTime just before sending the solicitud
lastActivityTime = millis();
- //Try to connect
+ //Intentar to conectar
if (!client->connect(host.c_str(), (url.startsWith("https")) ? 443 : 80)) {
DEBUG_PRINTLN(F("Failed to initiate connection."));
- // Connection failed, so cleanup
+ // Conexión failed, so cleanup
delete client;
client = nullptr;
} else {
- // Connection successfull, wait for callbacks to go on.
+ // Conexión successfull, wait for callbacks to go on.
DEBUG_PRINTLN(F("Connection initiated, awaiting response..."));
}
} else {
@@ -249,8 +249,8 @@ void HttpPullLightControl::checkUrl() {
}
}
-// This function is called from the checkUrl function when the connection is establised
-// We request the data here
+// This función is called from the checkUrl función when the conexión is establised
+// We solicitud the datos here
void HttpPullLightControl::onClientConnect(AsyncClient *c) {
DEBUG_PRINT(F("Client connected: "));
DEBUG_PRINTLN(c->connected() ? F("Yes") : F("No"));
@@ -265,7 +265,7 @@ void HttpPullLightControl::onClientConnect(AsyncClient *c) {
DEBUG_PRINT(request.c_str());
auto bytesSent = c->write(request.c_str());
if (bytesSent == 0) {
- // Connection could not be made
+ // Conexión could not be made
DEBUG_PRINT(F("Failed to send HTTP request."));
} else {
DEBUG_PRINT(F("Request sent successfully, bytes sent: "));
@@ -275,8 +275,8 @@ void HttpPullLightControl::onClientConnect(AsyncClient *c) {
}
-// This function is called when we receive data after connecting and doing our request
-// It parses the JSON data to WLED
+// This función is called when we recibir datos after connecting and doing our solicitud
+// It parses the JSON datos to WLED
void HttpPullLightControl::handleResponse(String& responseStr) {
DEBUG_PRINTLN(F("Received response for handleResponse."));
@@ -288,7 +288,7 @@ void HttpPullLightControl::handleResponse(String& responseStr) {
return;
}
- // Search for two linebreaks between headers and content
+ // Buscar for two linebreaks between headers and contenido
int bodyPos = responseStr.indexOf("\r\n\r\n");
if (bodyPos > 0) {
String jsonStr = responseStr.substring(bodyPos + 4); // +4 Skip the two CRLFs
@@ -297,17 +297,17 @@ void HttpPullLightControl::handleResponse(String& responseStr) {
DEBUG_PRINTLN("Response: ");
DEBUG_PRINTLN(jsonStr);
- // Check for valid JSON, otherwise we brick the program runtime
+ // Verificar for valid JSON, otherwise we brick the program runtime
if (jsonStr[0] == '{' || jsonStr[0] == '[') {
- // Attempt to deserialize the JSON response
+ // Attempt to deserialize the JSON respuesta
DeserializationError error = deserializeJson(*pDoc, jsonStr);
if (error == DeserializationError::Ok) {
// Get JSON object from th doc
JsonObject obj = pDoc->as();
- // Parse the object throuhg deserializeState (use CALL_MODE_NO_NOTIFY or OR CALL_MODE_DIRECT_CHANGE)
+ // Analizar the object throuhg deserializeState (use CALL_MODE_NO_NOTIFY or OR CALL_MODE_DIRECT_CHANGE)
deserializeState(obj, CALL_MODE_NO_NOTIFY);
} else {
- // If there is an error in deserialization, exit the function
+ // If there is an error in deserialization, salida the función
DEBUG_PRINT(F("DeserializationError: "));
DEBUG_PRINTLN(error.c_str());
}
@@ -317,6 +317,6 @@ void HttpPullLightControl::handleResponse(String& responseStr) {
} else {
DEBUG_PRINTLN(F("No body found in the response"));
}
- // Release the BufferLock again
+ // Lanzamiento the BufferLock again
releaseJSONBufferLock();
}
\ No newline at end of file
diff --git a/usermods/usermod_v2_HttpPullLightControl/usermod_v2_HttpPullLightControl.h b/usermods/usermod_v2_HttpPullLightControl/usermod_v2_HttpPullLightControl.h
index 187b2b0912..01731b19b5 100644
--- a/usermods/usermod_v2_HttpPullLightControl/usermod_v2_HttpPullLightControl.h
+++ b/usermods/usermod_v2_HttpPullLightControl/usermod_v2_HttpPullLightControl.h
@@ -2,24 +2,24 @@
/*
* Usermod: HttpPullLightControl
* Versie: 0.0.4
- * Repository: https://github.com/roelbroersma/WLED-usermodv2_HttpPullLightControl
+ * Repositorio: https://github.com/roelbroersma/WLED-usermodv2_HttpPullLightControl
* Author: Roel Broersma
* Website: https://www.roelbroersma.nl
* Github author: github.com/roelbroersma
- * Description: This usermod for WLED will request a given URL to know which effects
+ * Description: This usermod for WLED will solicitud a given URL to know which effects
* or individual lights it should turn on/off. So you can remote control a WLED
- * installation without having access to it (if no port forward, vpn or public IP is available).
- * Use Case: Create a WLED 'Ring of Thought' christmas card. Sent a LED ring with 60 LEDs to 60 friends.
- * When they turn it on and put it at their WiFi, it will contact your server. Now you can reply with a given
- * number of lights that should turn on. Each light is a friend who did contact your server in the past 5 minutes.
+ * instalación without having acceso to it (if no puerto forward, vpn or public IP is available).
+ * Use Caso: Crear a WLED 'Ring of Thought' christmas card. Sent a LED ring with 60 LEDs to 60 friends.
+ * When they turn it on and put it at their WiFi, it will contact your servidor. Now you can reply with a given
+ * number of lights that should turn on. Each light is a friend who did contact your servidor in the past 5 minutes.
* So on each of your friends LED rings, the number of lights will be the number of friends who have it turned on.
- * Features: It sends a unique ID (has of MAC and salt) to the URL, so you can define each client without a need to map their IP address.
+ * Features: It sends a unique ID (has of MAC and salt) to the URL, so you can definir each cliente without a need to map their IP address.
* Tested: Tested on WLED v0.14 with ESP32-S3 (M5Stack Atom S3 Lite), but should also workd for other ESPs and ESP8266.
*/
#include "wled.h"
-// Use the following for SHA1 computation of our HASH, unfortunatelly PlatformIO doesnt recognize Hash.h while its already in the Core.
+// Use the following for SHA1 computación of our HASH, unfortunatelly PlatformIO doesnt recognize Hash.h while its already in the Core.
// We use Hash.h for ESP8266 (in the core) and mbedtls/sha256.h for ESP32 (in the core).
#ifdef ESP8266
#include
@@ -56,9 +56,9 @@ class HttpPullLightControl : public Usermod {
#else
String salt = "1just_a_very-secret_salt2"; // Salt for generating a unique ID when requesting the URL (in this way you can give different answers based on the WLED device who does the request)
#endif
- // NOTE THAT THERE IS ALSO A #ifdef HTTP_PULL_LIGHT_CONTROL_HIDE_URL and a HTTP_PULL_LIGHT_CONTROL_HIDE_SALT IF YOU DO NOT WANT TO SHOW THE OPTIONS IN THE USERMOD SETTINGS
+ // NOTE THAT THERE IS ALSO A #si está definido HTTP_PULL_LIGHT_CONTROL_HIDE_URL and a HTTP_PULL_LIGHT_CONTROL_HIDE_SALT IF YOU DO NOT WANT TO SHOW THE OPTIONS IN THE USERMOD SETTINGS
- // Define constants
+ // Definir constants
static const uint8_t myLockId = USERMOD_ID_HTTP_PULL_LIGHT_CONTROL ; // Used for the requestJSONBufferLock(id) function
static const int16_t ackTimeout = 9000; // ACK timeout in milliseconds when doing the URL request
static const uint16_t rxTimeout = 9000; // RX timeout in milliseconds when doing the URL request
@@ -89,14 +89,14 @@ class HttpPullLightControl : public Usermod {
inline void enable(bool enable) { enabled = enable; } // Enable or Disable the usermod
inline bool isEnabled() { return enabled; } // Get usermod enabled or disabled state
virtual ~HttpPullLightControl() {
- // Remove the cached client if needed
+ // Eliminar the cached cliente if needed
if (client) {
client->onDisconnect(nullptr);
client->onError(nullptr);
client->onTimeout(nullptr);
client->onData(nullptr);
client->onConnect(nullptr);
- // Now it is safe to delete the client.
+ // Now it is safe to eliminar the cliente.
delete client; // This is safe even if client is nullptr.
client = nullptr;
}
diff --git a/usermods/usermod_v2_RF433/usermod_v2_RF433.cpp b/usermods/usermod_v2_RF433/usermod_v2_RF433.cpp
index 9ac6c416d1..88256a3a69 100644
--- a/usermods/usermod_v2_RF433/usermod_v2_RF433.cpp
+++ b/usermods/usermod_v2_RF433/usermod_v2_RF433.cpp
@@ -34,7 +34,7 @@ class RF433Usermod : public Usermod
/*
* connected() is called every time the WiFi is (re)connected
- * Use it to initialize network interfaces
+ * Use it to inicializar red interfaces
*/
void connected()
{
@@ -50,7 +50,7 @@ class RF433Usermod : public Usermod
unsigned long receivedCommand = mySwitch.getReceivedValue();
mySwitch.resetAvailable();
- // Discard duplicates, limit long press repeat
+ // Discard duplicates, límite long press repeat
if (lastCommand == receivedCommand && millis() - lastTime < 800)
return;
@@ -65,7 +65,7 @@ class RF433Usermod : public Usermod
}
}
- // Add last received button to info pane
+ // Add last received button to información pane
void addToJsonInfo(JsonObject &root)
{
if (!initDone)
@@ -102,7 +102,7 @@ class RF433Usermod : public Usermod
DEBUG_PRINTLN(F("config (re)loaded."));
- // Redo init on update
+ // Redo init on actualizar
if(initDone)
setup();
@@ -110,15 +110,15 @@ class RF433Usermod : public Usermod
}
/*
- * getId() allows you to optionally give your V2 usermod an unique ID (please define it in const.h!).
- * This could be used in the future for the system to determine whether your usermod is installed.
+ * getId() allows you to optionally give your V2 usermod an unique ID (please definir it in constante.h!).
+ * This could be used in the futuro for the sistema to determine whether your usermod is installed.
*/
uint16_t getId()
{
return USERMOD_ID_RF433;
}
- // this function follows the same principle as decodeIRJson() / remoteJson()
+ // this función follows the same principle as decodeIRJson() / remoteJson()
bool remoteJson433(int button)
{
char objKey[14];
@@ -131,7 +131,7 @@ class RF433Usermod : public Usermod
unsigned long start = millis();
while (strip.isUpdating() && millis()-start < RF433_BUSWAIT_TIMEOUT) yield(); // wait for strip to finish updating, accessing FS during sendout causes glitches
- // attempt to read command from remote.json
+ // attempt to leer command from remote.JSON
readObjectFromFile(PSTR("/remote433.json"), objKey, pDoc);
JsonObject fdo = pDoc->as();
if (fdo.isNull()) {
diff --git a/usermods/usermod_v2_animartrix/usermod_v2_animartrix.cpp b/usermods/usermod_v2_animartrix/usermod_v2_animartrix.cpp
index d2968f2fbd..be76008923 100644
--- a/usermods/usermod_v2_animartrix/usermod_v2_animartrix.cpp
+++ b/usermods/usermod_v2_animartrix/usermod_v2_animartrix.cpp
@@ -199,7 +199,7 @@ uint16_t mode_SM8() {
// anim.initEffect();
// anim.SM7();
//
-// return FRAMETIME;
+// retorno FRAMETIME;
// }
uint16_t mode_SM6() {
anim.initEffect();
@@ -387,7 +387,7 @@ class AnimartrixUsermod : public Usermod {
strip.addEffect(255, &mode_SM10, _data_FX_mode_SM10);
strip.addEffect(255, &mode_SM9, _data_FX_mode_SM9);
strip.addEffect(255, &mode_SM8, _data_FX_mode_SM8);
- // strip.addEffect(255, &mode_SM7, _data_FX_mode_SM7);
+ // tira.addEffect(255, &mode_SM7, _data_FX_mode_SM7);
strip.addEffect(255, &mode_SM6, _data_FX_mode_SM6);
strip.addEffect(255, &mode_SM5, _data_FX_mode_SM5);
strip.addEffect(255, &mode_SM4, _data_FX_mode_SM4);
diff --git a/usermods/usermod_v2_auto_save/usermod_v2_auto_save.cpp b/usermods/usermod_v2_auto_save/usermod_v2_auto_save.cpp
index 1b97ea94da..9486244541 100644
--- a/usermods/usermod_v2_auto_save/usermod_v2_auto_save.cpp
+++ b/usermods/usermod_v2_auto_save/usermod_v2_auto_save.cpp
@@ -1,25 +1,25 @@
#include "wled.h"
-// v2 Usermod to automatically save settings
+// v2 Usermod to automatically guardar settings
// to configurable preset after a change to any of
//
-// * brightness
-// * effect speed
-// * effect intensity
-// * mode (effect)
+// * brillo
+// * efecto velocidad
+// * efecto intensidad
+// * mode (efecto)
// * palette
//
// but it will wait for configurable number of seconds, a "settle"
-// period in case there are other changes (any change will
+// período in case there are other changes (any change will
// extend the "settle" window).
//
-// It can be configured to load auto saved preset at startup,
-// during the first `loop()`.
+// It can be configured to carga auto saved preset at startup,
+// during the first `bucle()`.
//
// AutoSaveUsermod is standalone, but if FourLineDisplayUsermod
-// is installed, it will notify the user of the saved changes.
+// is installed, it will notify the usuario of the saved changes.
-// format: "~ MM-DD HH:MM:SS ~"
+// formato: "~ MM-DD HH:MM:SS ~"
#define PRESET_NAME_BUFFER_SIZE 25
class AutoSaveUsermod : public Usermod {
@@ -49,7 +49,7 @@ class AutoSaveUsermod : public Usermod {
bool applyAutoSaveOnBoot = false; // do we load auto-saved preset on boot?
#endif
- // If we've detected the need to auto save, this will be non zero.
+ // If we've detected the need to auto guardar, this will be non zero.
unsigned long autoSaveAfter = 0;
uint8_t knownBrightness = 0;
@@ -62,7 +62,7 @@ class AutoSaveUsermod : public Usermod {
FourLineDisplayUsermod* display;
#endif
- // strings to reduce flash memory usage (used more than twice)
+ // strings to reduce flash memoria usage (used more than twice)
static const char _name[];
static const char _autoSaveEnabled[];
static const char _autoSaveAfterSec[];
@@ -96,7 +96,7 @@ class AutoSaveUsermod : public Usermod {
public:
// gets called once at boot. Do all initialization that doesn't depend on
- // network here
+ // red here
void setup() {
#ifdef USERMOD_FOUR_LINE_DISPLAY
// This Usermod has enhanced functionality if
@@ -112,12 +112,12 @@ class AutoSaveUsermod : public Usermod {
knownPalette = strip.getMainSegment().palette;
}
- // gets called every time WiFi is (re-)connected. Initialize own network
+ // gets called every time WiFi is (re-)connected. Inicializar own red
// interfaces here
void connected() {}
/*
- * Da loop.
+ * Da bucle.
*/
void loop() {
static unsigned long lastRun = 0;
@@ -146,16 +146,16 @@ class AutoSaveUsermod : public Usermod {
if (autoSaveAfter && now > autoSaveAfter) {
autoSaveAfter = 0;
- // Time to auto save. You may have some flickery?
+ // Hora to auto guardar. You may have some flickery?
saveSettings();
displayOverlay();
}
}
/*
- * addToJsonInfo() can be used to add custom entries to the /json/info part of the JSON API.
- * Creating an "u" object allows you to add custom key/value pairs to the Info section of the WLED web UI.
- * Below it is shown how this could be used for e.g. a light sensor
+ * `addToJsonInfo()` puede usarse para añadir entradas personalizadas a /JSON/información de la API JSON.
+ * Crear un objeto "u" permite añadir pares clave/valor a la sección Información de la UI web de WLED.
+ * A continuación se muestra un ejemplo.
*/
void addToJsonInfo(JsonObject& root) {
JsonObject user = root["u"];
@@ -177,15 +177,15 @@ class AutoSaveUsermod : public Usermod {
}
/*
- * addToJsonState() can be used to add custom entries to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * addToJsonState() can be used to add custom entries to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
//void addToJsonState(JsonObject& root) {
//}
/*
- * readFromJsonState() can be used to receive data clients send to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * readFromJsonState() can be used to recibir datos clients enviar to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
void readFromJsonState(JsonObject& root) {
if (!initDone) return; // prevent crash on boot applyPreset()
@@ -203,16 +203,16 @@ class AutoSaveUsermod : public Usermod {
}
/*
- * addToConfig() can be used to add custom persistent settings to the cfg.json file in the "um" (usermod) object.
+ * addToConfig() can be used to add custom persistent settings to the cfg.JSON archivo in the "um" (usermod) object.
* It will be called by WLED when settings are actually saved (for example, LED settings are saved)
- * If you want to force saving the current state, use serializeConfig() in your loop().
+ * If you want to force saving the current estado, use serializeConfig() in your bucle().
*
- * CAUTION: serializeConfig() will initiate a filesystem write operation.
+ * CAUTION: serializeConfig() will initiate a filesystem escribir operation.
* It might cause the LEDs to stutter and will cause flash wear if called too often.
- * Use it sparingly and always in the loop, never in network callbacks!
+ * Use it sparingly and always in the bucle, never in red callbacks!
*
* addToConfig() will also not yet add your setting to one of the settings pages automatically.
- * To make that work you still have to add the setting to the HTML, xml.cpp and set.cpp manually.
+ * To make that work you still have to add the setting to the HTML, XML.cpp and set.cpp manually.
*
* I highly recommend checking out the basics of ArduinoJson serialization and deserialization in order to use custom settings!
*/
@@ -227,17 +227,17 @@ class AutoSaveUsermod : public Usermod {
}
/*
- * readFromConfig() can be used to read back the custom settings you added with addToConfig().
+ * readFromConfig() can be used to leer back the custom settings you added with addToConfig().
* This is called by WLED when settings are loaded (currently this only happens once immediately after boot)
*
- * readFromConfig() is called BEFORE setup(). This means you can use your persistent values in setup() (e.g. pin assignments, buffer sizes),
- * but also that if you want to write persistent values to a dynamic buffer, you'd need to allocate it here instead of in setup.
+ * readFromConfig() is called BEFORE configuración(). This means you can use your persistent values in configuración() (e.g. pin assignments, búfer sizes),
+ * but also that if you want to escribir persistent values to a dynamic búfer, you'd need to allocate it here instead of in configuración.
* If you don't know what that is, don't fret. It most likely doesn't affect your use case :)
*
- * The function should return true if configuration was successfully loaded or false if there was no configuration.
+ * The función should retorno verdadero if configuration was successfully loaded or falso if there was no configuration.
*/
bool readFromConfig(JsonObject& root) {
- // we look for JSON object: {"Autosave": {"enabled": true, "autoSaveAfterSec": 10, "autoSavePreset": 250, ...}}
+ // we look for JSON object: {"Autosave": {"enabled": verdadero, "autoSaveAfterSec": 10, "autoSavePreset": 250, ...}}
JsonObject top = root[FPSTR(_name)];
if (top.isNull()) {
DEBUG_PRINT(FPSTR(_name));
@@ -254,20 +254,20 @@ class AutoSaveUsermod : public Usermod {
DEBUG_PRINT(FPSTR(_name));
DEBUG_PRINTLN(F(" config (re)loaded."));
- // use "return !top["newestParameter"].isNull();" when updating Usermod with new features
+ // use "retorno !top["newestParameter"].isNull();" when updating Usermod with new features
return true;
}
/*
- * getId() allows you to optionally give your V2 usermod an unique ID (please define it in const.h!).
- * This could be used in the future for the system to determine whether your usermod is installed.
+ * getId() allows you to optionally give your V2 usermod an unique ID (please definir it in constante.h!).
+ * This could be used in the futuro for the sistema to determine whether your usermod is installed.
*/
uint16_t getId() {
return USERMOD_ID_AUTO_SAVE;
}
};
-// strings to reduce flash memory usage (used more than twice)
+// strings to reduce flash memoria usage (used more than twice)
const char AutoSaveUsermod::_name[] PROGMEM = "Autosave";
const char AutoSaveUsermod::_autoSaveEnabled[] PROGMEM = "enabled";
const char AutoSaveUsermod::_autoSaveAfterSec[] PROGMEM = "autoSaveAfterSec";
diff --git a/usermods/usermod_v2_brightness_follow_sun/usermod_v2_brightness_follow_sun.cpp b/usermods/usermod_v2_brightness_follow_sun/usermod_v2_brightness_follow_sun.cpp
index ff97cba468..46d0b4d5e2 100644
--- a/usermods/usermod_v2_brightness_follow_sun/usermod_v2_brightness_follow_sun.cpp
+++ b/usermods/usermod_v2_brightness_follow_sun/usermod_v2_brightness_follow_sun.cpp
@@ -1,6 +1,6 @@
#include "wled.h"
-//v2 usermod that allows to change brightness and color using a rotary encoder,
+//v2 usermod that allows to change brillo and color usando a rotary encoder,
//change between modes by pressing a button (many encoders have one included)
class UsermodBrightnessFollowSun : public Usermod
{
diff --git a/usermods/usermod_v2_four_line_display_ALT/4LD_wled_fonts.h b/usermods/usermod_v2_four_line_display_ALT/4LD_wled_fonts.h
index 0fb5f3bbf8..86d9ce898f 100644
--- a/usermods/usermod_v2_four_line_display_ALT/4LD_wled_fonts.h
+++ b/usermods/usermod_v2_four_line_display_ALT/4LD_wled_fonts.h
@@ -5,7 +5,7 @@
Fontname: wled_logo_akemi_4x4
Copyright: Benji (https://github.com/proto-molecule)
Glyphs: 3/3
- BBX Build Mode: 3
+ BBX Compilación Mode: 3
* this logo ...WLED/images/wled_logo_akemi.png
* encode map = 1, 2, 3
*/
@@ -29,12 +29,12 @@ const uint8_t u8x8_wled_logo_akemi_4x4[388] U8X8_FONT_SECTION("u8x8_wled_logo_ak
Fontname: wled_logo_akemi_5x5
Copyright: Benji (https://github.com/proto-molecule)
Glyphs: 3/3
- BBX Build Mode: 3
+ BBX Compilación Mode: 3
* this logo ...WLED/images/wled_logo_akemi.png
* encoded = 1, 2, 3
*/
/*
-const uint8_t u8x8_wled_logo_akemi_5x5[604] U8X8_FONT_SECTION("u8x8_wled_logo_akemi_5x5") =
+constante uint8_t u8x8_wled_logo_akemi_5x5[604] U8X8_FONT_SECTION("u8x8_wled_logo_akemi_5x5") =
"\1\3\5\5\0\0\0\0\0\0\0\0\0\0\0\0\340\340\374\14\354\14\354\14|\14\354\14||\14\354"
"\14\374\340\340\0\0\0\0\0\0\0\200\0\0\0\200\200\0\200\200\0\0\0\0\377\377\377\376\377\376\377\377"
"\377\377\77\77\307\307\307\307\306\377\377\377\0\0\0\360\374>\77\307\0\0\61cg\357\347\303\301\200\0\0"
@@ -60,7 +60,7 @@ const uint8_t u8x8_wled_logo_akemi_5x5[604] U8X8_FONT_SECTION("u8x8_wled_logo_ak
Fontname: wled_logo_2x2
Copyright: Benji (https://github.com/proto-molecule)
Glyphs: 4/4
- BBX Build Mode: 3
+ BBX Compilación Mode: 3
* this logo https://cdn.discordapp.com/attachments/706623245935444088/927361780613799956/wled_scaled.png
* encode map = 1, 2, 3, 4
*/
@@ -76,12 +76,12 @@ const uint8_t u8x8_wled_logo_2x2[133] U8X8_FONT_SECTION("u8x8_wled_logo_2x2") =
Fontname: wled_logo_4x4
Copyright: Created with Fony 1.4.7
Glyphs: 4/4
- BBX Build Mode: 3
+ BBX Compilación Mode: 3
* this logo https://cdn.discordapp.com/attachments/706623245935444088/927361780613799956/wled_scaled.png
* encode map = 1, 2, 3, 4
*/
/*
-const uint8_t u8x8_wled_logo_4x4[517] U8X8_FONT_SECTION("u8x8_wled_logo_4x4") =
+constante uint8_t u8x8_wled_logo_4x4[517] U8X8_FONT_SECTION("u8x8_wled_logo_4x4") =
"\1\4\4\4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\374\374\374\374\374\374\374\374"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\300\300\300\300\300\377\377\377\377\377\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\17\17\17\17\17\0\0\0\0\0\0\0\0\0"
@@ -106,9 +106,9 @@ const uint8_t u8x8_wled_logo_4x4[517] U8X8_FONT_SECTION("u8x8_wled_logo_4x4") =
Fontname: 4LineDisplay_WLED_icons_1x
Copyright: Benji (https://github.com/proto-molecule)
Glyphs: 13/13
- BBX Build Mode: 3
+ BBX Compilación Mode: 3
* 1 = sun
- * 2 = skip forward
+ * 2 = omitir forward
* 3 = fire
* 4 = custom palette
* 5 = puzzle piece
@@ -120,7 +120,7 @@ const uint8_t u8x8_wled_logo_4x4[517] U8X8_FONT_SECTION("u8x8_wled_logo_4x4") =
* 11 = heart
* 12 = Akemi
*-----------
- * 20 = wifi
+ * 20 = WiFi
* 21 = media-play
*/
const uint8_t u8x8_4LineDisplay_WLED_icons_1x1[172] U8X8_FONT_SECTION("u8x8_4LineDisplay_WLED_icons_1x1") =
@@ -136,9 +136,9 @@ const uint8_t u8x8_4LineDisplay_WLED_icons_1x1[172] U8X8_FONT_SECTION("u8x8_4Lin
Fontname: 4LineDisplay_WLED_icons_2x1
Copyright: Benji (https://github.com/proto-molecule)
Glyphs: 11/11
- BBX Build Mode: 3
+ BBX Compilación Mode: 3
* 1 = sun
- * 2 = skip forward
+ * 2 = omitir forward
* 3 = fire
* 4 = custom palette
* 5 = puzzle piece
@@ -164,9 +164,9 @@ const uint8_t u8x8_4LineDisplay_WLED_icons_2x1[196] U8X8_FONT_SECTION("u8x8_4Lin
Fontname: 4LineDisplay_WLED_icons_2x
Copyright:
Glyphs: 11/11
- BBX Build Mode: 3
+ BBX Compilación Mode: 3
* 1 = sun
- * 2 = skip forward
+ * 2 = omitir forward
* 3 = fire
* 4 = custom palette
* 5 = puzzle piece
@@ -197,9 +197,9 @@ const uint8_t u8x8_4LineDisplay_WLED_icons_2x2[389] U8X8_FONT_SECTION("u8x8_4Lin
Fontname: 4LineDisplay_WLED_icons_3x
Copyright: Benji (https://github.com/proto-molecule)
Glyphs: 11/11
- BBX Build Mode: 3
+ BBX Compilación Mode: 3
* 1 = sun
- * 2 = skip forward
+ * 2 = omitir forward
* 3 = fire
* 4 = custom palette
* 5 = puzzle piece
@@ -247,9 +247,9 @@ const uint8_t u8x8_4LineDisplay_WLED_icons_3x3[868] U8X8_FONT_SECTION("u8x8_4Lin
Fontname: 4LineDisplay_WLED_icons_4x
Copyright: Benji (https://github.com/proto-molecule)
Glyphs: 11/11
- BBX Build Mode: 3
+ BBX Compilación Mode: 3
* 1 = sun
- * 2 = skip forward
+ * 2 = omitir forward
* 3 = fire
* 4 = custom palette
* 5 = puzzle piece
@@ -262,7 +262,7 @@ const uint8_t u8x8_4LineDisplay_WLED_icons_3x3[868] U8X8_FONT_SECTION("u8x8_4Lin
* 12 = Akemi
*/
/*
-const uint8_t u8x8_4LineDisplay_WLED_icons_4x4[1540] U8X8_FONT_SECTION("u8x8_4LineDisplay_WLED_icons_4x4") =
+constante uint8_t u8x8_4LineDisplay_WLED_icons_4x4[1540] U8X8_FONT_SECTION("u8x8_4LineDisplay_WLED_icons_4x4") =
"\1\14\4\4\0\0\0\0`\360\360`\0\0\0\0\0\0\6\17\17\6\0\0\0\0\0\0`\360\360`"
"\0\0\0\0\200\300\300\200\0\0\0\0\340\370\374\376\376\377\377\377\377\377\377\376\376\374\370\340\0\0\0\0"
"\200\300\300\200\1\3\3\1\0\0\0\0\7\37\77\177\177\377\377\377\377\377\377\177\177\77\37\7\0\0\0\0"
@@ -318,9 +318,9 @@ const uint8_t u8x8_4LineDisplay_WLED_icons_4x4[1540] U8X8_FONT_SECTION("u8x8_4Li
Fontname: 4LineDisplay_WLED_icons_6x
Copyright: Benji (https://github.com/proto-molecule)
Glyphs: 11/11
- BBX Build Mode: 3
+ BBX Compilación Mode: 3
* 1 = sun
- * 2 = skip forward
+ * 2 = omitir forward
* 3 = fire
* 4 = custom palette
* 5 = puzzle piece
@@ -332,7 +332,7 @@ const uint8_t u8x8_4LineDisplay_WLED_icons_4x4[1540] U8X8_FONT_SECTION("u8x8_4Li
* 11 = heart
* 12 = Akemi
*/
-// you can replace this (wasteful) font by using 3x3 variant with draw2x2Glyph()
+// you can reemplazar this (wasteful) font by usando 3x3 variant with draw2x2Glyph()
const uint8_t u8x8_4LineDisplay_WLED_icons_6x6[3460] U8X8_FONT_SECTION("u8x8_4LineDisplay_WLED_icons_6x6") =
"\1\14\6\6\0\0\0\0\0\0\200\300\300\300\300\200\0\0\0\0\0\0\0\0\0\36\77\77\77\77\36\0"
"\0\0\0\0\0\0\0\0\200\300\300\300\300\200\0\0\0\0\0\0\0\0\0\0\0\0\7\17\17\17\17\7"
@@ -450,11 +450,11 @@ const uint8_t u8x8_4LineDisplay_WLED_icons_6x6[3460] U8X8_FONT_SECTION("u8x8_4Li
Fontname: akemi_8x8
Copyright: Benji (https://github.com/proto-molecule)
Glyphs: 1/1
- BBX Build Mode: 3
+ BBX Compilación Mode: 3
* 12 = Akemi
*/
/*
-const uint8_t u8x8_akemi_8x8[516] U8X8_FONT_SECTION("u8x8_akemi_8x8") =
+constante uint8_t u8x8_akemi_8x8[516] U8X8_FONT_SECTION("u8x8_akemi_8x8") =
"\14\14\10\10\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
diff --git a/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display.h b/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display.h
index 4fc963b9c1..c36c7e866f 100644
--- a/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display.h
+++ b/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display.h
@@ -40,10 +40,10 @@
// if SLEEP_MODE_ENABLED.
#define SCREEN_TIMEOUT_MS 60*1000 // 1 min
-// Minimum time between redrawing screen in ms
+// Mínimo time between redrawing screen in ms
#define REFRESH_RATE_MS 1000
-// Extra char (+1) for null
+// Extra char (+1) for nulo
#define LINE_BUFFER_SIZE 16+1
#define MAX_JSON_CHARS 19+1
#define MAX_MODE_LINE_SPACE 13+1
@@ -75,7 +75,7 @@ class FourLineDisplayUsermod : public Usermod {
volatile bool drawing = false;
volatile bool lockRedraw = false;
- // HW interface & configuration
+ // HW interfaz & configuration
U8X8 *u8x8 = nullptr; // pointer to U8X8 display object
#ifndef FLD_SPI_DEFAULT
@@ -125,7 +125,7 @@ class FourLineDisplayUsermod : public Usermod {
byte markLineNum = 255;
byte markColNum = 255;
- // strings to reduce flash memory usage (used more than twice)
+ // strings to reduce flash memoria usage (used more than twice)
static const char _name[];
static const char _enabled[];
static const char _contrast[];
@@ -138,10 +138,10 @@ class FourLineDisplayUsermod : public Usermod {
static const char _busClkFrequency[];
static const char _contrastFix[];
- // If display does not work or looks corrupted check the
+ // If display does not work or looks corrupted verificar the
// constructor reference:
// https://github.com/olikraus/u8g2/wiki/u8x8setupcpp
- // or check the gallery:
+ // or verificar the gallery:
// https://github.com/olikraus/u8g2/wiki/gallery
// some displays need this to properly apply contrast
@@ -171,26 +171,26 @@ class FourLineDisplayUsermod : public Usermod {
void showTime();
/**
- * Enable sleep (turn the display off) or clock mode.
+ * Habilitar sleep (turn the display off) or clock mode.
*/
void sleepOrClock(bool enabled);
public:
// gets called once at boot. Do all initialization that doesn't depend on
- // network here
+ // red here
void setup() override;
- // gets called every time WiFi is (re-)connected. Initialize own network
+ // gets called every time WiFi is (re-)connected. Inicializar own red
// interfaces here
void connected() override;
/**
- * Da loop.
+ * Da bucle.
*/
void loop() override;
- //function to update lastredraw
+ //función to actualizar lastredraw
inline void updateRedrawTime() { lastRedraw = millis(); }
/**
@@ -205,52 +205,52 @@ class FourLineDisplayUsermod : public Usermod {
void drawStatusIcons();
/**
- * marks the position of the arrow showing
+ * marks the posición of the arrow showing
* the current setting being changed
- * pass line and colum info
+ * pass line and colum información
*/
void setMarkLine(byte newMarkLineNum, byte newMarkColNum);
- //Draw the arrow for the current setting being changed
+ //Dibujar the arrow for the current setting being changed
void drawArrow();
- //Display the current effect or palette (desiredEntry)
+ //Display the current efecto or palette (desiredEntry)
// on the appropriate line (row).
void showCurrentEffectOrPalette(int inputEffPal, const char *qstring, uint8_t row);
/**
* If there screen is off or in clock is displayed,
- * this will return true. This allows us to throw away
- * the first input from the rotary encoder but
+ * this will retorno verdadero. This allows us to throw away
+ * the first entrada from the rotary encoder but
* to wake up the screen.
*/
bool wakeDisplay();
/**
- * Allows you to show one line and a glyph as overlay for a period of time.
+ * Allows you to show one line and a glyph as overlay for a período of time.
* Clears the screen and prints.
* Used in Rotary Encoder usermod.
*/
void overlay(const char* line1, long showHowLong, byte glyphType);
/**
- * Allows you to show Akemi WLED logo overlay for a period of time.
+ * Allows you to show Akemi WLED logo overlay for a período of time.
* Clears the screen and prints.
*/
void overlayLogo(long showHowLong);
/**
- * Allows you to show two lines as overlay for a period of time.
+ * Allows you to show two lines as overlay for a período of time.
* Clears the screen and prints.
- * Used in Auto Save usermod
+ * Used in Auto Guardar usermod
*/
void overlay(const char* line1, const char* line2, long showHowLong);
void networkOverlay(const char* line1, long showHowLong);
/**
- * handleButton() can be used to override default button behaviour. Returning true
- * will prevent button working in a default way.
+ * handleButton() can be used to anular default button behaviour. Returning verdadero
+ * will prevent button funcionamiento in a default way.
* Replicating button.cpp
*/
bool handleButton(uint8_t b);
@@ -258,55 +258,55 @@ class FourLineDisplayUsermod : public Usermod {
void onUpdateBegin(bool init) override;
/*
- * addToJsonInfo() can be used to add custom entries to the /json/info part of the JSON API.
- * Creating an "u" object allows you to add custom key/value pairs to the Info section of the WLED web UI.
+ * addToJsonInfo() can be used to add custom entries to the /JSON/información part of the JSON API.
+ * Creating an "u" object allows you to add custom key/valor pairs to the Información section of the WLED web UI.
* Below it is shown how this could be used for e.g. a light sensor
*/
- //void addToJsonInfo(JsonObject& root) override;
+ //void addToJsonInfo(JsonObject& root) anular;
/*
- * addToJsonState() can be used to add custom entries to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * addToJsonState() can be used to add custom entries to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
- //void addToJsonState(JsonObject& root) override;
+ //void addToJsonState(JsonObject& root) anular;
/*
- * readFromJsonState() can be used to receive data clients send to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * readFromJsonState() can be used to recibir datos clients enviar to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
- //void readFromJsonState(JsonObject& root) override;
+ //void readFromJsonState(JsonObject& root) anular;
void appendConfigData() override;
/*
- * addToConfig() can be used to add custom persistent settings to the cfg.json file in the "um" (usermod) object.
+ * addToConfig() can be used to add custom persistent settings to the cfg.JSON archivo in the "um" (usermod) object.
* It will be called by WLED when settings are actually saved (for example, LED settings are saved)
- * If you want to force saving the current state, use serializeConfig() in your loop().
+ * If you want to force saving the current estado, use serializeConfig() in your bucle().
*
- * CAUTION: serializeConfig() will initiate a filesystem write operation.
+ * CAUTION: serializeConfig() will initiate a filesystem escribir operation.
* It might cause the LEDs to stutter and will cause flash wear if called too often.
- * Use it sparingly and always in the loop, never in network callbacks!
+ * Use it sparingly and always in the bucle, never in red callbacks!
*
* addToConfig() will also not yet add your setting to one of the settings pages automatically.
- * To make that work you still have to add the setting to the HTML, xml.cpp and set.cpp manually.
+ * To make that work you still have to add the setting to the HTML, XML.cpp and set.cpp manually.
*
* I highly recommend checking out the basics of ArduinoJson serialization and deserialization in order to use custom settings!
*/
void addToConfig(JsonObject& root) override;
/*
- * readFromConfig() can be used to read back the custom settings you added with addToConfig().
+ * readFromConfig() can be used to leer back the custom settings you added with addToConfig().
* This is called by WLED when settings are loaded (currently this only happens once immediately after boot)
*
- * readFromConfig() is called BEFORE setup(). This means you can use your persistent values in setup() (e.g. pin assignments, buffer sizes),
- * but also that if you want to write persistent values to a dynamic buffer, you'd need to allocate it here instead of in setup.
+ * readFromConfig() is called BEFORE configuración(). This means you can use your persistent values in configuración() (e.g. pin assignments, búfer sizes),
+ * but also that if you want to escribir persistent values to a dynamic búfer, you'd need to allocate it here instead of in configuración.
* If you don't know what that is, don't fret. It most likely doesn't affect your use case :)
*/
bool readFromConfig(JsonObject& root) override;
/*
- * getId() allows you to optionally give your V2 usermod an unique ID (please define it in const.h!).
- * This could be used in the future for the system to determine whether your usermod is installed.
+ * getId() allows you to optionally give your V2 usermod an unique ID (please definir it in constante.h!).
+ * This could be used in the futuro for the sistema to determine whether your usermod is installed.
*/
uint16_t getId() override {
return USERMOD_ID_FOUR_LINE_DISP;
diff --git a/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.cpp b/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.cpp
index 1808a39b5e..a3e1701486 100644
--- a/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.cpp
+++ b/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.cpp
@@ -4,7 +4,7 @@
//
// Inspired by the usermod_v2_four_line_display
//
-// v2 usermod for using 128x32 or 128x64 i2c
+// v2 usermod for usando 128x32 or 128x64 I2C
// OLED displays to provide a four line display
// for WLED.
//
@@ -12,12 +12,12 @@
// * This Usermod works best, by far, when coupled
// with RotaryEncoderUI ALT Usermod.
//
-// Make sure to enable NTP and set your time zone in WLED Config | Time.
+// Make sure to habilitar NTP and set your time zona in WLED Configuración | Hora.
//
-// If display does not work or looks corrupted check the
+// If display does not work or looks corrupted verificar the
// constructor reference:
// https://github.com/olikraus/u8g2/wiki/u8x8setupcpp
-// or check the gallery:
+// or verificar the gallery:
// https://github.com/olikraus/u8g2/wiki/gallery
@@ -26,7 +26,7 @@ static TaskHandle_t Display_Task = nullptr;
void DisplayTaskCode(void * parameter);
#endif
-// strings to reduce flash memory usage (used more than twice)
+// strings to reduce flash memoria usage (used more than twice)
const char FourLineDisplayUsermod::_name[] PROGMEM = "4LineDisplay";
const char FourLineDisplayUsermod::_enabled[] PROGMEM = "enabled";
const char FourLineDisplayUsermod::_contrast[] PROGMEM = "contrast";
@@ -174,7 +174,7 @@ void FourLineDisplayUsermod::showTime() {
if (AmPmHour == 0) { AmPmHour = 12; }
}
if (knownHour != hourCurrent) {
- // only update date when hour changes
+ // only actualizar date when hour changes
sprintf_P(lineBuffer, PSTR("%s %2d "), monthShortStr(month(localTime)), day(localTime));
draw2x2String(2, lineHeight==1 ? 0 : lineHeight, lineBuffer); // adjust for 8 line displays, draw month and day
}
@@ -196,7 +196,7 @@ void FourLineDisplayUsermod::showTime() {
}
/**
- * Enable sleep (turn the display off) or clock mode.
+ * Habilitar sleep (turn the display off) or clock mode.
*/
void FourLineDisplayUsermod::sleepOrClock(bool enabled) {
if (enabled) {
@@ -213,11 +213,11 @@ void FourLineDisplayUsermod::sleepOrClock(bool enabled) {
}
// gets called once at boot. Do all initialization that doesn't depend on
-// network here
+// red here
void FourLineDisplayUsermod::setup() {
bool isSPI = (type == SSD1306_SPI || type == SSD1306_SPI64 || type == SSD1309_SPI64);
- // check if pins are -1 and disable usermod as PinManager::allocateMultiplePins() will accept -1 as a valid pin
+ // verificar if pins are -1 and deshabilitar usermod as PinManager::allocateMultiplePins() will accept -1 as a valid pin
if (isSPI) {
if (spi_sclk<0 || spi_mosi<0 || ioPin[0]<0 || ioPin[1]<0 || ioPin[1]<0) {
type = NONE;
@@ -260,7 +260,7 @@ void FourLineDisplayUsermod::setup() {
initDone = true;
}
-// gets called every time WiFi is (re-)connected. Initialize own network
+// gets called every time WiFi is (re-)connected. Inicializar own red
// interfaces here
void FourLineDisplayUsermod::connected() {
knownSsid = WiFi.SSID(); //apActive ? apSSID : WiFi.SSID(); //apActive ? WiFi.softAPSSID() :
@@ -269,7 +269,7 @@ void FourLineDisplayUsermod::connected() {
}
/**
- * Da loop.
+ * Da bucle.
*/
void FourLineDisplayUsermod::loop() {
#if !(defined(ARDUINO_ARCH_ESP32) && defined(FLD_ESP32_USE_THREADS))
@@ -292,7 +292,7 @@ void FourLineDisplayUsermod::redraw(bool forceRedraw) {
if (type == NONE || !enabled) return;
if (overlayUntil > 0) {
if (now >= overlayUntil) {
- // Time to display the overlay has elapsed.
+ // Hora to display the overlay has elapsed.
overlayUntil = 0;
forceRedraw = true;
} else {
@@ -311,7 +311,7 @@ void FourLineDisplayUsermod::redraw(bool forceRedraw) {
return;
}
- // Check if values which are shown on display changed from the last time.
+ // Verificar if values which are shown on display changed from the last time.
if (forceRedraw) {
needRedraw = true;
clear();
@@ -355,7 +355,7 @@ void FourLineDisplayUsermod::redraw(bool forceRedraw) {
// Nothing to change.
// Turn off display after 1 minutes with no change.
if (sleepMode && !displayTurnedOff && (millis() - lastRedraw > screenTimeout)) {
- // We will still check if there is a change in redraw()
+ // We will still verificar if there is a change in redraw()
// and turn it back on if it changed.
clear();
sleepOrClock(true);
@@ -370,7 +370,7 @@ void FourLineDisplayUsermod::redraw(bool forceRedraw) {
// Turn the display back on
wakeDisplay();
- // Update last known values.
+ // Actualizar last known values.
knownBrightness = bri;
knownMode = effectCurrent;
knownPalette = effectPalette;
@@ -466,16 +466,16 @@ void FourLineDisplayUsermod::drawStatusIcons() {
}
/**
- * marks the position of the arrow showing
+ * marks the posición of the arrow showing
* the current setting being changed
- * pass line and colum info
+ * pass line and colum información
*/
void FourLineDisplayUsermod::setMarkLine(byte newMarkLineNum, byte newMarkColNum) {
markLineNum = newMarkLineNum;
markColNum = newMarkColNum;
}
-//Draw the arrow for the current setting being changed
+//Dibujar the arrow for the current setting being changed
void FourLineDisplayUsermod::drawArrow() {
#if defined(ARDUINO_ARCH_ESP32) && defined(FLD_ESP32_USE_THREADS)
unsigned long now = millis();
@@ -487,7 +487,7 @@ void FourLineDisplayUsermod::drawArrow() {
lockRedraw = false;
}
-//Display the current effect or palette (desiredEntry)
+//Display the current efecto or palette (desiredEntry)
// on the appropriate line (row).
void FourLineDisplayUsermod::showCurrentEffectOrPalette(int inputEffPal, const char *qstring, uint8_t row) {
#if defined(ARDUINO_ARCH_ESP32) && defined(FLD_ESP32_USE_THREADS)
@@ -498,14 +498,14 @@ void FourLineDisplayUsermod::showCurrentEffectOrPalette(int inputEffPal, const c
char lineBuffer[MAX_JSON_CHARS];
if (overlayUntil == 0) {
lockRedraw = true;
- // Find the mode name in JSON
+ // Encontrar the mode name in JSON
unsigned printedChars = extractModeName(inputEffPal, qstring, lineBuffer, MAX_JSON_CHARS-1);
if (lineBuffer[0]=='*' && lineBuffer[1]==' ') {
- // remove "* " from dynamic palettes
+ // eliminar "* " from dynamic palettes
for (unsigned i=2; i<=printedChars; i++) lineBuffer[i-2] = lineBuffer[i]; //include '\0'
printedChars -= 2;
} else if ((lineBuffer[0]==' ' && lineBuffer[1]>127)) {
- // remove note symbol from effect names
+ // eliminar note symbol from efecto names
for (unsigned i=5; i<=printedChars; i++) lineBuffer[i-5] = lineBuffer[i]; //include '\0'
printedChars -= 5;
}
@@ -556,8 +556,8 @@ void FourLineDisplayUsermod::showCurrentEffectOrPalette(int inputEffPal, const c
/**
* If there screen is off or in clock is displayed,
- * this will return true. This allows us to throw away
- * the first input from the rotary encoder but
+ * this will retorno verdadero. This allows us to throw away
+ * the first entrada from the rotary encoder but
* to wake up the screen.
*/
bool FourLineDisplayUsermod::wakeDisplay() {
@@ -579,7 +579,7 @@ bool FourLineDisplayUsermod::wakeDisplay() {
}
/**
- * Allows you to show one line and a glyph as overlay for a period of time.
+ * Allows you to show one line and a glyph as overlay for a período of time.
* Clears the screen and prints.
* Used in Rotary Encoder usermod.
*/
@@ -592,7 +592,7 @@ void FourLineDisplayUsermod::overlay(const char* line1, long showHowLong, byte g
lockRedraw = true;
// Turn the display back on
if (!wakeDisplay()) clear();
- // Print the overlay
+ // Imprimir the overlay
if (glyphType>0 && glyphType<255) {
if (lineHeight == 2) drawGlyph(5, 0, glyphType, u8x8_4LineDisplay_WLED_icons_6x6, true); // use 3x3 font with draw2x2Glyph() if flash runs short and comment out 6x6 font
else drawGlyph(6, 0, glyphType, u8x8_4LineDisplay_WLED_icons_3x3, true);
@@ -607,7 +607,7 @@ void FourLineDisplayUsermod::overlay(const char* line1, long showHowLong, byte g
}
/**
- * Allows you to show Akemi WLED logo overlay for a period of time.
+ * Allows you to show Akemi WLED logo overlay for a período of time.
* Clears the screen and prints.
*/
void FourLineDisplayUsermod::overlayLogo(long showHowLong) {
@@ -619,7 +619,7 @@ void FourLineDisplayUsermod::overlayLogo(long showHowLong) {
lockRedraw = true;
// Turn the display back on
if (!wakeDisplay()) clear();
- // Print the overlay
+ // Imprimir the overlay
if (lineHeight == 2) {
//add a bit of randomness
switch (millis()%3) {
@@ -670,9 +670,9 @@ void FourLineDisplayUsermod::overlayLogo(long showHowLong) {
}
/**
- * Allows you to show two lines as overlay for a period of time.
+ * Allows you to show two lines as overlay for a período of time.
* Clears the screen and prints.
- * Used in Auto Save usermod
+ * Used in Auto Guardar usermod
*/
void FourLineDisplayUsermod::overlay(const char* line1, const char* line2, long showHowLong) {
#if defined(ARDUINO_ARCH_ESP32) && defined(FLD_ESP32_USE_THREADS)
@@ -683,7 +683,7 @@ void FourLineDisplayUsermod::overlay(const char* line1, const char* line2, long
lockRedraw = true;
// Turn the display back on
if (!wakeDisplay()) clear();
- // Print the overlay
+ // Imprimir the overlay
if (line1) {
String buf = line1;
center(buf, getCols());
@@ -709,17 +709,17 @@ void FourLineDisplayUsermod::networkOverlay(const char* line1, long showHowLong)
String line;
// Turn the display back on
if (!wakeDisplay()) clear();
- // Print the overlay
+ // Imprimir the overlay
if (line1) {
line = line1;
center(line, getCols());
drawString(0, 0, line.c_str());
}
- // Second row with Wifi name
+ // Second row with WiFi name
line = knownSsid.substring(0, getCols() > 1 ? getCols() - 2 : 0);
if (line.length() < getCols()) center(line, getCols());
drawString(0, lineHeight, line.c_str());
- // Print `~` char to indicate that SSID is longer, than our display
+ // Imprimir `~` char to indicate that SSID is longer, than our display
if (knownSsid.length() > getCols()) {
drawString(getCols() - 1, 0, "~");
}
@@ -741,8 +741,8 @@ void FourLineDisplayUsermod::networkOverlay(const char* line1, long showHowLong)
/**
- * handleButton() can be used to override default button behaviour. Returning true
- * will prevent button working in a default way.
+ * handleButton() can be used to anular default button behaviour. Returning verdadero
+ * will prevent button funcionamiento in a default way.
* Replicating button.cpp
*/
bool FourLineDisplayUsermod::handleButton(uint8_t b) {
@@ -772,9 +772,9 @@ bool FourLineDisplayUsermod::handleButton(uint8_t b) {
buttonPressedBefore = true;
if (now - buttonPressedTime > 600) { //long press
- //TODO: handleButton() handles button 0 without preset in a different way for double click
- //so we need to override with same behaviour
- //DEBUG_PRINTLN(F("4LD action."));
+ //TODO: handleButton() handles button 0 without preset in a different way for doble click
+ //so we need to anular with same behaviour
+ //DEBUG_PRINTLN(F("4LD acción."));
//if (!buttonLongPressed) longPressAction(0);
buttonLongPressed = true;
return false;
@@ -792,8 +792,8 @@ bool FourLineDisplayUsermod::handleButton(uint8_t b) {
buttonWaitTime = 0;
if (!buttonLongPressed) { //short press
- // if this is second release within 350ms it is a double press (buttonWaitTime!=0)
- //TODO: handleButton() handles button 0 without preset in a different way for double click
+ // if this is second lanzamiento within 350ms it is a doble press (buttonWaitTime!=0)
+ //TODO: handleButton() handles button 0 without preset in a different way for doble click
if (doublePress) {
networkOverlay(PSTR("NETWORK INFO"),7000);
handled = true;
@@ -804,13 +804,13 @@ bool FourLineDisplayUsermod::handleButton(uint8_t b) {
buttonPressedBefore = false;
buttonLongPressed = false;
}
- // if 350ms elapsed since last press/release it is a short press
+ // if 350ms elapsed since last press/lanzamiento it is a short press
if (buttonWaitTime && now - buttonWaitTime > 350 && !buttonPressedBefore) {
buttonWaitTime = 0;
- //TODO: handleButton() handles button 0 without preset in a different way for double click
- //so we need to override with same behaviour
+ //TODO: handleButton() handles button 0 without preset in a different way for doble click
+ //so we need to anular with same behaviour
//shortPressAction(0);
- //handled = false;
+ //handled = falso;
}
return handled;
}
@@ -827,13 +827,13 @@ void FourLineDisplayUsermod::onUpdateBegin(bool init) {
if (init && Display_Task) {
vTaskSuspend(Display_Task); // update is about to begin, disable task to prevent crash
} else {
- // update has failed or create task requested
+ // actualizar has failed or crear tarea requested
if (Display_Task)
vTaskResume(Display_Task);
else
xTaskCreatePinnedToCore(
[](void * par) { // Function to implement the task
- // see https://www.freertos.org/vtaskdelayuntil.html
+ // see https://www.freertos.org/vtaskdelayuntil.HTML
const TickType_t xFrequency = REFRESH_RATE_MS * portTICK_PERIOD_MS / 2;
TickType_t xLastWakeTime = xTaskGetTickCount();
for(;;) {
@@ -855,30 +855,30 @@ void FourLineDisplayUsermod::onUpdateBegin(bool init) {
}
/*
- * addToJsonInfo() can be used to add custom entries to the /json/info part of the JSON API.
- * Creating an "u" object allows you to add custom key/value pairs to the Info section of the WLED web UI.
+ * addToJsonInfo() can be used to add custom entries to the /JSON/información part of the JSON API.
+ * Creating an "u" object allows you to add custom key/valor pairs to the Información section of the WLED web UI.
* Below it is shown how this could be used for e.g. a light sensor
*/
//void FourLineDisplayUsermod::addToJsonInfo(JsonObject& root) {
- //JsonObject user = root["u"];
- //if (user.isNull()) user = root.createNestedObject("u");
- //JsonArray data = user.createNestedArray(F("4LineDisplay"));
- //data.add(F("Loaded."));
+ //JsonObject usuario = root["u"];
+ //if (usuario.isNull()) usuario = root.createNestedObject("u");
+ //JsonArray datos = usuario.createNestedArray(F("4LineDisplay"));
+ //datos.add(F("Loaded."));
//}
/*
- * addToJsonState() can be used to add custom entries to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * addToJsonState() can be used to add custom entries to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
//void FourLineDisplayUsermod::addToJsonState(JsonObject& root) {
//}
/*
- * readFromJsonState() can be used to receive data clients send to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * readFromJsonState() can be used to recibir datos clients enviar to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
//void FourLineDisplayUsermod::readFromJsonState(JsonObject& root) {
-// if (!initDone) return; // prevent crash on boot applyPreset()
+// if (!initDone) retorno; // prevent bloqueo on boot applyPreset()
//}
void FourLineDisplayUsermod::appendConfigData() {
@@ -900,16 +900,16 @@ void FourLineDisplayUsermod::appendConfigData() {
}
/*
- * addToConfig() can be used to add custom persistent settings to the cfg.json file in the "um" (usermod) object.
+ * addToConfig() can be used to add custom persistent settings to the cfg.JSON archivo in the "um" (usermod) object.
* It will be called by WLED when settings are actually saved (for example, LED settings are saved)
- * If you want to force saving the current state, use serializeConfig() in your loop().
+ * If you want to force saving the current estado, use serializeConfig() in your bucle().
*
- * CAUTION: serializeConfig() will initiate a filesystem write operation.
+ * CAUTION: serializeConfig() will initiate a filesystem escribir operation.
* It might cause the LEDs to stutter and will cause flash wear if called too often.
- * Use it sparingly and always in the loop, never in network callbacks!
+ * Use it sparingly and always in the bucle, never in red callbacks!
*
* addToConfig() will also not yet add your setting to one of the settings pages automatically.
- * To make that work you still have to add the setting to the HTML, xml.cpp and set.cpp manually.
+ * To make that work you still have to add the setting to the HTML, XML.cpp and set.cpp manually.
*
* I highly recommend checking out the basics of ArduinoJson serialization and deserialization in order to use custom settings!
*/
@@ -935,11 +935,11 @@ void FourLineDisplayUsermod::addToConfig(JsonObject& root) {
}
/*
- * readFromConfig() can be used to read back the custom settings you added with addToConfig().
+ * readFromConfig() can be used to leer back the custom settings you added with addToConfig().
* This is called by WLED when settings are loaded (currently this only happens once immediately after boot)
*
- * readFromConfig() is called BEFORE setup(). This means you can use your persistent values in setup() (e.g. pin assignments, buffer sizes),
- * but also that if you want to write persistent values to a dynamic buffer, you'd need to allocate it here instead of in setup.
+ * readFromConfig() is called BEFORE configuración(). This means you can use your persistent values in configuración() (e.g. pin assignments, búfer sizes),
+ * but also that if you want to escribir persistent values to a dynamic búfer, you'd need to allocate it here instead of in configuración.
* If you don't know what that is, don't fret. It most likely doesn't affect your use case :)
*/
bool FourLineDisplayUsermod::readFromConfig(JsonObject& root) {
@@ -975,7 +975,7 @@ bool FourLineDisplayUsermod::readFromConfig(JsonObject& root) {
DEBUG_PRINT(FPSTR(_name));
if (!initDone) {
- // first run: reading from cfg.json
+ // first run: reading from cfg.JSON
type = newType;
DEBUG_PRINTLN(F(" config loaded."));
} else {
@@ -1007,7 +1007,7 @@ bool FourLineDisplayUsermod::readFromConfig(JsonObject& root) {
else if (!PinManager::allocateMultiplePins(pins, 3, PinOwner::UM_FourLineDisplay)) { newType=NONE; }
}
} else {
- // just I2C type changed
+ // just I2C tipo changed
}
type = newType;
switch (type) {
@@ -1063,7 +1063,7 @@ bool FourLineDisplayUsermod::readFromConfig(JsonObject& root) {
if (needsRedraw && !wakeDisplay()) redraw(true);
else overlayLogo(3500);
}
- // use "return !top["newestParameter"].isNull();" when updating Usermod with new features
+ // use "retorno !top["newestParameter"].isNull();" when updating Usermod with new features
return !top[FPSTR(_contrastFix)].isNull();
}
diff --git a/usermods/usermod_v2_klipper_percentage/usermod_v2_klipper_percentage.cpp b/usermods/usermod_v2_klipper_percentage/usermod_v2_klipper_percentage.cpp
index 71c5c45f3f..089c6c6598 100644
--- a/usermods/usermod_v2_klipper_percentage/usermod_v2_klipper_percentage.cpp
+++ b/usermods/usermod_v2_klipper_percentage/usermod_v2_klipper_percentage.cpp
@@ -16,9 +16,9 @@ class klipper_percentage : public Usermod
void httpGet(WiFiClient &client, char *errorMessage)
{
- // https://arduinojson.org/v6/example/http-client/
- // is this the most compact way to do http get and put it in arduinojson object???
- // would like async response ... ???
+ // https://arduinojson.org/v6/example/HTTP-cliente/
+ // is this the most compact way to do HTTP get and put it in arduinojson object???
+ // would like asíncrono respuesta ... ???
client.setTimeout(10000);
if (!client.connect(ip.c_str(), 80))
{
@@ -26,7 +26,7 @@ class klipper_percentage : public Usermod
}
else
{
- // Send HTTP request
+ // Enviar HTTP solicitud
client.println(F("GET /printer/objects/query?virtual_sdcard=progress HTTP/1.0"));
client.print(F("Host: ")); client.println(ip);
client.println(F("Connection: close"));
@@ -36,7 +36,7 @@ class klipper_percentage : public Usermod
}
else
{
- // Check HTTP status
+ // Verificar HTTP estado
char status[32] = {0};
client.readBytesUntil('\r', status, sizeof(status));
if (strcmp_P(status, PSTR("HTTP/1.1 200 OK")) != 0)
@@ -46,7 +46,7 @@ class klipper_percentage : public Usermod
}
else
{
- // Skip HTTP headers
+ // Omitir HTTP headers
char endOfHeaders[] = "\r\n\r\n";
if (!client.find(endOfHeaders))
{
@@ -112,8 +112,8 @@ class klipper_percentage : public Usermod
bool readFromConfig(JsonObject &root)
{
- // default settings values could be set here (or below using the 3-argument getJsonValue()) instead of in the class definition or constructor
- // setting them inside readFromConfig() is slightly more robust, handling the rare but plausible use case of single value being missing after boot (e.g. if the cfg.json was manually edited and a value was removed)
+ // default settings values could be set here (or below usando the 3-argumento getJsonValue()) instead of in the clase definition or constructor
+ // setting them inside readFromConfig() is slightly more robust, handling the rare but plausible use case of single valor being missing after boot (e.g. if the cfg.JSON was manually edited and a valor was removed)
JsonObject top = root[F("Klipper Printing Percentage")];
@@ -125,9 +125,9 @@ class klipper_percentage : public Usermod
}
/*
- * addToJsonInfo() can be used to add custom entries to the /json/info part of the JSON API.
- * Creating an "u" object allows you to add custom key/value pairs to the Info section of the WLED web UI.
- * Below it is shown how this could be used for e.g. a light sensor
+ * `addToJsonInfo()` puede usarse para añadir entradas personalizadas a /JSON/información de la API JSON.
+ * Crear un objeto "u" permite añadir pares clave/valor a la sección Información de la UI web de WLED.
+ * A continuación se muestra un ejemplo.
*/
void addToJsonInfo(JsonObject &root)
{
@@ -170,9 +170,9 @@ class klipper_percentage : public Usermod
}
/*
- * handleOverlayDraw() is called just before every show() (LED strip update frame) after effects have set the colors.
- * Use this to blank out some LEDs or set them to a different color regardless of the set effect mode.
- * Commonly used for custom clocks (Cronixie, 7 segment)
+ * handleOverlayDraw() is called just before every show() (LED tira actualizar frame) after effects have set the colors.
+ * Use this to blank out some LEDs or set them to a different color regardless of the set efecto mode.
+ * Commonly used for custom clocks (Cronixie, 7 segmento)
*/
void handleOverlayDraw()
{
@@ -208,8 +208,8 @@ class klipper_percentage : public Usermod
}
/*
- * getId() allows you to optionally give your V2 usermod an unique ID (please define it in const.h!).
- * This could be used in the future for the system to determine whether your usermod is installed.
+ * getId() allows you to optionally give your V2 usermod an unique ID (please definir it in constante.h!).
+ * This could be used in the futuro for the sistema to determine whether your usermod is installed.
*/
uint16_t getId()
{
diff --git a/usermods/usermod_v2_ping_pong_clock/usermod_v2_ping_pong_clock.cpp b/usermods/usermod_v2_ping_pong_clock/usermod_v2_ping_pong_clock.cpp
index c6632b53a0..811fa747e2 100644
--- a/usermods/usermod_v2_ping_pong_clock/usermod_v2_ping_pong_clock.cpp
+++ b/usermods/usermod_v2_ping_pong_clock/usermod_v2_ping_pong_clock.cpp
@@ -3,12 +3,12 @@
class PingPongClockUsermod : public Usermod
{
private:
- // Private class members. You can declare variables and functions only accessible to your usermod here
+ // Privado clase members. You can declare variables and functions only accessible to your usermod here
unsigned long lastTime = 0;
bool colonOn = true;
// ---- Variables modified by settings below -----
- // set your config variables to their boot default value (this can also be done in readFromConfig() or a constructor if you prefer)
+ // set your config variables to their boot default valor (this can also be done in readFromConfig() or a constructor if you prefer)
bool pingPongClockEnabled = true;
int colorR = 0xFF;
int colorG = 0xFF;
@@ -24,7 +24,7 @@ class PingPongClockUsermod : public Usermod
int colon2 = 80; // Address for the second colon led
// Matrix for the illumination of the numbers
- // Note: These only define the increments of the base address. e.g. to define the second Minute you have to add the baseMM to every led position
+ // Note: These only definir the increments of the base address. e.g. to definir the second Minute you have to add the baseMM to every LED posición
const int numbers[10][10] =
{
{ 0, 1, 4, 6, 13, 15, 18, 19, -1, -1 }, // 0: null
diff --git a/usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.cpp b/usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.cpp
index 02bb08c9b9..8942c058c6 100644
--- a/usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.cpp
+++ b/usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.cpp
@@ -8,11 +8,11 @@
//
// This usermod allows you to control:
//
-// * Brightness
-// * Selected Effect
-// * Effect Speed
-// * Effect Intensity
-// * Palette
+// * Brillo
+// * Selected Efecto
+// * Efecto Velocidad
+// * Efecto Intensidad
+// * Paleta
//
// Change between modes by pressing a button.
//
@@ -22,9 +22,9 @@
//
// If FourLineDisplayUsermod is used the folowing options are also enabled
//
-// * main color
-// * saturation of main color
-// * display network (long press buttion)
+// * principal color
+// * saturation of principal color
+// * display red (long press buttion)
//
#ifdef USERMOD_FOUR_LINE_DISPLAY
@@ -67,22 +67,22 @@
#define PCF8574_INT_PIN -1 // GPIO connected to INT pin on PCF8574
#endif
-// The last UI state, remove color and saturation option if display not active (too many options)
+// The last UI estado, eliminar color and saturation option if display not active (too many options)
#ifdef USERMOD_FOUR_LINE_DISPLAY
#define LAST_UI_STATE 11
#else
#define LAST_UI_STATE 4
#endif
-// Number of modes at the start of the list to not sort
+// Number of modes at the iniciar of the lista to not sort
#define MODE_SORT_SKIP_COUNT 1
-// Which list is being sorted
+// Which lista is being sorted
static const char **listBeingSorted;
/**
* Modes and palettes are stored as strings that
- * end in a quote character. Compare two of them.
+ * end in a quote carácter. Comparar two of them.
* We are comparing directly within either
* JSON_mode_names or JSON_palette_names.
*/
@@ -104,9 +104,9 @@ static int re_qstringCmp(const void *ap, const void *bp) {
// Really we shouldn't ever get to '\0'
if (aVal == '"' || bVal == '"' || aVal == '\0' || bVal == '\0') {
// We're done. one is a substring of the other
- // or something happenend and the quote didn't stop us.
+ // or something happenend and the quote didn't detener us.
if (aVal == bVal) {
- // Same value, probably shouldn't happen
+ // Same valor, probably shouldn't happen
// with this dataset
return 0;
}
@@ -138,10 +138,10 @@ static int re_qstringCmp(const void *ap, const void *bp) {
static volatile uint8_t pcfPortData = 0; // port expander port state
static volatile uint8_t addrPcf8574 = PCF8574_ADDRESS; // has to be accessible in ISR
-// Interrupt routine to read I2C rotary state
-// if we are to use PCF8574 port expander we will need to rely on interrupts as polling I2C every 2ms
+// Interrupción rutina to leer I2C rotary estado
+// if we are to use PCF8574 puerto expander we will need to rely on interrupts as polling I2C every 2ms
// is a waste of resources and causes 4LD to fail.
-// in such case rely on ISR to read pin values and store them into static variable
+// in such case rely on ISR to leer pin values and store them into estático variable
static void IRAM_ATTR i2cReadingISR() {
Wire.requestFrom(addrPcf8574, 1U);
if (Wire.available()) {
@@ -178,16 +178,16 @@ class RotaryEncoderUIUsermod : public Usermod {
void* display;
#endif
- // Pointers the start of the mode names within JSON_mode_names
+ // Pointers the iniciar of the mode names within JSON_mode_names
const char **modes_qstrings;
- // Array of mode indexes in alphabetical order.
+ // Matriz of mode indexes in alphabetical order.
byte *modes_alpha_indexes;
- // Pointers the start of the palette names within JSON_palette_names
+ // Pointers the iniciar of the palette names within JSON_palette_names
const char **palettes_qstrings;
- // Array of palette indexes in alphabetical order.
+ // Matriz of palette indexes in alphabetical order.
byte *palettes_alpha_indexes;
struct { // reduce memory footprint
@@ -213,7 +213,7 @@ class RotaryEncoderUIUsermod : public Usermod {
bool usePcf8574;
int8_t pinIRQ;
- // strings to reduce flash memory usage (used more than twice)
+ // strings to reduce flash memoria usage (used more than twice)
static const char _name[];
static const char _enabled[];
static const char _DT_pin[];
@@ -227,25 +227,25 @@ class RotaryEncoderUIUsermod : public Usermod {
static const char _pcfINTpin[];
/**
- * readPin() - read rotary encoder pin value
+ * readPin() - leer rotary encoder pin valor
*/
byte readPin(uint8_t pin);
/**
- * Sort the modes and palettes to the index arrays
+ * Sort the modes and palettes to the índice arrays
* modes_alpha_indexes and palettes_alpha_indexes.
*/
void sortModesAndPalettes();
byte *re_initIndexArray(int numModes);
/**
- * Return an array of mode or palette names from the JSON string.
+ * Retorno an matriz of mode or palette names from the JSON cadena.
* They don't end in '\0', they end in '"'.
*/
const char **re_findModeStrings(const char json[], int numModes);
/**
- * Sort either the modes or the palettes using quicksort.
+ * Sort either the modes or the palettes usando quicksort.
*/
void re_sortModes(const char **modeNames, byte *indexes, int count, int numSkip);
@@ -283,66 +283,66 @@ class RotaryEncoderUIUsermod : public Usermod {
, pinIRQ(PCF8574_INT_PIN)
{}
- /*
- * getId() allows you to optionally give your V2 usermod an unique ID (please define it in const.h!).
- * This could be used in the future for the system to determine whether your usermod is installed.
+ /**
+ * `getId()` permite asignar opcionalmente un ID único a este usermod V2 (defínelo en `constante.h`).
+ * Esto puede usarse para que el sistema determine si el usermod está instalado.
*/
uint16_t getId() override { return USERMOD_ID_ROTARY_ENC_UI; }
/**
- * Enable/Disable the usermod
+ * Habilitar/Deshabilitar the usermod
*/
inline void enable(bool enable) { if (!(pinA<0 || pinB<0 || pinC<0)) enabled = enable; }
/**
- * Get usermod enabled/disabled state
+ * Get usermod enabled/disabled estado
*/
inline bool isEnabled() { return enabled; }
/**
- * setup() is called once at boot. WiFi is not yet connected at this point.
- * You can use it to initialize variables, sensors or similar.
+ * `configuración()` se llama una vez al arrancar. En este punto WiFi aún no está conectado.
+ * Úsalo para inicializar variables, sensores o similares.
*/
void setup() override;
/**
- * connected() is called every time the WiFi is (re)connected
- * Use it to initialize network interfaces
+ * `connected()` se llama cada vez que el WiFi se (re)conecta.
+ * Úsalo para inicializar interfaces de red.
*/
//void connected();
/**
- * loop() is called continuously. Here you can check for events, read sensors, etc.
+ * `bucle()` se llama de forma continua. Aquí puedes comprobar eventos, leer sensores, etc.
*/
void loop() override;
#ifndef WLED_DISABLE_MQTT
- //bool onMqttMessage(char* topic, char* payload) override;
- //void onMqttConnect(bool sessionPresent) override;
+ //bool onMqttMessage(char* topic, char* carga útil) anular;
+ //void onMqttConnect(bool sessionPresent) anular;
#endif
/**
- * handleButton() can be used to override default button behaviour. Returning true
- * will prevent button working in a default way.
+ * handleButton() can be used to anular default button behaviour. Returning verdadero
+ * will prevent button funcionamiento in a default way.
* Replicating button.cpp
*/
- //bool handleButton(uint8_t b) override;
+ //bool handleButton(uint8_t b) anular;
/**
- * addToJsonInfo() can be used to add custom entries to the /json/info part of the JSON API.
+ * `addToJsonInfo()` puede usarse para añadir entradas personalizadas a /JSON/información de la API JSON.
*/
- //void addToJsonInfo(JsonObject &root) override;
+ //void addToJsonInfo(JsonObject &root) anular;
- /**
- * addToJsonState() can be used to add custom entries to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ /*
+ * `addToJsonInfo()` puede usarse para añadir entradas personalizadas a /JSON/información de la API JSON.
+ */
*/
- //void addToJsonState(JsonObject &root) override;
+ //void addToJsonState(JsonObject &root) anular;
/**
- * readFromJsonState() can be used to receive data clients send to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * readFromJsonState() can be used to recibir datos clients enviar to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
- //void readFromJsonState(JsonObject &root) override;
+ //void readFromJsonState(JsonObject &root) anular;
/**
* provide the changeable values
@@ -353,9 +353,9 @@ class RotaryEncoderUIUsermod : public Usermod {
/**
* restore the changeable values
- * readFromConfig() is called before setup() to populate properties from values stored in cfg.json
+ * readFromConfig() is called before configuración() to populate properties from values stored in cfg.JSON
*
- * The function should return true if configuration was successfully loaded or false if there was no configuration.
+ * The función should retorno verdadero if configuration was successfully loaded or falso if there was no configuration.
*/
bool readFromConfig(JsonObject &root) override;
@@ -378,7 +378,7 @@ class RotaryEncoderUIUsermod : public Usermod {
/**
- * readPin() - read rotary encoder pin value
+ * readPin() - leer rotary encoder pin valor
*/
byte RotaryEncoderUIUsermod::readPin(uint8_t pin) {
if (usePcf8574) {
@@ -390,12 +390,12 @@ byte RotaryEncoderUIUsermod::readPin(uint8_t pin) {
}
/**
- * Sort the modes and palettes to the index arrays
+ * Sort the modes and palettes to the índice arrays
* modes_alpha_indexes and palettes_alpha_indexes.
*/
void RotaryEncoderUIUsermod::sortModesAndPalettes() {
DEBUG_PRINT(F("Sorting modes: ")); DEBUG_PRINTLN(strip.getModeCount());
- //modes_qstrings = re_findModeStrings(JSON_mode_names, strip.getModeCount());
+ //modes_qstrings = re_findModeStrings(JSON_mode_names, tira.getModeCount());
modes_qstrings = strip.getModeDataSrc();
modes_alpha_indexes = re_initIndexArray(strip.getModeCount());
re_sortModes(modes_qstrings, modes_alpha_indexes, strip.getModeCount(), MODE_SORT_SKIP_COUNT);
@@ -409,8 +409,8 @@ void RotaryEncoderUIUsermod::sortModesAndPalettes() {
palettes_qstrings[getPaletteCount()-customPalettes.size()+i] = PSTR("~Custom~");
}
}
- // How many palette names start with '*' and should not be sorted?
- // (Also skipping the first one, 'Default').
+ // How many palette names iniciar with '*' and should not be sorted?
+ // (Also skipping the first one, 'Predeterminado').
int skipPaletteCount = 1;
while (pgm_read_byte_near(palettes_qstrings[skipPaletteCount]) == '*') skipPaletteCount++;
re_sortModes(palettes_qstrings, palettes_alpha_indexes, getPaletteCount()-customPalettes.size(), skipPaletteCount);
@@ -425,7 +425,7 @@ byte *RotaryEncoderUIUsermod::re_initIndexArray(int numModes) {
}
/**
- * Return an array of mode or palette names from the JSON string.
+ * Retorno an matriz of mode or palette names from the JSON cadena.
* They don't end in '\0', they end in '"'.
*/
const char **RotaryEncoderUIUsermod::re_findModeStrings(const char json[], int numModes) {
@@ -435,7 +435,7 @@ const char **RotaryEncoderUIUsermod::re_findModeStrings(const char json[], int n
// advance past the mark for markLineNum that may exist.
char singleJsonSymbol;
- // Find the mode name in JSON
+ // Encontrar the mode name in JSON
bool complete = false;
for (size_t i = 0; i < strlen_P(json); i++) {
singleJsonSymbol = pgm_read_byte_near(json + i);
@@ -464,7 +464,7 @@ const char **RotaryEncoderUIUsermod::re_findModeStrings(const char json[], int n
}
/**
- * Sort either the modes or the palettes using quicksort.
+ * Sort either the modes or the palettes usando quicksort.
*/
void RotaryEncoderUIUsermod::re_sortModes(const char **modeNames, byte *indexes, int count, int numSkip) {
if (!modeNames) return;
@@ -478,8 +478,8 @@ void RotaryEncoderUIUsermod::re_sortModes(const char **modeNames, byte *indexes,
/*
- * setup() is called once at boot. WiFi is not yet connected at this point.
- * You can use it to initialize variables, sensors or similar.
+ * configuración() is called once at boot. WiFi is not yet connected at this point.
+ * You can use it to inicializar variables, sensors or similar.
*/
void RotaryEncoderUIUsermod::setup()
{
@@ -540,14 +540,14 @@ void RotaryEncoderUIUsermod::setup()
}
/*
- * loop() is called continuously. Here you can check for events, read sensors, etc.
+ * bucle() is called continuously. Here you can verificar for events, leer sensors, etc.
*
* Tips:
- * 1. You can use "if (WLED_CONNECTED)" to check for a successful network connection.
- * Additionally, "if (WLED_MQTT_CONNECTED)" is available to check for a connection to an MQTT broker.
+ * 1. You can use "if (WLED_CONNECTED)" to verificar for a successful red conexión.
+ * Additionally, "if (WLED_MQTT_CONNECTED)" is available to verificar for a conexión to an MQTT broker.
*
- * 2. Try to avoid using the delay() function. NEVER use delays longer than 10 milliseconds.
- * Instead, use a timer check as shown here.
+ * 2. Intentar to avoid usando the retraso() función. NEVER use delays longer than 10 milliseconds.
+ * Instead, use a temporizador verificar as shown here.
*/
void RotaryEncoderUIUsermod::loop()
{
@@ -555,9 +555,9 @@ void RotaryEncoderUIUsermod::loop()
unsigned long currentTime = millis(); // get the current elapsed time
if (strip.isUpdating() && ((currentTime - loopTime) < ENCODER_MAX_DELAY_MS)) return; // be nice, but not too nice
- // Initialize effectCurrentIndex and effectPaletteIndex to
- // current state. We do it here as (at least) effectCurrent
- // is not yet initialized when setup is called.
+ // Inicializar effectCurrentIndex and effectPaletteIndex to
+ // current estado. We do it here as (at least) effectCurrent
+ // is not yet initialized when configuración is called.
if (!currentEffectAndPaletteInitialized) {
findCurrentEffectAndPalette();
@@ -598,7 +598,7 @@ void RotaryEncoderUIUsermod::loop()
bool changedState = false;
char lineBuffer[64];
do {
- // find new state
+ // encontrar new estado
switch (newState) {
case 0: strcpy_P(lineBuffer, PSTR("Brightness")); changedState = true; break;
case 1: if (!extractModeSlider(effectCurrent, 0, lineBuffer, 63)) newState++; else changedState = true; break; // speed
@@ -715,7 +715,7 @@ bool RotaryEncoderUIUsermod::changeState(const char *stateName, byte markedLine,
#ifdef USERMOD_FOUR_LINE_DISPLAY
if (display != nullptr) {
if (display->wakeDisplay()) {
- // Throw away wake up input
+ // Lanzar away wake up entrada
display->redraw(true);
return false;
}
@@ -729,7 +729,7 @@ bool RotaryEncoderUIUsermod::changeState(const char *stateName, byte markedLine,
void RotaryEncoderUIUsermod::lampUdated() {
//call for notifier -> 0: init 1: direct change 2: button 3: notification 4: nightlight 5: other (No notification)
// 6: fx changed 7: hue 8: preset cycle 9: blynk 10: alexa
- //setValuesFromFirstSelectedSeg(); //to make transition work on main segment (should no longer be required)
+ //setValuesFromFirstSelectedSeg(); //to make transición work on principal segmento (should no longer be required)
stateUpdated(CALL_MODE_BUTTON);
updateInterfaces(CALL_MODE_BUTTON);
}
@@ -738,7 +738,7 @@ void RotaryEncoderUIUsermod::changeBrightness(bool increase) {
#ifdef USERMOD_FOUR_LINE_DISPLAY
if (display && display->wakeDisplay()) {
display->redraw(true);
- // Throw away wake up input
+ // Lanzar away wake up entrada
return;
}
display->updateRedrawTime();
@@ -757,7 +757,7 @@ void RotaryEncoderUIUsermod::changeEffect(bool increase) {
#ifdef USERMOD_FOUR_LINE_DISPLAY
if (display && display->wakeDisplay()) {
display->redraw(true);
- // Throw away wake up input
+ // Lanzar away wake up entrada
return;
}
display->updateRedrawTime();
@@ -786,7 +786,7 @@ void RotaryEncoderUIUsermod::changeEffectSpeed(bool increase) {
#ifdef USERMOD_FOUR_LINE_DISPLAY
if (display && display->wakeDisplay()) {
display->redraw(true);
- // Throw away wake up input
+ // Lanzar away wake up entrada
return;
}
display->updateRedrawTime();
@@ -814,7 +814,7 @@ void RotaryEncoderUIUsermod::changeEffectIntensity(bool increase) {
#ifdef USERMOD_FOUR_LINE_DISPLAY
if (display && display->wakeDisplay()) {
display->redraw(true);
- // Throw away wake up input
+ // Lanzar away wake up entrada
return;
}
display->updateRedrawTime();
@@ -843,7 +843,7 @@ void RotaryEncoderUIUsermod::changeCustom(uint8_t par, bool increase) {
#ifdef USERMOD_FOUR_LINE_DISPLAY
if (display && display->wakeDisplay()) {
display->redraw(true);
- // Throw away wake up input
+ // Lanzar away wake up entrada
return;
}
display->updateRedrawTime();
@@ -887,7 +887,7 @@ void RotaryEncoderUIUsermod::changePalette(bool increase) {
#ifdef USERMOD_FOUR_LINE_DISPLAY
if (display && display->wakeDisplay()) {
display->redraw(true);
- // Throw away wake up input
+ // Lanzar away wake up entrada
return;
}
display->updateRedrawTime();
@@ -916,7 +916,7 @@ void RotaryEncoderUIUsermod::changeHue(bool increase){
#ifdef USERMOD_FOUR_LINE_DISPLAY
if (display && display->wakeDisplay()) {
display->redraw(true);
- // Throw away wake up input
+ // Lanzar away wake up entrada
return;
}
display->updateRedrawTime();
@@ -946,7 +946,7 @@ void RotaryEncoderUIUsermod::changeSat(bool increase){
#ifdef USERMOD_FOUR_LINE_DISPLAY
if (display && display->wakeDisplay()) {
display->redraw(true);
- // Throw away wake up input
+ // Lanzar away wake up entrada
return;
}
display->updateRedrawTime();
@@ -975,7 +975,7 @@ void RotaryEncoderUIUsermod::changePreset(bool increase) {
#ifdef USERMOD_FOUR_LINE_DISPLAY
if (display && display->wakeDisplay()) {
display->redraw(true);
- // Throw away wake up input
+ // Lanzar away wake up entrada
return;
}
display->updateRedrawTime();
@@ -987,13 +987,13 @@ void RotaryEncoderUIUsermod::changePreset(bool increase) {
root["ps"] = str;
deserializeState(root.as(), CALL_MODE_BUTTON_PRESET);
/*
- String apireq = F("win&PL=~");
+ Cadena apireq = F("win&PL=~");
if (!increase) apireq += '-';
apireq += F("&P1=");
apireq += presetLow;
apireq += F("&P2=");
apireq += presetHigh;
- handleSet(nullptr, apireq, false);
+ handleSet(nullptr, apireq, falso);
*/
lampUdated();
#ifdef USERMOD_FOUR_LINE_DISPLAY
@@ -1007,7 +1007,7 @@ void RotaryEncoderUIUsermod::changeCCT(bool increase){
#ifdef USERMOD_FOUR_LINE_DISPLAY
if (display && display->wakeDisplay()) {
display->redraw(true);
- // Throw away wake up input
+ // Lanzar away wake up entrada
return;
}
display->updateRedrawTime();
@@ -1020,8 +1020,8 @@ void RotaryEncoderUIUsermod::changeCCT(bool increase){
seg.setCCT(currentCCT);
}
// } else {
-// Segment& seg = strip.getSegment(strip.getMainSegmentId());
-// seg.setCCT(currentCCT, strip.getMainSegmentId());
+// Segmento& seg = tira.getSegment(tira.getMainSegmentId());
+// seg.setCCT(currentCCT, tira.getMainSegmentId());
// }
lampUdated();
#ifdef USERMOD_FOUR_LINE_DISPLAY
@@ -1032,26 +1032,26 @@ void RotaryEncoderUIUsermod::changeCCT(bool increase){
}
/*
- * addToJsonInfo() can be used to add custom entries to the /json/info part of the JSON API.
- * Creating an "u" object allows you to add custom key/value pairs to the Info section of the WLED web UI.
+ * addToJsonInfo() can be used to add custom entries to the /JSON/información part of the JSON API.
+ * Creating an "u" object allows you to add custom key/valor pairs to the Información section of the WLED web UI.
* Below it is shown how this could be used for e.g. a light sensor
*/
/*
void RotaryEncoderUIUsermod::addToJsonInfo(JsonObject& root)
{
int reading = 20;
- //this code adds "u":{"Light":[20," lux"]} to the info object
- JsonObject user = root["u"];
- if (user.isNull()) user = root.createNestedObject("u");
- JsonArray lightArr = user.createNestedArray("Light"); //name
- lightArr.add(reading); //value
+ //this código adds "u":{"Light":[20," lux"]} to the información object
+ JsonObject usuario = root["u"];
+ if (usuario.isNull()) usuario = root.createNestedObject("u");
+ JsonArray lightArr = usuario.createNestedArray("Light"); //name
+ lightArr.add(reading); //valor
lightArr.add(" lux"); //unit
}
*/
/*
- * addToJsonState() can be used to add custom entries to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * addToJsonState() can be used to add custom entries to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
/*
void RotaryEncoderUIUsermod::addToJsonState(JsonObject &root)
@@ -1061,19 +1061,19 @@ void RotaryEncoderUIUsermod::addToJsonState(JsonObject &root)
*/
/*
- * readFromJsonState() can be used to receive data clients send to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * readFromJsonState() can be used to recibir datos clients enviar to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
/*
void RotaryEncoderUIUsermod::readFromJsonState(JsonObject &root)
{
- //userVar0 = root["user0"] | userVar0; //if "user0" key exists in JSON, update, else keep old value
- //if (root["bri"] == 255) Serial.println(F("Don't burn down your garage!"));
+ //userVar0 = root["user0"] | userVar0; //if "user0" key exists in JSON, actualizar, else keep old valor
+ //if (root["bri"] == 255) Serie.println(F("Don't burn down your garage!"));
}
*/
/**
- * addToConfig() (called from set.cpp) stores persistent properties to cfg.json
+ * addToConfig() (called from set.cpp) stores persistent properties to cfg.JSON
*/
void RotaryEncoderUIUsermod::addToConfig(JsonObject &root) {
// we add JSON object: {"Rotary-Encoder":{"DT-pin":12,"CLK-pin":14,"SW-pin":13}}
@@ -1097,9 +1097,9 @@ void RotaryEncoderUIUsermod::appendConfigData() {
}
/**
- * readFromConfig() is called before setup() to populate properties from values stored in cfg.json
+ * readFromConfig() is called before configuración() to populate properties from values stored in cfg.JSON
*
- * The function should return true if configuration was successfully loaded or false if there was no configuration.
+ * The función should retorno verdadero if configuration was successfully loaded or falso if there was no configuration.
*/
bool RotaryEncoderUIUsermod::readFromConfig(JsonObject &root) {
// we look for JSON object: {"Rotary-Encoder":{"DT-pin":12,"CLK-pin":14,"SW-pin":13}}
@@ -1128,7 +1128,7 @@ bool RotaryEncoderUIUsermod::readFromConfig(JsonObject &root) {
DEBUG_PRINT(FPSTR(_name));
if (!initDone) {
- // first run: reading from cfg.json
+ // first run: reading from cfg.JSON
pinA = newDTpin;
pinB = newCLKpin;
pinC = newSWpin;
@@ -1160,12 +1160,12 @@ bool RotaryEncoderUIUsermod::readFromConfig(JsonObject &root) {
setup();
}
}
- // use "return !top["newestParameter"].isNull();" when updating Usermod with new features
+ // use "retorno !top["newestParameter"].isNull();" when updating Usermod with new features
return !top[FPSTR(_pcfINTpin)].isNull();
}
-// strings to reduce flash memory usage (used more than twice)
+// strings to reduce flash memoria usage (used more than twice)
const char RotaryEncoderUIUsermod::_name[] PROGMEM = "Rotary-Encoder";
const char RotaryEncoderUIUsermod::_enabled[] PROGMEM = "enabled";
const char RotaryEncoderUIUsermod::_DT_pin[] PROGMEM = "DT-pin";
diff --git a/usermods/usermod_v2_word_clock/usermod_v2_word_clock.cpp b/usermods/usermod_v2_word_clock/usermod_v2_word_clock.cpp
index 5100da180d..c994edd5db 100644
--- a/usermods/usermod_v2_word_clock/usermod_v2_word_clock.cpp
+++ b/usermods/usermod_v2_word_clock/usermod_v2_word_clock.cpp
@@ -2,14 +2,14 @@
/*
* Usermods allow you to add own functionality to WLED more easily
- * See: https://github.com/wled-dev/WLED/wiki/Add-own-functionality
+ * See: https://github.com/WLED-dev/WLED/wiki/Add-own-functionality
*
- * This usermod can be used to drive a wordclock with a 11x10 pixel matrix with WLED. There are also 4 additional dots for the minutes.
+ * This usermod can be used to drive a wordclock with a 11x10 píxel matrix with WLED. There are also 4 additional dots for the minutes.
* The visualisation is described in 4 mask with LED numbers (single dots for minutes, minutes, hours and "clock/Uhr").
* There are 2 parameters to change the behaviour:
*
- * active: enable/disable usermod
- * diplayItIs: enable/disable display of "Es ist" on the clock.
+ * active: habilitar/deshabilitar usermod
+ * diplayItIs: habilitar/deshabilitar display of "Es ist" on the clock.
*/
class WordClockUsermod : public Usermod
@@ -18,7 +18,7 @@ class WordClockUsermod : public Usermod
unsigned long lastTime = 0;
int lastTimeMinutes = -1;
- // set your config variables to their boot default value (this can also be done in readFromConfig() or a constructor if you prefer)
+ // set your config variables to their boot default valor (this can also be done in readFromConfig() or a constructor if you prefer)
bool usermodActive = false;
bool displayItIs = false;
int ledOffset = 100;
@@ -116,7 +116,7 @@ class WordClockUsermod : public Usermod
// mask minute dots
const int maskMinuteDots[maskSizeMinuteDots] = {110, 111, 112, 113};
- // overall mask to define which LEDs are on
+ // overall mask to definir which LEDs are on
int maskLedsOn[maskSizeLeds] =
{
0,0,0,0,0,0,0,0,0,0,0,
@@ -132,13 +132,13 @@ class WordClockUsermod : public Usermod
0,0,0,0
};
- // update led mask
+ // actualizar LED mask
void updateLedMask(const int wordMask[], int arraySize)
{
- // loop over array
+ // bucle over matriz
for (int x=0; x < arraySize; x++)
{
- // check if mask has a valid LED number
+ // verificar if mask has a valid LED number
if (wordMask[x] >= 0 && wordMask[x] < maskSizeLeds)
{
// turn LED on
@@ -158,7 +158,7 @@ class WordClockUsermod : public Usermod
index = 12;
}
- // check if we get an overrun of 12 o´clock
+ // verificar if we get an overrun of 12 o´clock
if (hours == 13)
{
index = 1;
@@ -170,7 +170,7 @@ class WordClockUsermod : public Usermod
index = 0;
}
- // update led mask
+ // actualizar LED mask
if (meander)
{
updateLedMask(maskHoursMea[index], maskSizeHoursMea);
@@ -182,7 +182,7 @@ class WordClockUsermod : public Usermod
// set minutes
void setMinutes(int index)
{
- // update led mask
+ // actualizar LED mask
if (meander)
{
updateLedMask(maskMinutesMea[index], maskSizeMinutesMea);
@@ -197,7 +197,7 @@ class WordClockUsermod : public Usermod
// modulo to get minute dots
int minutesDotCount = minutes % 5;
- // check if minute dots are active
+ // verificar if minute dots are active
if (minutesDotCount > 0)
{
// activate all minute dots until number is reached
@@ -209,10 +209,10 @@ class WordClockUsermod : public Usermod
}
}
- // update the display
+ // actualizar the display
void updateDisplay(uint8_t hours, uint8_t minutes)
{
- // disable complete matrix at the bigging
+ // deshabilitar complete matrix at the bigging
for (int x = 0; x < maskSizeLeds; x++)
{
maskLedsOn[x] = 0;
@@ -227,7 +227,7 @@ class WordClockUsermod : public Usermod
// set single minute dots
setSingleMinuteDots(minutes);
- // switch minutes
+ // conmutador minutes
switch (minutes / 5)
{
case 0:
@@ -309,27 +309,27 @@ class WordClockUsermod : public Usermod
//Functions called by WLED
/*
- * setup() is called once at boot. WiFi is not yet connected at this point.
- * You can use it to initialize variables, sensors or similar.
+ * `configuración()` se llama una vez al arrancar. En este punto WiFi aún no está conectado.
+ * Úsalo para inicializar variables, sensores o similares.
*/
void setup()
{
}
/*
- * connected() is called every time the WiFi is (re)connected
- * Use it to initialize network interfaces
+ * `connected()` se llama cada vez que el WiFi se (re)conecta.
+ * Úsalo para inicializar interfaces de red.
*/
void connected()
{
}
-
- /*
- * loop() is called continuously. Here you can check for events, read sensors, etc.
- *
- * Tips:
- * 1. You can use "if (WLED_CONNECTED)" to check for a successful network connection.
- * Additionally, "if (WLED_MQTT_CONNECTED)" is available to check for a connection to an MQTT broker.
+ /*
+ * `bucle()` se llama de forma continua. Aquí puedes comprobar eventos, leer sensores, etc.
+ *
+ * Consejos:
+ * 1. Puedes usar "if (WLED_CONNECTED)" para comprobar una conexión de red.
+ * Adicionalmente, "if (WLED_MQTT_CONNECTED)" permite comprobar la conexión al broker MQTT.
+ */
*
* 2. Try to avoid using the delay() function. NEVER use delays longer than 10 milliseconds.
* Instead, use a timer check as shown here.
@@ -339,27 +339,27 @@ class WordClockUsermod : public Usermod
// do it every 5 seconds
if (millis() - lastTime > 5000)
{
- // check the time
+ // verificar the time
int minutes = minute(localTime);
- // check if we already updated this minute
+ // verificar if we already updated this minute
if (lastTimeMinutes != minutes)
{
- // update the display with new time
+ // actualizar the display with new time
updateDisplay(hourFormat12(localTime), minute(localTime));
- // remember last update time
+ // remember last actualizar time
lastTimeMinutes = minutes;
}
- // remember last update
+ // remember last actualizar
lastTime = millis();
}
}
/*
- * addToJsonInfo() can be used to add custom entries to the /json/info part of the JSON API.
- * Creating an "u" object allows you to add custom key/value pairs to the Info section of the WLED web UI.
+ * addToJsonInfo() can be used to add custom entries to the /JSON/información part of the JSON API.
+ * Creating an "u" object allows you to add custom key/valor pairs to the Información section of the WLED web UI.
* Below it is shown how this could be used for e.g. a light sensor
*/
/*
@@ -369,53 +369,53 @@ class WordClockUsermod : public Usermod
*/
/*
- * addToJsonState() can be used to add custom entries to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * addToJsonState() can be used to add custom entries to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
void addToJsonState(JsonObject& root)
{
}
/*
- * readFromJsonState() can be used to receive data clients send to the /json/state part of the JSON API (state object).
- * Values in the state object may be modified by connected clients
+ * readFromJsonState() can be used to recibir datos clients enviar to the /JSON/estado part of the JSON API (estado object).
+ * Values in the estado object may be modified by connected clients
*/
void readFromJsonState(JsonObject& root)
{
}
/*
- * addToConfig() can be used to add custom persistent settings to the cfg.json file in the "um" (usermod) object.
+ * addToConfig() can be used to add custom persistent settings to the cfg.JSON archivo in the "um" (usermod) object.
* It will be called by WLED when settings are actually saved (for example, LED settings are saved)
- * If you want to force saving the current state, use serializeConfig() in your loop().
+ * If you want to force saving the current estado, use serializeConfig() in your bucle().
*
- * CAUTION: serializeConfig() will initiate a filesystem write operation.
+ * CAUTION: serializeConfig() will initiate a filesystem escribir operation.
* It might cause the LEDs to stutter and will cause flash wear if called too often.
- * Use it sparingly and always in the loop, never in network callbacks!
+ * Use it sparingly and always in the bucle, never in red callbacks!
*
* addToConfig() will make your settings editable through the Usermod Settings page automatically.
*
* Usermod Settings Overview:
* - Numeric values are treated as floats in the browser.
- * - If the numeric value entered into the browser contains a decimal point, it will be parsed as a C float
- * before being returned to the Usermod. The float data type has only 6-7 decimal digits of precision, and
- * doubles are not supported, numbers will be rounded to the nearest float value when being parsed.
- * The range accepted by the input field is +/- 1.175494351e-38 to +/- 3.402823466e+38.
- * - If the numeric value entered into the browser doesn't contain a decimal point, it will be parsed as a
- * C int32_t (range: -2147483648 to 2147483647) before being returned to the usermod.
- * Overflows or underflows are truncated to the max/min value for an int32_t, and again truncated to the type
- * used in the Usermod when reading the value from ArduinoJson.
- * - Pin values can be treated differently from an integer value by using the key name "pin"
- * - "pin" can contain a single or array of integer values
+ * - If the numeric valor entered into the browser contains a decimal point, it will be parsed as a C flotante
+ * before being returned to the Usermod. The flotante datos tipo has only 6-7 decimal digits of precisión, and
+ * doubles are not supported, numbers will be rounded to the nearest flotante valor when being parsed.
+ * The rango accepted by the entrada campo is +/- 1.175494351e-38 to +/- 3.402823466e+38.
+ * - If the numeric valor entered into the browser doesn't contain a decimal point, it will be parsed as a
+ * C int32_t (rango: -2147483648 to 2147483647) before being returned to the usermod.
+ * Overflows or underflows are truncated to the max/min valor for an int32_t, and again truncated to the tipo
+ * used in the Usermod when reading the valor from ArduinoJson.
+ * - Pin values can be treated differently from an entero valor by usando the key name "pin"
+ * - "pin" can contain a single or matriz of entero values
* - On the Usermod Settings page there is simple checking for pin conflicts and warnings for special pins
- * - Red color indicates a conflict. Yellow color indicates a pin with a warning (e.g. an input-only pin)
- * - Tip: use int8_t to store the pin value in the Usermod, so a -1 value (pin not set) can be used
+ * - Red color indicates a conflicto. Yellow color indicates a pin with a advertencia (e.g. an entrada-only pin)
+ * - Tip: use int8_t to store the pin valor in the Usermod, so a -1 valor (pin not set) can be used
*
* See usermod_v2_auto_save.h for an example that saves Flash space by reusing ArduinoJson key name strings
*
* If you need a dedicated settings page with custom layout for your Usermod, that takes a lot more work.
- * You will have to add the setting to the HTML, xml.cpp and set.cpp manually.
- * See the WLED Soundreactive fork (code and wiki) for reference. https://github.com/atuline/WLED
+ * You will have to add the setting to the HTML, XML.cpp and set.cpp manually.
+ * See the WLED Soundreactive bifurcación (código and wiki) for reference. https://github.com/atuline/WLED
*
* I highly recommend checking out the basics of ArduinoJson serialization and deserialization in order to use custom settings!
*/
@@ -436,24 +436,24 @@ class WordClockUsermod : public Usermod
}
/*
- * readFromConfig() can be used to read back the custom settings you added with addToConfig().
+ * readFromConfig() can be used to leer back the custom settings you added with addToConfig().
* This is called by WLED when settings are loaded (currently this only happens immediately after boot, or after saving on the Usermod Settings page)
*
- * readFromConfig() is called BEFORE setup(). This means you can use your persistent values in setup() (e.g. pin assignments, buffer sizes),
- * but also that if you want to write persistent values to a dynamic buffer, you'd need to allocate it here instead of in setup.
+ * readFromConfig() is called BEFORE configuración(). This means you can use your persistent values in configuración() (e.g. pin assignments, búfer sizes),
+ * but also that if you want to escribir persistent values to a dynamic búfer, you'd need to allocate it here instead of in configuración.
* If you don't know what that is, don't fret. It most likely doesn't affect your use case :)
*
- * Return true in case the config values returned from Usermod Settings were complete, or false if you'd like WLED to save your defaults to disk (so any missing values are editable in Usermod Settings)
+ * Retorno verdadero in case the config values returned from Usermod Settings were complete, or falso if you'd like WLED to guardar your defaults to disk (so any missing values are editable in Usermod Settings)
*
- * getJsonValue() returns false if the value is missing, or copies the value into the variable provided and returns true if the value is present
- * The configComplete variable is true only if the "exampleUsermod" object and all values are present. If any values are missing, WLED will know to call addToConfig() to save them
+ * getJsonValue() returns falso if the valor is missing, or copies the valor into the variable provided and returns verdadero if the valor is present
+ * The configComplete variable is verdadero only if the "exampleUsermod" object and all values are present. If any values are missing, WLED will know to call addToConfig() to guardar them
*
- * This function is guaranteed to be called on boot, but could also be called every time settings are updated
+ * This función is guaranteed to be called on boot, but could also be called every time settings are updated
*/
bool readFromConfig(JsonObject& root)
{
- // default settings values could be set here (or below using the 3-argument getJsonValue()) instead of in the class definition or constructor
- // setting them inside readFromConfig() is slightly more robust, handling the rare but plausible use case of single value being missing after boot (e.g. if the cfg.json was manually edited and a value was removed)
+ // default settings values could be set here (or below usando the 3-argumento getJsonValue()) instead of in the clase definition or constructor
+ // setting them inside readFromConfig() is slightly more robust, handling the rare but plausible use case of single valor being missing after boot (e.g. if the cfg.JSON was manually edited and a valor was removed)
JsonObject top = root[F("WordClockUsermod")];
@@ -469,22 +469,22 @@ class WordClockUsermod : public Usermod
}
/*
- * handleOverlayDraw() is called just before every show() (LED strip update frame) after effects have set the colors.
- * Use this to blank out some LEDs or set them to a different color regardless of the set effect mode.
- * Commonly used for custom clocks (Cronixie, 7 segment)
+ * handleOverlayDraw() is called just before every show() (LED tira actualizar frame) after effects have set the colors.
+ * Use this to blank out some LEDs or set them to a different color regardless of the set efecto mode.
+ * Commonly used for custom clocks (Cronixie, 7 segmento)
*/
void handleOverlayDraw()
{
- // check if usermod is active
+ // verificar if usermod is active
if (usermodActive == true)
{
- // loop over all leds
+ // bucle over all leds
for (int x = 0; x < maskSizeLeds; x++)
{
- // check mask
+ // verificar mask
if (maskLedsOn[x] == 0)
{
- // set pixel off
+ // set píxel off
strip.setPixelColor(x + ledOffset, RGBW32(0,0,0,0));
}
}
@@ -492,16 +492,16 @@ class WordClockUsermod : public Usermod
}
/*
- * getId() allows you to optionally give your V2 usermod an unique ID (please define it in const.h!).
- * This could be used in the future for the system to determine whether your usermod is installed.
+ * getId() allows you to optionally give your V2 usermod an unique ID (please definir it in constante.h!).
+ * This could be used in the futuro for the sistema to determine whether your usermod is installed.
*/
uint16_t getId()
{
return USERMOD_ID_WORDCLOCK;
}
- //More methods can be added in the future, this example will then be extended.
- //Your usermod will remain compatible as it does not need to implement all methods from the Usermod base class!
+ //More methods can be added in the futuro, this example will then be extended.
+ //Your usermod will remain compatible as it does not need to implement all methods from the Usermod base clase!
};
static WordClockUsermod usermod_v2_word_clock;
diff --git a/usermods/wizlights/wizlights.cpp b/usermods/wizlights/wizlights.cpp
index 3ac756b12a..cde6f2f650 100644
--- a/usermods/wizlights/wizlights.cpp
+++ b/usermods/wizlights/wizlights.cpp
@@ -1,7 +1,7 @@
#include "wled.h"
#include
-// Maximum number of lights supported
+// Máximo number of lights supported
#define MAX_WIZ_LIGHTS 15
WiFiUDP UDP;
@@ -33,7 +33,7 @@ class WizLightsUsermod : public Usermod {
- // Send JSON blob to WiZ Light over UDP
+ // Enviar JSON blob to WiZ Light over UDP
// RGB or C/W white
// TODO:
// Better utilize WLED existing white mixing logic
@@ -59,7 +59,7 @@ class WizLightsUsermod : public Usermod {
if (coldWhite > 0 && warmWhite > 0){
UDP.print("{\"method\":\"setPilot\",\"params\":{\"c\":"); UDP.print(coldWhite) ;UDP.print(",\"w\":"); UDP.print(warmWhite); UDP.print("}}");}
- // Send color as RGB
+ // Enviar color as RGB
} else {
UDP.print("{\"method\":\"setPilot\",\"params\":{\"r\":");
UDP.print(R(color));
@@ -73,13 +73,13 @@ class WizLightsUsermod : public Usermod {
UDP.endPacket();
}
- // Override definition so it compiles
+ // Anular definition so it compiles
void setup() {
}
- // TODO: Check millis() rollover
+ // TODO: Verificar millis() rollover
void loop() {
// Make sure we are connected first
@@ -135,13 +135,13 @@ class WizLightsUsermod : public Usermod {
configComplete &= getJsonValue(top["Always Force Update"], forceUpdate, false); // Update wiz light every loop, even if color value has not changed
configComplete &= getJsonValue(top["Force Update Every x Minutes"], forceUpdateMinutes, 5); // Update wiz light if color value has not changed, every x minutes
- // Read list of IPs
+ // Leer lista of IPs
String tempIp;
for (uint8_t i = 0; i < MAX_WIZ_LIGHTS; i++) {
configComplete &= getJsonValue(top[getJsonLabel(i)], tempIp, "0.0.0.0");
lightsValid[i] = lightsIP[i].fromString(tempIp);
- // If the IP is not valid, force the value to be empty
+ // If the IP is not valid, force the valor to be empty
if (!lightsValid[i]){lightsIP[i].fromString("0.0.0.0");}
}
@@ -149,7 +149,7 @@ class WizLightsUsermod : public Usermod {
}
- // Create label for the usermod page (I cannot make it work with JSON arrays...)
+ // Crear label for the usermod page (I cannot make it work with JSON arrays...)
String getJsonLabel(uint8_t i) {return "WiZ Light IP #" + String(i+1);}
uint16_t getId(){return USERMOD_ID_WIZLIGHTS;}
diff --git a/usermods/word-clock-matrix/word-clock-matrix.cpp b/usermods/word-clock-matrix/word-clock-matrix.cpp
index 24f69aadb7..96e1078b8b 100644
--- a/usermods/word-clock-matrix/word-clock-matrix.cpp
+++ b/usermods/word-clock-matrix/word-clock-matrix.cpp
@@ -2,7 +2,7 @@
/*
* Things to do...
- * Turn on ntp clock 24h format
+ * Turn on ntp clock 24h formato
* 64 LEDS
*/
@@ -20,20 +20,20 @@ class WordClockMatrix : public Usermod
{
Serial.println("Hello from my usermod!");
- //saveMacro(14, "A=128", false);
- //saveMacro(15, "A=64", false);
- //saveMacro(16, "A=16", false);
+ //saveMacro(14, "A=128", falso);
+ //saveMacro(15, "A=64", falso);
+ //saveMacro(16, "A=16", falso);
- //saveMacro(1, "&FX=0&R=255&G=255&B=255", false);
+ //saveMacro(1, "&FX=0&R=255&G=255&B=255", falso);
- //strip.getSegment(1).setOption(SEG_OPTION_SELECTED, true);
+ //tira.getSegment(1).setOption(SEG_OPTION_SELECTED, verdadero);
//select first two segments (background color + FX settable)
Segment &seg = strip.getSegment(0);
seg.colors[0] = ((0 << 24) | ((0 & 0xFF) << 16) | ((0 & 0xFF) << 8) | ((0 & 0xFF)));
strip.getSegment(0).setOption(0, false);
strip.getSegment(0).setOption(2, false);
- //other segments are text
+ //other segments are texto
for (int i = 1; i < 10; i++)
{
Segment &text_seg = strip.getSegment(i);
@@ -52,24 +52,24 @@ class WordClockMatrix : public Usermod
{
for (int i = 1; i < 10; i++)
{
- //WS2812FX::Segment &seg = strip.getSegment(i);
+ //WS2812FX::Segmento &seg = tira.getSegment(i);
strip.getSegment(i).setOption(0, state);
- // strip.getSegment(1).setOption(SEG_OPTION_SELECTED, true);
+ // tira.getSegment(1).setOption(SEG_OPTION_SELECTED, verdadero);
//seg.mode = 12;
//seg.palette = 1;
- //strip.setBrightness(255);
+ //tira.setBrightness(255);
}
strip.getSegment(0).setOption(0, !state);
}
void hourChime()
{
- //strip.resetSegments();
+ //tira.resetSegments();
selectWordSegments(true);
colorUpdated(CALL_MODE_FX_CHANGED);
savePreset(13);
selectWordSegments(false);
- //strip.getSegment(0).setOption(0, true);
+ //tira.getSegment(0).setOption(0, verdadero);
strip.getSegment(0).setOption(2, true);
applyPreset(12);
colorUpdated(CALL_MODE_FX_CHANGED);
@@ -100,11 +100,11 @@ class WordClockMatrix : public Usermod
}
else if (minute == 10)
{
- //strip.getSegment(5).setGeometry(6, 8); //ten
+ //tira.getSegment(5).setGeometry(6, 8); //ten
}
else if (minute == 5)
{
- //strip.getSegment(5).setGeometry(16, 18); //five
+ //tira.getSegment(5).setGeometry(16, 18); //five
}
else if (minute == 0)
{
@@ -126,14 +126,14 @@ class WordClockMatrix : public Usermod
}
else if (minute > 34)
{
- //strip.getSegment(6).setGeometry(22, 24); //to
+ //tira.getSegment(6).setGeometry(22, 24); //to
//minute = 60 - minute;
isToHour = true;
}
else
{
- //strip.getSegment(4).setGeometry(24, 27); //past
- //isToHour = false;
+ //tira.getSegment(4).setGeometry(24, 27); //past
+ //isToHour = falso;
}
}
@@ -262,7 +262,7 @@ class WordClockMatrix : public Usermod
void timeOfDay()
{
// NOT USED: use timed macros instead
- //Used to set brightness dependant of time of day - lights dimmed at night
+ //Used to set brillo dependant of time of day - lights dimmed at night
//monday to thursday and sunday
@@ -290,12 +290,12 @@ class WordClockMatrix : public Usermod
}
}
- //loop. You can use "if (WLED_CONNECTED)" to check for successful connection
+ //bucle. You can use "if (WLED_CONNECTED)" to verificar for successful conexión
void loop()
{
if (millis() - lastTime > 1000) {
- //Serial.println("I'm alive!");
+ //Serie.println("I'm alive!");
Serial.println(hour(localTime));
lastTime = millis();
}
@@ -313,7 +313,7 @@ class WordClockMatrix : public Usermod
}
if (minute(localTime) == 1)
{
- //turn off background segment;
+ //turn off background segmento;
strip.getSegment(0).setOption(2, false);
//applyPreset(13);
}
diff --git a/wled00/FX.cpp b/wled00/FX.cpp
index eb72ff4f9d..d06bb247d6 100644
--- a/wled00/FX.cpp
+++ b/wled00/FX.cpp
@@ -1,11 +1,11 @@
/*
- WS2812FX.cpp contains all effect methods
+ WS2812FX.cpp contains all efecto methods
Harm Aldick - 2016
www.aldick.org
Copyright (c) 2016 Harm Aldick
Licensed under the EUPL v. 1.2 or later
- Adapted from code originally licensed under the MIT license
+ Adapted from código originally licensed under the MIT license
Modified heavily for WLED
*/
@@ -37,32 +37,32 @@
#endif
//////////////
- // DEV INFO //
+ // DEV INFORMACIÓN //
//////////////
/*
- information for FX metadata strings: https://kno.wled.ge/interfaces/json-api/#effect-metadata
+ information for FX metadata strings: https://kno.WLED.ge/interfaces/JSON-API/#efecto-metadata
- Audio Reactive: use the following code to pass usermod variables to effect
+ Audio Reactive: use the following código to pass usermod variables to efecto
uint8_t *binNum = (uint8_t*)&SEGENV.aux1, *maxVol = (uint8_t*)(&SEGENV.aux1+1); // just in case assignment
- bool samplePeak = false;
- float FFT_MajorPeak = 1.0;
+ bool samplePeak = falso;
+ flotante FFT_MajorPeak = 1.0;
uint8_t *fftResult = nullptr;
- float *fftBin = nullptr;
+ flotante *fftBin = nullptr;
um_data_t *um_data = getAudioData();
- volumeSmth = *(float*) um_data->u_data[0];
- volumeRaw = *(float*) um_data->u_data[1];
+ volumeSmth = *(flotante*) um_data->u_data[0];
+ volumeRaw = *(flotante*) um_data->u_data[1];
fftResult = (uint8_t*) um_data->u_data[2];
samplePeak = *(uint8_t*) um_data->u_data[3];
- FFT_MajorPeak = *(float*) um_data->u_data[4];
- my_magnitude = *(float*) um_data->u_data[5];
- maxVol = (uint8_t*) um_data->u_data[6]; // requires UI element (SEGMENT.customX?), changes source element
- binNum = (uint8_t*) um_data->u_data[7]; // requires UI element (SEGMENT.customX?), changes source element
- fftBin = (float*) um_data->u_data[8];
+ FFT_MajorPeak = *(flotante*) um_data->u_data[4];
+ my_magnitude = *(flotante*) um_data->u_data[5];
+ maxVol = (uint8_t*) um_data->u_data[6]; // requires UI element (SEGMENTO.customX?), changes source element
+ binNum = (uint8_t*) um_data->u_data[7]; // requires UI element (SEGMENTO.customX?), changes source element
+ fftBin = (flotante*) um_data->u_data[8];
*/
#define IBN 5100
-// paletteBlend: 0 - wrap when moving, 1 - always wrap, 2 - never wrap, 3 - none (undefined)
+// paletteBlend: 0 - wrap when moving, 1 - always wrap, 2 - never wrap, 3 - none (indefinido)
#define PALETTE_SOLID_WRAP (strip.paletteBlend == 1 || strip.paletteBlend == 3)
#define PALETTE_MOVING_WRAP !(strip.paletteBlend == 2 || (strip.paletteBlend == 0 && SEGMENT.speed == 0))
@@ -73,13 +73,13 @@
#define MAX_FREQUENCY 11025 // sample frequency / 2 (as per Nyquist criterion)
#define MAX_FREQ_LOG10 4.04238f // log10(MAX_FREQUENCY)
// for 20Khz sampling
-//#define MAX_FREQUENCY 10240
-//#define MAX_FREQ_LOG10 4.0103f
+//#definir MAX_FREQUENCY 10240
+//#definir MAX_FREQ_LOG10 4.0103f
// for 10Khz sampling
-//#define MAX_FREQUENCY 5120
-//#define MAX_FREQ_LOG10 3.71f
+//#definir MAX_FREQUENCY 5120
+//#definir MAX_FREQ_LOG10 3.71f
-// effect utility functions
+// efecto utility functions
uint8_t sin_gap(uint16_t in) {
if (in & 0x100) return 0;
return sin8_t(in + 192); // correct phase shift of sine so that it starts and stops at 0
@@ -92,10 +92,10 @@ uint16_t triwave16(uint16_t in) {
/*
* Generates a tristate square wave w/ attac & decay
- * @param x input value 0-255
+ * @param x entrada valor 0-255
* @param pulsewidth 0-127
* @param attdec attack & decay, max. pulsewidth / 2
- * @returns signed waveform value
+ * @returns signed waveform valor
*/
int8_t tristate_square8(uint8_t x, uint8_t pulsewidth, uint8_t attdec) {
int8_t a = 127;
@@ -126,10 +126,10 @@ static um_data_t* getAudioData() {
}
-// effect functions
+// efecto functions
/*
- * No blinking. Just plain old static light.
+ * No blinking. Just plain old estático light.
*/
uint16_t mode_static(void) {
SEGMENT.fill(SEGCOLOR(0));
@@ -138,7 +138,7 @@ uint16_t mode_static(void) {
static const char _data_FX_MODE_STATIC[] PROGMEM = "Solid";
/*
- * Copy a segment and perform (optional) color adjustments
+ * Copy a segmento and perform (optional) color adjustments
*/
uint16_t mode_copy_segment(void) {
uint32_t sourceid = SEGMENT.custom3;
@@ -190,9 +190,9 @@ static const char _data_FX_MODE_COPY[] PROGMEM = "Copy Segment@,Color shift,Ligh
/*
- * Blink/strobe function
+ * Blink/strobe función
* Alternate between color1 and color2
- * if(strobe == true) then create a strobe effect
+ * if(strobe == verdadero) then crear a strobe efecto
*/
uint16_t blink(uint32_t color1, uint32_t color2, bool strobe, bool do_palette) {
uint32_t cycleTime = (255 - SEGMENT.speed)*20;
@@ -223,7 +223,7 @@ uint16_t blink(uint32_t color1, uint32_t color2, bool strobe, bool do_palette) {
/*
- * Normal blinking. Intensity sets duty cycle.
+ * Normal blinking. Intensidad sets duty cycle.
*/
uint16_t mode_blink(void) {
return blink(SEGCOLOR(0), SEGCOLOR(1), false, true);
@@ -232,7 +232,7 @@ static const char _data_FX_MODE_BLINK[] PROGMEM = "Blink@!,Duty cycle;!,!;!;01";
/*
- * Classic Blink effect. Cycling through the rainbow.
+ * Classic Blink efecto. Cycling through the rainbow.
*/
uint16_t mode_blink_rainbow(void) {
return blink(SEGMENT.color_wheel(SEGENV.call & 0xFF), SEGCOLOR(1), false, false);
@@ -241,7 +241,7 @@ static const char _data_FX_MODE_BLINK_RAINBOW[] PROGMEM = "Blink Rainbow@Frequen
/*
- * Classic Strobe effect.
+ * Classic Strobe efecto.
*/
uint16_t mode_strobe(void) {
return blink(SEGCOLOR(0), SEGCOLOR(1), true, true);
@@ -250,7 +250,7 @@ static const char _data_FX_MODE_STROBE[] PROGMEM = "Strobe@!;!,!;!;01";
/*
- * Classic Strobe effect. Cycling through the rainbow.
+ * Classic Strobe efecto. Cycling through the rainbow.
*/
uint16_t mode_strobe_rainbow(void) {
return blink(SEGMENT.color_wheel(SEGENV.call & 0xFF), SEGCOLOR(1), true, false);
@@ -259,9 +259,9 @@ static const char _data_FX_MODE_STROBE_RAINBOW[] PROGMEM = "Strobe Rainbow@!;,!;
/*
- * Color wipe function
+ * Color wipe función
* LEDs are turned on (color1) in sequence, then turned off (color2) in sequence.
- * if (bool rev == true) then LEDs are turned off in reverse order
+ * if (bool rev == verdadero) then LEDs are turned off in reverse order
*/
uint16_t color_wipe(bool rev, bool useRandomColors) {
if (SEGLEN <= 1) return mode_static();
@@ -344,7 +344,7 @@ static const char _data_FX_MODE_COLOR_WIPE_RANDOM[] PROGMEM = "Wipe Random@!;;!"
/*
- * Random color introduced alternating from start and end of strip.
+ * Random color introduced alternating from iniciar and end of tira.
*/
uint16_t mode_color_sweep_random(void) {
return color_wipe(true, true);
@@ -393,7 +393,7 @@ uint16_t mode_dynamic(void) {
if (!SEGENV.allocateData(SEGLEN)) return mode_static(); //allocation failed
if(SEGENV.call == 0) {
- //SEGMENT.fill(BLACK);
+ //SEGMENTO.fill(BLACK);
for (unsigned i = 0; i < SEGLEN; i++) SEGENV.data[i] = hw_random8();
}
@@ -422,7 +422,7 @@ static const char _data_FX_MODE_DYNAMIC[] PROGMEM = "Dynamic@!,!,,,,Smooth;;!";
/*
- * effect "Dynamic" with smooth color-fading
+ * efecto "Dinámico" with smooth color-fading
*/
uint16_t mode_dynamic_smooth(void) {
bool old = SEGMENT.check1;
@@ -473,7 +473,7 @@ static const char _data_FX_MODE_FADE[] PROGMEM = "Fade@!;!,!;!;01";
/*
- * Scan mode parent function
+ * Scan mode parent función
*/
uint16_t scan(bool dual) {
if (SEGLEN <= 1) return mode_static();
@@ -504,7 +504,7 @@ uint16_t scan(bool dual) {
/*
- * Runs a single pixel back and forth.
+ * Runs a single píxel back and forth.
*/
uint16_t mode_scan(void) {
return scan(false);
@@ -513,7 +513,7 @@ static const char _data_FX_MODE_SCAN[] PROGMEM = "Scan@!,# of dots,,,,,Overlay;!
/*
- * Runs two pixel back and forth in opposite directions.
+ * Runs two píxel back and forth in opposite directions.
*/
uint16_t mode_dual_scan(void) {
return scan(true);
@@ -540,14 +540,14 @@ static const char _data_FX_MODE_RAINBOW[] PROGMEM = "Colorloop@!,Saturation;;!;0
/*
- * Cycles a rainbow over the entire string of LEDs.
+ * Cycles a rainbow over the entire cadena of LEDs.
*/
uint16_t mode_rainbow_cycle(void) {
unsigned counter = (strip.now * ((SEGMENT.speed >> 2) +2)) & 0xFFFF;
counter = counter >> 8;
for (unsigned i = 0; i < SEGLEN; i++) {
- //intensity/29 = 0 (1/16) 1 (1/8) 2 (1/4) 3 (1/2) 4 (1) 5 (2) 6 (4) 7 (8) 8 (16)
+ //intensidad/29 = 0 (1/16) 1 (1/8) 2 (1/4) 3 (1/2) 4 (1) 5 (2) 6 (4) 7 (8) 8 (16)
uint8_t index = (i * (16 << (SEGMENT.intensity /29)) / SEGLEN) + counter;
SEGMENT.setPixelColor(i, SEGMENT.color_wheel(index));
}
@@ -558,7 +558,7 @@ static const char _data_FX_MODE_RAINBOW_CYCLE[] PROGMEM = "Rainbow@!,Size;;!";
/*
- * Alternating pixels running function.
+ * Alternating pixels running función.
*/
static uint16_t running(uint32_t color1, uint32_t color2, bool theatre = false) {
int width = (theatre ? 3 : 1) + (SEGMENT.intensity >> 4); // window
@@ -597,7 +597,7 @@ static const char _data_FX_MODE_THEATER_CHASE[] PROGMEM = "Theater@!,Gap size;!,
/*
- * Theatre-style crawling lights with rainbow effect.
+ * Theatre-style crawling lights with rainbow efecto.
* Inspired by the Adafruit examples.
*/
uint16_t mode_theater_chase_rainbow(void) {
@@ -607,7 +607,7 @@ static const char _data_FX_MODE_THEATER_CHASE_RAINBOW[] PROGMEM = "Theater Rainb
/*
- * Running lights effect with smooth sine transition base.
+ * Running lights efecto with smooth sine transición base.
*/
static uint16_t running_base(bool saw, bool dual=false) {
unsigned x_scale = SEGMENT.intensity >> 2;
@@ -642,7 +642,7 @@ static uint16_t running_base(bool saw, bool dual=false) {
/*
* Running lights in opposite directions.
- * Idea: Make the gap width controllable with a third slider in the future
+ * Idea: Make the gap width controllable with a third slider in the futuro
*/
uint16_t mode_running_dual(void) {
return running_base(false, true);
@@ -651,7 +651,7 @@ static const char _data_FX_MODE_RUNNING_DUAL[] PROGMEM = "Running Dual@!,Wave wi
/*
- * Running lights effect with smooth sine transition.
+ * Running lights efecto with smooth sine transición.
*/
uint16_t mode_running_lights(void) {
return running_base(false);
@@ -660,7 +660,7 @@ static const char _data_FX_MODE_RUNNING_LIGHTS[] PROGMEM = "Running@!,Wave width
/*
- * Running lights effect with sawtooth transition.
+ * Running lights efecto with sawtooth transición.
*/
uint16_t mode_saw(void) {
return running_base(true);
@@ -669,8 +669,8 @@ static const char _data_FX_MODE_SAW[] PROGMEM = "Saw@!,Width;!,!;!";
/*
- * Blink several LEDs in random colors on, reset, repeat.
- * Inspired by www.tweaking4all.com/hardware/arduino/adruino-led-strip-effects/
+ * Blink several LEDs in random colors on, restablecer, repeat.
+ * Inspired by www.tweaking4all.com/hardware/arduino/adruino-LED-tira-effects/
*/
uint16_t mode_twinkle(void) {
SEGMENT.fade_out(224);
@@ -705,7 +705,7 @@ static const char _data_FX_MODE_TWINKLE[] PROGMEM = "Twinkle@!,!;!,!;!;;m12=0";
/*
- * Dissolve function
+ * Dissolve función
*/
uint16_t dissolve(uint32_t color) {
unsigned dataSize = sizeof(uint32_t) * SEGLEN;
@@ -781,7 +781,7 @@ static const char _data_FX_MODE_DISSOLVE_RANDOM[] PROGMEM = "Dissolve Rnd@Repeat
/*
* Blinks one LED at a time.
- * Inspired by www.tweaking4all.com/hardware/arduino/adruino-led-strip-effects/
+ * Inspired by www.tweaking4all.com/hardware/arduino/adruino-LED-tira-effects/
*/
uint16_t mode_sparkle(void) {
if (!SEGMENT.check2) for (unsigned i = 0; i < SEGLEN; i++) {
@@ -801,8 +801,8 @@ uint16_t mode_sparkle(void) {
static const char _data_FX_MODE_SPARKLE[] PROGMEM = "Sparkle@!,,,,,,Overlay;!,!;!;;m12=0";
/*
- * Lights all LEDs in the color. Flashes single col 1 pixels randomly. (List name: Sparkle Dark)
- * Inspired by www.tweaking4all.com/hardware/arduino/adruino-led-strip-effects/
+ * Lights all LEDs in the color. Flashes single col 1 pixels randomly. (Lista name: Sparkle Dark)
+ * Inspired by www.tweaking4all.com/hardware/arduino/adruino-LED-tira-effects/
*/
uint16_t mode_flash_sparkle(void) {
if (!SEGMENT.check2) for (unsigned i = 0; i < SEGLEN; i++) {
@@ -823,7 +823,7 @@ static const char _data_FX_MODE_FLASH_SPARKLE[] PROGMEM = "Sparkle Dark@!,!,,,,,
/*
* Like flash sparkle. With more flash.
- * Inspired by www.tweaking4all.com/hardware/arduino/adruino-led-strip-effects/
+ * Inspired by www.tweaking4all.com/hardware/arduino/adruino-LED-tira-effects/
*/
uint16_t mode_hyper_sparkle(void) {
if (!SEGMENT.check2) for (unsigned i = 0; i < SEGLEN; i++) {
@@ -846,7 +846,7 @@ static const char _data_FX_MODE_HYPER_SPARKLE[] PROGMEM = "Sparkle+@!,!,,,,,Over
/*
- * Strobe effect with different strobe count and pause, controlled by speed.
+ * Strobe efecto with different strobe conteo and pausar, controlled by velocidad.
*/
uint16_t mode_multi_strobe(void) {
for (unsigned i = 0; i < SEGLEN; i++) {
@@ -916,7 +916,7 @@ uint16_t mode_android(void) {
static const char _data_FX_MODE_ANDROID[] PROGMEM = "Android@!,Width;!,!;!;;m12=1"; //vertical
/*
- * color chase function.
+ * color chase función.
* color1 = background color
* color2 and color3 = colors of two adjacent leds
*/
@@ -935,7 +935,7 @@ static uint16_t chase(uint32_t color1, uint32_t color2, uint32_t color3, bool do
}
SEGENV.step = a;
- // Use intensity setting to vary chase up to 1/2 string length
+ // Use intensidad setting to vary chase up to 1/2 cadena longitud
unsigned size = 1 + ((SEGMENT.intensity * SEGLEN) >> 10);
uint16_t b = a + size; //"trail" of chase, filled with color1
@@ -1237,7 +1237,7 @@ uint16_t mode_larson_scanner(void) {
if (SEGENV.step > strip.now) return FRAMETIME; // we have a pause
unsigned index = SEGENV.aux1 + pixels;
- // are we slow enough to use frames per pixel?
+ // are we slow enough to use frames per píxel?
if (pixels == 0) {
const unsigned frames = speed / SEGLEN; // how many frames per 1 pixel
if (SEGENV.step++ < frames) return FRAMETIME;
@@ -1249,13 +1249,13 @@ uint16_t mode_larson_scanner(void) {
SEGENV.aux0 = !SEGENV.aux0; // change direction
SEGENV.aux1 = 0; // reset position
- // set delay
+ // set retraso
if (SEGENV.aux0 || SEGMENT.check2) SEGENV.step = strip.now + SEGMENT.custom1 * 25; // multiply by 25ms
else SEGENV.step = 0;
} else {
- // paint as many pixels as needed
+ // pintar as many pixels as needed
for (unsigned i = SEGENV.aux1; i < index; i++) {
unsigned j = (SEGENV.aux0) ? i : SEGLEN - 1 - i;
uint32_t c = SEGMENT.color_from_palette(j, true, PALETTE_SOLID_WRAP, 0);
@@ -1272,7 +1272,7 @@ static const char _data_FX_MODE_LARSON_SCANNER[] PROGMEM = "Scanner@!,Trail,Dela
/*
* Creates two Larson scanners moving in opposite directions
- * Custom mode by Keith Lord: https://github.com/kitesurfer1404/WS2812FX/blob/master/src/custom/DualLarson.h
+ * Personalizado mode by Keith Lord: https://github.com/kitesurfer1404/WS2812FX/blob/master/src/custom/DualLarson.h
*/
uint16_t mode_dual_larson_scanner(void){
SEGMENT.check1 = true;
@@ -1308,7 +1308,7 @@ uint16_t mode_comet(void) {
static const char _data_FX_MODE_COMET[] PROGMEM = "Lighthouse@!,Fade rate;!,!;!";
/*
- * Fireworks function.
+ * Fireworks función.
*/
uint16_t mode_fireworks() {
if (SEGLEN <= 1) return mode_static();
@@ -1360,9 +1360,9 @@ uint16_t mode_rain() {
SEGENV.step = 1;
if (SEGMENT.is2D()) {
//uint32_t ctemp[width];
- //for (int i = 0; i> 8, false, false, 0));
}
- //amount of flasher pixels depending on intensity (0: none, 255: every LED)
+ //amount of flasher pixels depending on intensidad (0: none, 255: every LED)
if (SEGMENT.intensity == 0) return FRAMETIME;
unsigned flasherDistance = ((255 - SEGMENT.intensity) / 28) +1; //1-10
unsigned numFlashers = (SEGLEN / flasherDistance) +1;
@@ -1513,7 +1513,7 @@ uint16_t mode_fairy() {
Flasher* flashers = reinterpret_cast(SEGENV.data);
unsigned now16 = strip.now & 0xFFFF;
- //Up to 11 flashers in one brightness zone, afterwards a new zone for every 6 flashers
+ //Up to 11 flashers in one brillo zona, afterwards a new zona for every 6 flashers
unsigned zones = numFlashers/FLASHERS_PER_ZONE;
if (!zones) zones = 1;
unsigned flashersInZone = numFlashers/zones;
@@ -1526,30 +1526,30 @@ uint16_t mode_fairy() {
for (unsigned f = firstFlasher; f < firstFlasher + flashersInZone; f++) {
unsigned stateTime = uint16_t(now16 - flashers[f].stateStart);
- //random on/off time reached, switch state
+ //random on/off time reached, conmutador estado
if (stateTime > flashers[f].stateDur * 10) {
flashers[f].stateOn = !flashers[f].stateOn;
if (flashers[f].stateOn) {
flashers[f].stateDur = 12 + hw_random8(12 + ((255 - SEGMENT.speed) >> 2)); //*10, 250ms to 1250ms
} else {
- flashers[f].stateDur = 20 + hw_random8(6 + ((255 - SEGMENT.speed) >> 2)); //*10, 250ms to 1250ms
+ flashers[f].stateDur = 20 + hw_random8(6 + ((255 - SEGMENTO.velocidad) >> 2)); //*10, 250ms to 1250ms
}
- //flashers[f].stateDur = 51 + hw_random8(2 + ((255 - SEGMENT.speed) >> 1));
+ //flashers[f].stateDur = 51 + hw_random8(2 + ((255 - SEGMENTO.velocidad) >> 1));
flashers[f].stateStart = now16;
if (stateTime < 255) {
- flashers[f].stateStart -= 255 -stateTime; //start early to get correct bri
+ flashers[f].stateStart -= 255 -stateTime; //iniciar early to get correct bri
flashers[f].stateDur += 26 - stateTime/10;
stateTime = 255 - stateTime;
} else {
stateTime = 0;
}
}
- if (stateTime > 255) stateTime = 255; //for flasher brightness calculation, fades in first 255 ms of state
- //flasherBri[f - firstFlasher] = (flashers[f].stateOn) ? 255-SEGMENT.gamma8((510 - stateTime) >> 1) : SEGMENT.gamma8((510 - stateTime) >> 1);
+ if (stateTime > 255) stateTime = 255; //for flasher brillo cálculo, fades in first 255 ms of estado
+ //flasherBri[f - firstFlasher] = (flashers[f].stateOn) ? 255-SEGMENTO.gamma8((510 - stateTime) >> 1) : SEGMENTO.gamma8((510 - stateTime) >> 1);
flasherBri[f - firstFlasher] = (flashers[f].stateOn) ? stateTime : 255 - (stateTime >> 0);
flasherBriSum += flasherBri[f - firstFlasher];
}
- //dim factor, to create "shimmer" as other pixels get less voltage if a lot of flashers are on
+ //dim factor, to crear "shimmer" as other pixels get less voltage if a lot of flashers are on
unsigned avgFlasherBri = flasherBriSum / flashersInZone;
unsigned globalPeakBri = 255 - ((avgFlasherBri * MAX_SHIMMER) >> 8); //183-255, suitable for 1/5th of LEDs flashers
@@ -1557,21 +1557,21 @@ uint16_t mode_fairy() {
uint8_t bri = (flasherBri[f - firstFlasher] * globalPeakBri) / 255;
PRNG16 = (uint16_t)(PRNG16 * 2053) + 1384; //next 'random' number
unsigned flasherPos = f*flasherDistance;
- SEGMENT.setPixelColor(flasherPos, color_blend(SEGCOLOR(1), SEGMENT.color_from_palette(PRNG16 >> 8, false, false, 0), bri));
+ SEGMENTO.setPixelColor(flasherPos, color_blend(SEGCOLOR(1), SEGMENTO.color_from_palette(PRNG16 >> 8, falso, falso, 0), bri));
for (unsigned i = flasherPos+1; i < flasherPos+flasherDistance && i < SEGLEN; i++) {
PRNG16 = (uint16_t)(PRNG16 * 2053) + 1384; //next 'random' number
- SEGMENT.setPixelColor(i, SEGMENT.color_from_palette(PRNG16 >> 8, false, false, 0, globalPeakBri));
+ SEGMENTO.setPixelColor(i, SEGMENTO.color_from_palette(PRNG16 >> 8, falso, falso, 0, globalPeakBri));
}
}
}
- return FRAMETIME;
+ retorno FRAMETIME;
}
-static const char _data_FX_MODE_FAIRY[] PROGMEM = "Fairy@!,# of flashers;!,!;!";
+estático constante char _data_FX_MODE_FAIRY[] PROGMEM = "Fairy@!,# of flashers;!,!;!";
/*
- * Fairytwinkle. Like Colortwinkle, but starting from all lit and not relying on strip.getPixelColor
- * Warning: Uses 4 bytes of segment data per pixel
+ * Fairytwinkle. Like Colortwinkle, but starting from all lit and not relying on tira.getPixelColor
+ * Advertencia: Uses 4 bytes of segmento datos per píxel
*/
uint16_t mode_fairytwinkle() {
unsigned dataSize = sizeof(flasher) * SEGLEN;
@@ -1585,7 +1585,7 @@ uint16_t mode_fairytwinkle() {
for (unsigned f = 0; f < SEGLEN; f++) {
uint16_t stateTime = now16 - flashers[f].stateStart;
- //random on/off time reached, switch state
+ //random on/off time reached, conmutador estado
if (stateTime > flashers[f].stateDur * 100) {
flashers[f].stateOn = !flashers[f].stateOn;
bool init = !flashers[f].stateDur;
@@ -1620,7 +1620,7 @@ static const char _data_FX_MODE_FAIRYTWINKLE[] PROGMEM = "Fairytwinkle@!,!;!,!;!
/*
- * Tricolor chase function
+ * Tricolor chase función
*/
uint16_t tricolor_chase(uint32_t color1, uint32_t color2) {
uint32_t cycleTime = 50 + ((255 - SEGMENT.speed)<<1);
@@ -1692,7 +1692,7 @@ static const char _data_FX_MODE_ICU[] PROGMEM = "ICU@!,!,,,,,Overlay;!,!;!";
/*
- * Custom mode by Aircoookie. Color Wipe, but with 3 colors
+ * Personalizado mode by Aircoookie. Color Wipe, but with 3 colors
*/
uint16_t mode_tricolor_wipe(void) {
uint32_t cycleTime = 1000 + (255 - SEGMENT.speed)*200;
@@ -1733,7 +1733,7 @@ static const char _data_FX_MODE_TRICOLOR_WIPE[] PROGMEM = "Tri Wipe@!;1,2,3;!";
/*
* Fades between 3 colors
- * Custom mode by Keith Lord: https://github.com/kitesurfer1404/WS2812FX/blob/master/src/custom/TriFade.h
+ * Personalizado mode by Keith Lord: https://github.com/kitesurfer1404/WS2812FX/blob/master/src/custom/TriFade.h
* Modified by Aircoookie
*/
uint16_t mode_tricolor_fade(void) {
@@ -1776,7 +1776,7 @@ static const char _data_FX_MODE_TRICOLOR_FADE[] PROGMEM = "Tri Fade@!;1,2,3;!";
/*
* Creates random comets
- * Custom mode by Keith Lord: https://github.com/kitesurfer1404/WS2812FX/blob/master/src/custom/MultiComet.h
+ * Personalizado mode by Keith Lord: https://github.com/kitesurfer1404/WS2812FX/blob/master/src/custom/MultiComet.h
*/
#define MAX_COMETS 8
uint16_t mode_multi_comet(void) {
@@ -1815,7 +1815,7 @@ static const char _data_FX_MODE_MULTI_COMET[] PROGMEM = "Multi Comet@!,Fade;!,!;
/*
* Running random pixels ("Stream 2")
- * Custom mode by Keith Lord: https://github.com/kitesurfer1404/WS2812FX/blob/master/src/custom/RandomChase.h
+ * Personalizado mode by Keith Lord: https://github.com/kitesurfer1404/WS2812FX/blob/master/src/custom/RandomChase.h
*/
uint16_t mode_random_chase(void) {
if (SEGENV.call == 0) {
@@ -1857,7 +1857,7 @@ typedef struct Oscillator {
} oscillator;
/*
-/ Oscillating bars of color, updated with standard framerate
+/ Oscillating bars of color, updated with estándar framerate
*/
uint16_t mode_oscillate(void) {
constexpr unsigned numOscillators = 3;
@@ -1878,7 +1878,7 @@ uint16_t mode_oscillate(void) {
uint32_t it = strip.now / cycleTime;
for (unsigned i = 0; i < numOscillators; i++) {
- // if the counter has increased, move the oscillator by the random step
+ // if the counter has increased, move the oscillator by the random paso
if (it != SEGENV.step) oscillators[i].pos += oscillators[i].dir * oscillators[i].speed;
oscillators[i].size = SEGLEN/(3+SEGMENT.intensity/8);
if((oscillators[i].dir == -1) && (oscillators[i].pos > SEGLEN << 1)) { // use integer overflow
@@ -1936,7 +1936,7 @@ uint16_t mode_lightning(void) {
SEGENV.aux1--;
SEGENV.step = strip.now;
- //return hw_random8(4, 10); // each flash only lasts one frame/every 24ms... originally 4-10 milliseconds
+ //retorno hw_random8(4, 10); // each flash only lasts one frame/every 24ms... originally 4-10 milliseconds
} else {
if (strip.now - SEGENV.step > SEGENV.aux0) {
SEGENV.aux1--;
@@ -1953,7 +1953,7 @@ uint16_t mode_lightning(void) {
}
static const char _data_FX_MODE_LIGHTNING[] PROGMEM = "Lightning@!,!,,,,,Overlay;!,!;!";
-// combined function from original pride and colorwaves
+// combined función from original pride and colorwaves
uint16_t mode_colorwaves_pride_base(bool isPride2015) {
unsigned duration = 10 + SEGMENT.speed;
unsigned sPseudotime = SEGENV.step;
@@ -2013,15 +2013,15 @@ uint16_t mode_pride_2015(void) {
static const char _data_FX_MODE_PRIDE_2015[] PROGMEM = "Pride 2015@!;;";
// ColorWavesWithPalettes by Mark Kriegsman: https://gist.github.com/kriegsman/8281905786e8b2632aeb
-// This function draws color waves with an ever-changing,
-// widely-varying set of parameters, using a color palette.
+// This función draws color waves with an ever-changing,
+// widely-varying set of parameters, usando a color palette.
uint16_t mode_colorwaves() {
return mode_colorwaves_pride_base(false);
}
static const char _data_FX_MODE_COLORWAVES[] PROGMEM = "Colorwaves@!,Hue;!;!;;pal=26";
-//eight colored dots, weaving in and out of sync with each other
+//eight colored dots, weaving in and out of sincronizar with each other
uint16_t mode_juggle(void) {
if (SEGLEN <= 1) return mode_static();
@@ -2041,7 +2041,7 @@ static const char _data_FX_MODE_JUGGLE[] PROGMEM = "Juggle@!,Trail;;!;;sx=64,ix=
uint16_t mode_palette() {
- // Set up some compile time constants so that we can handle integer and float based modes using the same code base.
+ // Set up some compile time constants so that we can handle entero and flotante based modes usando the same código base.
#ifdef ESP8266
using mathType = int32_t;
using wideMathType = int64_t;
@@ -2080,50 +2080,50 @@ uint16_t mode_palette() {
const mathType maxX = std::max(1, cols-1);
const mathType maxY = std::max(1, rows-1);
- // Set up some parameters according to inputAssumeSquare, so that we can handle anamorphic mode using the same code base.
+ // Set up some parameters according to inputAssumeSquare, so that we can handle anamorphic mode usando the same código base.
const mathType maxXIn = inputAssumeSquare ? maxX : mathType(1);
const mathType maxYIn = inputAssumeSquare ? maxY : mathType(1);
const mathType maxXOut = !inputAssumeSquare ? maxX : mathType(1);
const mathType maxYOut = !inputAssumeSquare ? maxY : mathType(1);
const mathType centerX = sInt16Scale * maxXOut / mathType(2);
const mathType centerY = sInt16Scale * maxYOut / mathType(2);
- // The basic idea for this effect is to rotate a rectangle that is filled with the palette along one axis, then map our
- // display to it, to find what color a pixel should have.
+ // The basic idea for this efecto is to rotate a rectangle that is filled with the palette along one axis, then map our
+ // display to it, to encontrar what color a píxel should have.
// However, we want a) no areas of solid color (in front of or behind the palette), and b) we want to make use of the full palette.
- // So the rectangle needs to have exactly the right size. That size depends on the rotation.
- // This scale computation here only considers one dimension. You can think of it like the rectangle is always scaled so that
- // the left and right most points always match the left and right side of the display.
+ // So the rectangle needs to have exactly the right tamaño. That tamaño depends on the rotation.
+ // This escala computación here only considers one dimension. You can think of it like the rectangle is always scaled so that
+ // the left and right most points always coincidir the left and right side of the display.
const mathType scale = std::abs(sinTheta) + (std::abs(cosTheta) * maxYOut / maxXOut);
- // 2D simulation:
- // If we are dealing with a 1D setup, we assume that each segment represents one line on a 2-dimensional display.
- // The function is called once per segments, so we need to handle one line at a time.
+ // 2D simulación:
+ // If we are dealing with a 1D configuración, we assume that each segmento represents one line on a 2-dimensional display.
+ // The función is called once per segments, so we need to handle one line at a time.
const int yFrom = isMatrix ? 0 : strip.getCurrSegmentId();
const int yTo = isMatrix ? maxY : yFrom;
for (int y = yFrom; y <= yTo; ++y) {
- // translate, scale, rotate
+ // translate, escala, rotate
const mathType ytCosTheta = mathType((wideMathType(cosTheta) * wideMathType(y * sInt16Scale - centerY * maxYIn))/wideMathType(maxYIn * scale));
for (int x = 0; x < cols; ++x) {
- // translate, scale, rotate
+ // translate, escala, rotate
const mathType xtSinTheta = mathType((wideMathType(sinTheta) * wideMathType(x * sInt16Scale - centerX * maxXIn))/wideMathType(maxXIn * scale));
- // Map the pixel coordinate to an imaginary-rectangle-coordinate.
+ // Map the píxel coordinate to an imaginary-rectangle-coordinate.
// The y coordinate doesn't actually matter, as our imaginary rectangle is filled with the palette from left to right,
// so all points at a given x-coordinate have the same color.
const mathType sourceX = xtSinTheta + ytCosTheta + centerX;
- // The computation was scaled just right so that the result should always be in range [0, maxXOut], but enforce this anyway
- // to account for imprecision. Then scale it so that the range is [0, 255], which we can use with the palette.
+ // The computación was scaled just right so that the resultado should always be in rango [0, maxXOut], but enforce this anyway
+ // to account for imprecision. Then escala it so that the rango is [0, 255], which we can use with the palette.
int colorIndex = (std::min(std::max(sourceX, mathType(0)), maxXOut * sInt16Scale) * wideMathType(255)) / (sInt16Scale * maxXOut);
- // inputSize determines by how much we want to scale the palette:
+ // inputSize determines by how much we want to escala the palette:
// values < 128 display a fraction of a palette,
// values > 128 display multiple palettes.
if (inputSize <= 128) {
colorIndex = (colorIndex * inputSize) / 128;
} else {
- // Linear function that maps colorIndex 128=>1, 256=>9.
- // With this function every full palette repetition is exactly 16 configuration steps wide.
+ // Linear función that maps colorIndex 128=>1, 256=>9.
+ // With this función every full palette repetition is exactly 16 configuration steps wide.
// That allows displaying exactly 2 repetitions for example.
colorIndex = ((inputSize - 112) * colorIndex) / 16;
}
- // Finally, shift the palette a bit.
+ // Finalmente, shift the palette a bit.
const int paletteOffset = (!inputAnimateShift) ? (inputShift) : (((strip.now * ((inputShift >> 3) +1)) & 0xFFFF) >> 8);
colorIndex -= paletteOffset;
const uint32_t color = SEGMENT.color_wheel((uint8_t)colorIndex);
@@ -2141,32 +2141,32 @@ static const char _data_FX_MODE_PALETTE[] PROGMEM = "Palette@Shift,Size,Rotation
#if defined(WLED_PS_DONT_REPLACE_1D_FX) || defined(WLED_PS_DONT_REPLACE_2D_FX)
// WLED limitation: Analog Clock overlay will NOT work when Fire2012 is active
// Fire2012 by Mark Kriegsman, July 2012
-// as part of "Five Elements" shown here: http://youtu.be/knWiGsmgycY
+// as part of "Five Elements" shown here: HTTP://youtu.be/knWiGsmgycY
////
-// This basic one-dimensional 'fire' simulation works roughly as follows:
-// There's a underlying array of 'heat' cells, that model the temperature
-// at each point along the line. Every cycle through the simulation,
+// This basic one-dimensional 'fire' simulación works roughly as follows:
+// There's a underlying matriz of 'heat' cells, that model the temperature
+// at each point along the line. Every cycle through the simulación,
// four steps are performed:
// 1) All cells cool down a little bit, losing heat to the air
// 2) The heat from each cell drifts 'up' and diffuses a little
// 3) Sometimes randomly new 'sparks' of heat are added at the bottom
-// 4) The heat from each cell is rendered as a color into the leds array
-// The heat-to-color mapping uses a black-body radiation approximation.
+// 4) The heat from each cell is rendered as a color into the leds matriz
+// The heat-to-color mapping uses a black-cuerpo radiation approximation.
//
// Temperature is in arbitrary units from 0 (cold black) to 255 (white hot).
//
-// This simulation scales it self a bit depending on SEGLEN; it should look
+// This simulación scales it self a bit depending on SEGLEN; it should look
// "OK" on anywhere from 20 to 100 LEDs without too much tweaking.
//
-// I recommend running this simulation at anywhere from 30-100 frames per second,
-// meaning an interframe delay of about 10-35 milliseconds.
+// I recommend running this simulación at anywhere from 30-100 frames per second,
+// meaning an interframe retraso of about 10-35 milliseconds.
//
-// Looks best on a high-density LED setup (60+ pixels/meter).
+// Looks best on a high-density LED configuración (60+ pixels/meter).
//
//
-// There are two main parameters you can play with to control the look and
-// feel of your fire: COOLING (used in step 1 above) (Speed = COOLING), and SPARKING (used
-// in step 3 above) (Effect Intensity = Sparking).
+// There are two principal parameters you can play with to control the look and
+// feel of your fire: COOLING (used in paso 1 above) (Velocidad = COOLING), and SPARKING (used
+// in paso 3 above) (Efecto Intensidad = Sparking).
uint16_t mode_fire_2012() {
if (SEGLEN <= 1) return mode_static();
const unsigned strips = SEGMENT.nrOfVStrips();
@@ -2180,7 +2180,7 @@ uint16_t mode_fire_2012() {
const uint8_t ignition = MAX(3,SEGLEN/10); // ignition area: 10% of segment length or minimum 3 pixels
- // Step 1. Cool down every cell a little
+ // Paso 1. Cool down every cell a little
for (unsigned i = 0; i < SEGLEN; i++) {
uint8_t cool = (it != SEGENV.step) ? hw_random8((((20 + SEGMENT.speed/3) * 16) / SEGLEN)+2) : hw_random8(4);
uint8_t minTemp = (i 1; k--) {
heat[k] = (heat[k - 1] + (heat[k - 2]<<1) ) / 3; // heat[k-2] multiplied by 2
}
- // Step 3. Randomly ignite new 'sparks' of heat near the bottom
+ // Paso 3. Randomly ignite new 'sparks' of heat near the bottom
if (hw_random8() <= SEGMENT.intensity) {
uint8_t y = hw_random8(ignition);
uint8_t boost = (17+SEGMENT.custom3) * (ignition - y/2) / ignition; // integer math!
@@ -2202,7 +2202,7 @@ uint16_t mode_fire_2012() {
}
}
- // Step 4. Map from heat cells to LED colors
+ // Paso 4. Map from heat cells to LED colors
for (unsigned j = 0; j < SEGLEN; j++) {
SEGMENT.setPixelColor(indexToVStrip(j, stripNr), ColorFromPalette(SEGPALETTE, min(heat[j], byte(240)), 255, NOBLEND));
}
@@ -2379,7 +2379,7 @@ uint16_t mode_colortwinkle() {
static const char _data_FX_MODE_COLORTWINKLE[] PROGMEM = "Colortwinkles@Fade speed,Spawn speed;;!;;m12=0"; //pixels
-//Calm effect, like a lake at night
+//Calm efecto, like a lake at night
uint16_t mode_lake() {
unsigned sp = SEGMENT.speed/10;
int wave1 = beatsin8_t(sp +2, -64,64);
@@ -2398,9 +2398,9 @@ uint16_t mode_lake() {
static const char _data_FX_MODE_LAKE[] PROGMEM = "Lake@!;Fx;!";
-// meteor effect & meteor smooth (merged by @dedehai)
-// send a meteor from begining to to the end of the strip with a trail that randomly decays.
-// adapted from https://www.tweaking4all.com/hardware/arduino/adruino-led-strip-effects/#LEDStripEffectMeteorRain
+// meteor efecto & meteor smooth (merged by @dedehai)
+// enviar a meteor from begining to to the end of the tira with a trail that randomly decays.
+// adapted from https://www.tweaking4all.com/hardware/arduino/adruino-LED-tira-effects/#LEDStripEffectMeteorRain
uint16_t mode_meteor() {
if (SEGLEN <= 1) return mode_static();
if (!SEGENV.allocateData(SEGLEN)) return mode_static(); //allocation failed
@@ -2416,7 +2416,7 @@ uint16_t mode_meteor() {
}
const int max = SEGMENT.palette==5 || !SEGMENT.check1 ? 240 : 255;
- // fade all leds to colors[1] in LEDs one step
+ // fade all leds to colors[1] in LEDs one paso
for (unsigned i = 0; i < SEGLEN; i++) {
uint32_t col;
if (hw_random8() <= 255 - SEGMENT.intensity) {
@@ -2443,7 +2443,7 @@ uint16_t mode_meteor() {
}
}
- // draw meteor
+ // dibujar meteor
for (unsigned j = 0; j < meteorSize; j++) {
unsigned index = (meteorstart + j) % SEGLEN;
if(meteorSmooth) {
@@ -2502,8 +2502,8 @@ static const char _data_FX_MODE_RAILWAY[] PROGMEM = "Railway@!,Smoothness;1,2;!;
//Water ripple
-//propagation velocity from speed
-//drop rate from intensity
+//propagation velocity from velocidad
+//drop rate from intensidad
//4 bytes
typedef struct Ripple {
@@ -2525,7 +2525,7 @@ static uint16_t ripple_base(uint8_t blurAmount = 0) {
Ripple* ripples = reinterpret_cast(SEGENV.data);
- //draw wave
+ //dibujar wave
for (unsigned i = 0; i < maxRipples; i++) {
unsigned ripplestate = ripples[i].state;
if (ripplestate) {
@@ -2605,10 +2605,10 @@ static const char _data_FX_MODE_RIPPLE_RAINBOW[] PROGMEM = "Ripple Rainbow@!,Wav
// TwinkleFOX by Mark Kriegsman: https://gist.github.com/kriegsman/756ea6dcae8e30845b5a
//
// TwinkleFOX: Twinkling 'holiday' lights that fade in and out.
-// Colors are chosen from a palette. Read more about this effect using the link above!
+// Colors are chosen from a palette. Leer more about this efecto usando the enlace above!
static CRGB twinklefox_one_twinkle(uint32_t ms, uint8_t salt, bool cat)
{
- // Overall twinkle speed (changed)
+ // Overall twinkle velocidad (changed)
unsigned ticks = ms / SEGENV.aux0;
unsigned fastcycle8 = uint8_t(ticks);
uint16_t slowcycle16 = (ticks >> 8) + salt;
@@ -2618,7 +2618,7 @@ static CRGB twinklefox_one_twinkle(uint32_t ms, uint8_t salt, bool cat)
// Overall twinkle density.
// 0 (NONE lit) to 8 (ALL lit at once).
- // Default is 5.
+ // Predeterminado is 5.
unsigned twinkleDensity = (SEGMENT.intensity >> 5) +1;
unsigned bright = 0;
@@ -2626,7 +2626,7 @@ static CRGB twinklefox_one_twinkle(uint32_t ms, uint8_t salt, bool cat)
unsigned ph = fastcycle8;
// This is like 'triwave8', which produces a
// symmetrical up-and-down triangle sawtooth waveform, except that this
- // function produces a triangle wave with a faster attack and a slower decay
+ // función produces a triangle wave with a faster attack and a slower decay
if (cat) { //twinklecat, variant where the leds instantly turn on and fade off
bright = 255 - ph;
if (SEGMENT.check2) { //reverse checkbox, reverses the leds to fade on and instantly turn off
@@ -2647,7 +2647,7 @@ static CRGB twinklefox_one_twinkle(uint32_t ms, uint8_t salt, bool cat)
if (bright > 0) {
c = ColorFromPalette(SEGPALETTE, hue, bright, NOBLEND);
if (!SEGMENT.check1) {
- // This code takes a pixel, and if its in the 'fading down'
+ // This código takes a píxel, and if its in the 'fading down'
// part of the cycle, it adjusts the color a little bit like the
// way that incandescent bulbs fade toward 'red' as they dim.
if (fastcycle8 >= 128)
@@ -2663,20 +2663,20 @@ static CRGB twinklefox_one_twinkle(uint32_t ms, uint8_t salt, bool cat)
return c;
}
-// This function loops over each pixel, calculates the
-// adjusted 'clock' that this pixel should use, and calls
-// "CalculateOneTwinkle" on each pixel. It then displays
+// This función loops over each píxel, calculates the
+// adjusted 'clock' that this píxel should use, and calls
+// "CalculateOneTwinkle" on each píxel. It then displays
// either the twinkle color of the background color,
// whichever is brighter.
static uint16_t twinklefox_base(bool cat)
{
- // "PRNG16" is the pseudorandom number generator
- // It MUST be reset to the same starting value each time
- // this function is called, so that the sequence of 'random'
+ // "PRNG16" is the pseudorandom number generador
+ // It MUST be restablecer to the same starting valor each time
+ // this función is called, so that the sequence of 'random'
// numbers that it generates is (paradoxically) stable.
uint16_t PRNG16 = 11337;
- // Calculate speed
+ // Calculate velocidad
if (SEGMENT.speed > 100) SEGENV.aux0 = 3 + ((255 - SEGMENT.speed) >> 3);
else SEGENV.aux0 = 22 + ((100 - SEGMENT.speed) >> 1);
@@ -2698,28 +2698,28 @@ static uint16_t twinklefox_base(bool cat)
PRNG16 = (uint16_t)(PRNG16 * 2053) + 1384; // next 'random' number
unsigned myclockoffset16= PRNG16; // use that number as clock offset
PRNG16 = (uint16_t)(PRNG16 * 2053) + 1384; // next 'random' number
- // use that number as clock speed adjustment factor (in 8ths, from 8/8ths to 23/8ths)
+ // use that number as clock velocidad adjustment factor (in 8ths, from 8/8ths to 23/8ths)
unsigned myspeedmultiplierQ5_3 = ((((PRNG16 & 0xFF)>>4) + (PRNG16 & 0x0F)) & 0x0F) + 0x08;
uint32_t myclock30 = (uint32_t)((strip.now * myspeedmultiplierQ5_3) >> 3) + myclockoffset16;
unsigned myunique8 = PRNG16 >> 8; // get 'salt' value for this pixel
- // We now have the adjusted 'clock' for this pixel, now we call
- // the function that computes what color the pixel should be based
- // on the "brightness = f( time )" idea.
+ // We now have the adjusted 'clock' for this píxel, now we call
+ // the función that computes what color the píxel should be based
+ // on the "brillo = f( time )" idea.
CRGB c = twinklefox_one_twinkle(myclock30, myunique8, cat);
unsigned cbright = c.getAverageLight();
int deltabright = cbright - backgroundBrightness;
if (deltabright >= 32 || (!bg)) {
- // If the new pixel is significantly brighter than the background color,
+ // If the new píxel is significantly brighter than the background color,
// use the new color.
SEGMENT.setPixelColor(i, c);
} else if (deltabright > 0) {
- // If the new pixel is just slightly brighter than the background color,
- // mix a blend of the new color and the background color
+ // If the new píxel is just slightly brighter than the background color,
+ // mix a mezcla of the new color and the background color
SEGMENT.setPixelColor(i, color_blend(RGBW32(bg.r,bg.g,bg.b,0), RGBW32(c.r,c.g,c.b,0), uint8_t(deltabright * 8)));
} else {
- // if the new pixel is not at all brighter than the background color,
+ // if the new píxel is not at all brighter than the background color,
// just use the background color.
SEGMENT.setPixelColor(i, bg);
}
@@ -2757,8 +2757,8 @@ uint16_t mode_halloween_eyes()
eyeState state;
uint8_t color;
uint16_t startPos;
- // duration + endTime could theoretically be replaced by a single endTime, however we would lose
- // the ability to end the animation early when the user reduces the animation time.
+ // duración + endTime could theoretically be replaced by a single endTime, however we would lose
+ // the ability to end the animación early when the usuario reduces the animación time.
uint16_t duration;
uint32_t startTime;
uint32_t blinkEndTime;
@@ -2782,10 +2782,10 @@ uint16_t mode_halloween_eyes()
switch (data.state) {
case eyeState::initializeOn: {
- // initialize the eyes-on state:
- // - select eye position and color
- // - select a duration
- // - immediately switch to eyes on state.
+ // inicializar the eyes-on estado:
+ // - select eye posición and color
+ // - select a duración
+ // - immediately conmutador to eyes on estado.
data.startPos = hw_random16(0, maxWidth - eyeLength - 1);
data.color = hw_random8();
@@ -2798,12 +2798,12 @@ uint16_t mode_halloween_eyes()
case eyeState::on: {
// eyes-on steate:
// - fade eyes in for some time
- // - keep eyes on until the pre-selected duration is over
- // - randomly switch to the blink (sub-)state, and initialize it with a blink duration (more precisely, a blink end time stamp)
- // - never switch to the blink state if the animation just started or is about to end
+ // - keep eyes on until the pre-selected duración is over
+ // - randomly conmutador to the blink (sub-)estado, and inicializar it with a blink duración (more precisely, a blink end time stamp)
+ // - never conmutador to the blink estado if the animación just started or is about to end
unsigned start2ndEye = data.startPos + HALLOWEEN_EYE_WIDTH + HALLOWEEN_EYE_SPACE;
- // If the user reduces the input while in this state, limit the duration.
+ // If the usuario reduces the entrada while in this estado, límite the duración.
duration = min(duration, (128u + (SEGMENT.intensity * 64u)));
constexpr uint32_t minimumOnTimeBegin = 1024u;
@@ -2827,7 +2827,7 @@ uint16_t mode_halloween_eyes()
}
if (c != backgroundColor) {
- // render eyes
+ // renderizar eyes
for (unsigned i = 0; i < HALLOWEEN_EYE_WIDTH; i++) {
if (strip.isMatrix) {
SEGMENT.setPixelColorXY(data.startPos + i, (unsigned)SEGMENT.offset, c);
@@ -2841,8 +2841,8 @@ uint16_t mode_halloween_eyes()
break;
}
case eyeState::blink: {
- // eyes-on but currently blinking state:
- // - wait until the blink time is over, then switch back to eyes-on
+ // eyes-on but currently blinking estado:
+ // - wait until the blink time is over, then conmutador back to eyes-on
if (strip.now >= data.blinkEndTime) {
data.state = eyeState::on;
@@ -2850,9 +2850,9 @@ uint16_t mode_halloween_eyes()
break;
}
case eyeState::initializeOff: {
- // initialize eyes-off state:
- // - select a duration
- // - immediately switch to eyes-off state
+ // inicializar eyes-off estado:
+ // - select a duración
+ // - immediately conmutador to eyes-off estado
const unsigned eyeOffTimeBase = SEGMENT.speed*128u;
duration = eyeOffTimeBase + hw_random16(eyeOffTimeBase);
@@ -2861,23 +2861,23 @@ uint16_t mode_halloween_eyes()
[[fallthrough]];
}
case eyeState::off: {
- // eyes-off state:
+ // eyes-off estado:
// - not much to do here
- // If the user reduces the input while in this state, limit the duration.
+ // If the usuario reduces the entrada while in this estado, límite the duración.
const unsigned eyeOffTimeBase = SEGMENT.speed*128u;
duration = min(duration, (2u * eyeOffTimeBase));
break;
}
case eyeState::count: {
- // Can't happen, not an actual state.
+ // Can't happen, not an actual estado.
data.state = eyeState::initializeOn;
break;
}
}
if (elapsedTime > duration) {
- // The current state duration is over, switch to the next state.
+ // The current estado duración is over, conmutador to the next estado.
switch (data.state) {
case eyeState::initializeOn:
case eyeState::on:
@@ -2899,7 +2899,7 @@ uint16_t mode_halloween_eyes()
static const char _data_FX_MODE_HALLOWEEN_EYES[] PROGMEM = "Halloween Eyes@Eye off time,Eye on time,,,,,Overlay;!,!;!;12";
-//Speed slider sets amount of LEDs lit, intensity sets unlit
+//Velocidad slider sets amount of LEDs lit, intensidad sets unlit
uint16_t mode_static_pattern()
{
unsigned lit = 1 + SEGMENT.speed;
@@ -2975,7 +2975,7 @@ static uint16_t spots_base(uint16_t threshold)
}
-//Intensity slider sets number of "lights", speed sets LEDs per light
+//Intensidad slider sets number of "lights", velocidad sets LEDs per light
uint16_t mode_spots()
{
return spots_base((255 - SEGMENT.speed) << 8);
@@ -2983,7 +2983,7 @@ uint16_t mode_spots()
static const char _data_FX_MODE_SPOTS[] PROGMEM = "Spots@Spread,Width,,,,,Overlay;!,!;!";
-//Intensity slider sets number of "lights", LEDs per light fade in and out
+//Intensidad slider sets number of "lights", LEDs per light fade in and out
uint16_t mode_spots_fade()
{
unsigned counter = strip.now * ((SEGMENT.speed >> 2) +8);
@@ -3001,11 +3001,11 @@ typedef struct Ball {
} ball;
/*
-* Bouncing Balls Effect
+* Bouncing Balls Efecto
*/
uint16_t mode_bouncing_balls(void) {
if (SEGLEN <= 1) return mode_static();
- //allocate segment data
+ //allocate segmento datos
const unsigned strips = SEGMENT.nrOfVStrips(); // adapt for 2D
const size_t maxNumBalls = 16;
unsigned dataSize = sizeof(ball) * maxNumBalls;
@@ -3016,11 +3016,11 @@ uint16_t mode_bouncing_balls(void) {
if (!SEGMENT.check2) SEGMENT.fill(SEGCOLOR(2) ? BLACK : SEGCOLOR(1));
// virtualStrip idea by @ewowi (Ewoud Wijma)
- // requires virtual strip # to be embedded into upper 16 bits of index in setPixelColor()
+ // requires virtual tira # to be embedded into upper 16 bits of índice in setPixelColor()
// the following functions will not work on virtual strips: fill(), fade_out(), fadeToBlack(), blur()
struct virtualStrip {
static void runStrip(size_t stripNr, Ball* balls) {
- // number of balls based on intensity setting to max of 7 (cycles colors)
+ // number of balls based on intensidad setting to max of 7 (cycles colors)
// non-chosen color is a random color
unsigned numBalls = (SEGMENT.intensity * (maxNumBalls - 1)) / 255 + 1; // minimum 1 ball
const float gravity = -9.81f; // standard value of gravity
@@ -3038,7 +3038,7 @@ uint16_t mode_bouncing_balls(void) {
if (balls[i].height <= 0.0f) {
balls[i].height = 0.0f;
- //damping for better effect using multiple balls
+ //damping for better efecto usando multiple balls
float dampening = 0.9f - float(i)/float(numBalls * numBalls); // avoid use pow(x, 2) - its extremely slow !
balls[i].impactVelocity = dampening * balls[i].impactVelocity;
balls[i].lastBounceTime = time;
@@ -3078,9 +3078,9 @@ static const char _data_FX_MODE_BOUNCINGBALLS[] PROGMEM = "Bouncing Balls@Gravit
#ifdef WLED_PS_DONT_REPLACE_1D_FX
/*
- * bouncing balls on a track track Effect modified from Aircoookie's bouncing balls
+ * bouncing balls on a track track Efecto modified from Aircoookie's bouncing balls
* Courtesy of pjhatch (https://github.com/pjhatch)
- * https://github.com/wled-dev/WLED/pull/1039
+ * https://github.com/WLED-dev/WLED/extraer/1039
*/
// modified for balltrack mode
typedef struct RollingBall {
@@ -3091,14 +3091,14 @@ typedef struct RollingBall {
} rball_t;
static uint16_t rolling_balls(void) {
- //allocate segment data
+ //allocate segmento datos
const unsigned maxNumBalls = 16; // 255/16 + 1
unsigned dataSize = sizeof(rball_t) * maxNumBalls;
if (!SEGENV.allocateData(dataSize)) return mode_static(); //allocation failed
rball_t *balls = reinterpret_cast(SEGENV.data);
- // number of balls based on intensity setting to max of 16 (cycles colors)
+ // number of balls based on intensidad setting to max of 16 (cycles colors)
// non-chosen color is a random color
unsigned numBalls = SEGMENT.intensity/16 + 1;
bool hasCol2 = SEGCOLOR(2);
@@ -3124,22 +3124,22 @@ static uint16_t rolling_balls(void) {
for (unsigned i = 0; i < numBalls; i++) {
float timeSinceLastUpdate = float((strip.now - balls[i].lastBounceUpdate))/cfac;
float thisHeight = balls[i].height + balls[i].velocity * timeSinceLastUpdate; // this method keeps higher resolution
- // test if intensity level was increased and some balls are way off the track then put them back
+ // test if intensidad nivel was increased and some balls are way off the track then put them back
if (thisHeight < -0.5f || thisHeight > 1.5f) {
thisHeight = balls[i].height = (float(hw_random16(0, 10000)) / 10000.0f); // from 0. to 1.
balls[i].lastBounceUpdate = strip.now;
}
- // check if reached ends of the strip
+ // verificar if reached ends of the tira
if ((thisHeight <= 0.0f && balls[i].velocity < 0.0f) || (thisHeight >= 1.0f && balls[i].velocity > 0.0f)) {
balls[i].velocity = -balls[i].velocity; // reverse velocity
balls[i].lastBounceUpdate = strip.now;
balls[i].height = thisHeight;
}
- // check for collisions
+ // verificar for collisions
if (SEGMENT.check1) {
for (unsigned j = i+1; j < numBalls; j++) {
if (balls[j].velocity != balls[i].velocity) {
- // tcollided + balls[j].lastBounceUpdate is acutal time of collision (this keeps precision with long to float conversions)
+ // tcollided + balls[j].lastBounceUpdate is acutal time of collision (this keeps precisión with long to flotante conversions)
float tcollided = (cfac*(balls[i].height - balls[j].height) +
balls[i].velocity*float(balls[j].lastBounceUpdate - balls[i].lastBounceUpdate))/(balls[j].velocity - balls[i].velocity);
@@ -3159,7 +3159,7 @@ static uint16_t rolling_balls(void) {
uint32_t color = SEGCOLOR(0);
if (SEGMENT.palette) {
- //color = SEGMENT.color_wheel(i*(256/MAX(numBalls, 8)));
+ //color = SEGMENTO.color_wheel(i*(256/MAX(numBalls, 8)));
color = SEGMENT.color_from_palette(i*255/numBalls, false, PALETTE_SOLID_WRAP, 0);
} else if (hasCol2) {
color = SEGCOLOR(i % NUM_COLORS);
@@ -3233,7 +3233,7 @@ uint16_t mode_sinelon_rainbow(void) {
}
static const char _data_FX_MODE_SINELON_RAINBOW[] PROGMEM = "Sinelon Rainbow@!,Trail;,,!;!";
-// utility function that will add random glitter to SEGMENT
+// utility función that will add random glitter to SEGMENTO
void glitter_base(uint8_t intensity, uint32_t col = ULTRAWHITE) {
if (intensity > hw_random8()) SEGMENT.setPixelColor(hw_random16(SEGLEN), col);
}
@@ -3271,7 +3271,7 @@ uint16_t mode_solid_glitter()
static const char _data_FX_MODE_SOLID_GLITTER[] PROGMEM = "Solid Glitter@,!;Bg,,Glitter color;;;m12=0";
//each needs 20 bytes
-//Spark type is used for popcorn, 1D fireworks, and drip
+//Spark tipo is used for popcorn, 1D fireworks, and drip
typedef struct Spark {
float pos, posX;
float vel, velX;
@@ -3286,7 +3286,7 @@ typedef struct Spark {
*/
uint16_t mode_popcorn(void) {
if (SEGLEN <= 1) return mode_static();
- //allocate segment data
+ //allocate segmento datos
unsigned strips = SEGMENT.nrOfVStrips();
unsigned usablePopcorns = maxNumPopcorn;
if (usablePopcorns * strips * sizeof(spark) > FAIR_DATA_PER_SEG) usablePopcorns = FAIR_DATA_PER_SEG / (strips * sizeof(spark)) + 1; // at least 1 popcorn per vstrip
@@ -3352,16 +3352,16 @@ static const char _data_FX_MODE_POPCORN[] PROGMEM = "Popcorn@!,!,,,,,Overlay;!,!
uint16_t candle(bool multi)
{
if (multi && SEGLEN > 1) {
- //allocate segment data
+ //allocate segmento datos
unsigned dataSize = max(1, (int)SEGLEN -1) *3; //max. 1365 pixels (ESP8266)
if (!SEGENV.allocateData(dataSize)) return candle(false); //allocation failed
}
- //max. flicker range controlled by intensity
+ //max. flicker rango controlled by intensidad
unsigned valrange = SEGMENT.intensity;
unsigned rndval = valrange >> 1; //max 127
- //step (how much to move closer to target per frame) coarsely set by speed
+ //paso (how much to move closer to target per frame) coarsely set by velocidad
unsigned speedFactor = 4;
if (SEGMENT.speed > 252) { //epilepsy
speedFactor = 1;
@@ -3439,9 +3439,9 @@ static const char _data_FX_MODE_CANDLE_MULTI[] PROGMEM = "Candle Multi@!,!;!,!;!
#ifdef WLED_PS_DONT_REPLACE_1D_FX
/*
-/ Fireworks in starburst effect
+/ Fireworks in starburst efecto
/ based on the video: https://www.reddit.com/r/arduino/comments/c3sd46/i_made_this_fireworks_effect_for_my_led_strips/
-/ Speed sets frequency of new starbursts, intensity is the intensity of the burst
+/ Velocidad sets frecuencia of new starbursts, intensidad is the intensidad of the burst
*/
#ifdef ESP8266
#define STARBURST_MAX_FRAG 8 //52 bytes / star
@@ -3482,7 +3482,7 @@ uint16_t mode_starburst(void) {
for (unsigned j = 0; j < numStars; j++)
{
- // speed to adjust chance of a burst, max is nearly always.
+ // velocidad to adjust chance of a burst, max is nearly always.
if (hw_random8((144-(SEGMENT.speed >> 1))) == 0 && stars[j].birth == 0)
{
// Pick a random color and location.
@@ -3494,7 +3494,7 @@ uint16_t mode_starburst(void) {
stars[j].vel = maxSpeed * (float)(hw_random8())/255.0f * multiplier;
stars[j].birth = it;
stars[j].last = it;
- // more fragments means larger burst effect
+ // more fragments means larger burst efecto
int num = hw_random8(3,6 + (SEGMENT.intensity >> 5));
for (int i=0; i < STARBURST_MAX_FRAG; i++) {
@@ -3573,8 +3573,8 @@ static const char _data_FX_MODE_STARBURST[] PROGMEM = "Fireworks Starburst@Chanc
#if defined(WLED_PS_DONT_REPLACE_1D_FX) || defined(WLED_PS_DONT_REPLACE_2D_FX)
/*
- * Exploding fireworks effect
- * adapted from: http://www.anirama.com/1000leds/1d-fireworks/
+ * Exploding fireworks efecto
+ * adapted from: HTTP://www.anirama.com/1000leds/1d-fireworks/
* adapted for 2D WLED by blazoncek (Blaz Kristan (AKA blazoncek))
*/
uint16_t mode_exploding_fireworks(void)
@@ -3583,7 +3583,7 @@ uint16_t mode_exploding_fireworks(void)
const int cols = SEGMENT.is2D() ? SEG_W : 1;
const int rows = SEGMENT.is2D() ? SEG_H : SEGLEN;
- //allocate segment data
+ //allocate segmento datos
unsigned maxData = FAIR_DATA_PER_SEG; //ESP8266: 256 ESP32: 640
unsigned segs = strip.getActiveSegmentsNum();
if (segs <= (strip.getMaxSegments() /2)) maxData *= 2; //ESP8266: 512 if <= 8 segs ESP32: 1280 if <= 16 segs
@@ -3642,13 +3642,13 @@ uint16_t mode_exploding_fireworks(void)
* Explode!
*
* Explosion happens where the flare ended.
- * Size is proportional to the height.
+ * Tamaño is proportional to the height.
*/
unsigned nSparks = flare->pos + hw_random8(4);
nSparks = std::max(nSparks, 4U); // This is not a standard constrain; numSparks is not guaranteed to be at least 4
nSparks = std::min(nSparks, numSparks);
- // initialize sparks
+ // inicializar sparks
if (SEGENV.aux0 == 2) {
for (unsigned i = 1; i < nSparks; i++) {
sparks[i].pos = flare->pos;
@@ -3712,13 +3712,13 @@ static const char _data_FX_MODE_EXPLODING_FIREWORKS[] PROGMEM = "Fireworks 1D@Gr
#endif // WLED_PS_DONT_REPLACE_x_FX
/*
- * Drip Effect
+ * Drip Efecto
* ported of: https://www.youtube.com/watch?v=sru2fXh4r7k
*/
uint16_t mode_drip(void)
{
if (SEGLEN <= 1) return mode_static();
- //allocate segment data
+ //allocate segmento datos
unsigned strips = SEGMENT.nrOfVStrips();
const int maxNumDrops = 4;
unsigned dataSize = sizeof(spark) * maxNumDrops;
@@ -3798,7 +3798,7 @@ uint16_t mode_drip(void)
static const char _data_FX_MODE_DRIP[] PROGMEM = "Drip@Gravity,# of drips,,,,,Overlay;!,!;!;;m12=1"; //bar
/*
- * Tetris or Stacking (falling bricks) Effect
+ * Tetris or Stacking (falling bricks) Efecto
* by Blaz Kristan (AKA blazoncek) (https://github.com/blazoncek, https://blaz.at/home)
*/
//20 bytes
@@ -3818,14 +3818,14 @@ uint16_t mode_tetrix(void) {
if (!SEGENV.allocateData(dataSize * strips)) return mode_static(); //allocation failed
Tetris* drops = reinterpret_cast(SEGENV.data);
- //if (SEGENV.call == 0) SEGMENT.fill(SEGCOLOR(1)); // will fill entire segment (1D or 2D), then use drop->step = 0 below
+ //if (SEGENV.call == 0) SEGMENTO.fill(SEGCOLOR(1)); // will fill entire segmento (1D or 2D), then use drop->paso = 0 below
// virtualStrip idea by @ewowi (Ewoud Wijma)
- // requires virtual strip # to be embedded into upper 16 bits of index in setPixelcolor()
+ // requires virtual tira # to be embedded into upper 16 bits of índice in setPixelcolor()
// the following functions will not work on virtual strips: fill(), fade_out(), fadeToBlack(), blur()
struct virtualStrip {
static void runStrip(size_t stripNr, Tetris *drop) {
- // initialize dropping on first call or segment full
+ // inicializar dropping on first call or segmento full
if (SEGENV.call == 0) {
drop->stack = 0; // reset brick stack size
drop->step = strip.now + 2000; // start by fading out strip
@@ -3833,9 +3833,9 @@ uint16_t mode_tetrix(void) {
}
if (drop->step == 0) { // init brick
- // speed calculation: a single brick should reach bottom of strip in X seconds
- // if the speed is set to 1 this should take 5s and at 255 it should take 0.25s
- // as this is dependant on SEGLEN it should be taken into account and the fact that effect runs every FRAMETIME s
+ // velocidad cálculo: a single brick should reach bottom of tira in X seconds
+ // if the velocidad is set to 1 this should take 5s and at 255 it should take 0.25s
+ // as this is dependant on SEGLEN it should be taken into account and the fact that efecto runs every FRAMETIME s
int speed = SEGMENT.speed ? SEGMENT.speed : hw_random8(1,255);
speed = map(speed, 1, 255, 5000, 250); // time taken for full (SEGLEN) drop
drop->speed = float(SEGLEN * FRAMETIME) / float(speed); // set speed
@@ -3869,7 +3869,7 @@ uint16_t mode_tetrix(void) {
if (drop->step > 2) { // fade strip
drop->brick = 0; // reset brick size (no more growing)
if (drop->step > strip.now) {
- // allow fading of virtual strip
+ // allow fading of virtual tira
for (unsigned i = 0; i < SEGLEN; i++) SEGMENT.blendPixelColor(indexToVStrip(i, stripNr), SEGCOLOR(1), 25); // 10% blend
} else {
drop->stack = 0; // reset brick stack size
@@ -3889,11 +3889,11 @@ static const char _data_FX_MODE_TETRIX[] PROGMEM = "Tetrix@!,Width,,,,One color;
/*
-/ Plasma Effect
+/ Plasma Efecto
/ adapted from https://github.com/atuline/FastLED-Demos/blob/master/plasma/plasma.ino
*/
uint16_t mode_plasma(void) {
- // initialize phases on start
+ // inicializar phases on iniciar
if (SEGENV.call == 0) {
SEGENV.aux0 = hw_random8(0,2); // add a bit of randomness
}
@@ -3914,7 +3914,7 @@ static const char _data_FX_MODE_PLASMA[] PROGMEM = "Plasma@Phase,!;!;!";
/*
* Percentage display
- * Intensity values from 0-100 turn on the leds.
+ * Intensidad values from 0-100 turn on the leds.
*/
uint16_t mode_percent(void) {
@@ -3966,8 +3966,8 @@ static const char _data_FX_MODE_PERCENT[] PROGMEM = "Percent@!,% of fill,,,,One
/*
- * Modulates the brightness similar to a heartbeat
- * (unimplemented?) tries to draw an ECG approximation on a 2D matrix
+ * Modulates the brillo similar to a heartbeat
+ * (unimplemented?) tries to dibujar an ECG approximation on a 2D matrix
*/
uint16_t mode_heartbeat(void) {
unsigned bpm = 40 + (SEGMENT.speed >> 3);
@@ -4004,17 +4004,17 @@ static const char _data_FX_MODE_HEARTBEAT[] PROGMEM = "Heartbeat@!,!;!,!;!;01;m1
// For Dan.
//
//
-// In this animation, there are four "layers" of waves of light.
+// In this animación, there are four "layers" of waves of light.
//
-// Each layer moves independently, and each is scaled separately.
+// Each capa moves independently, and each is scaled separately.
//
// All four wave layers are added together on top of each other, and then
-// another filter is applied that adds "whitecaps" of brightness where the
-// waves line up with each other more. Finally, another pass is taken
-// over the led array to 'deepen' (dim) the blues and greens.
+// another filtro is applied that adds "whitecaps" of brillo where the
+// waves line up with each other more. Finalmente, another pass is taken
+// over the LED matriz to 'deepen' (dim) the blues and greens.
//
-// The speed and scale and motion each layer varies slowly within independent
-// hand-chosen ranges, which is why the code has a lot of low-speed 'beatsin8' functions
+// The velocidad and escala and motion each capa varies slowly within independent
+// hand-chosen ranges, which is why the código has a lot of low-velocidad 'beatsin8' functions
// with a lot of oddly specific numeric ranges.
//
// These three custom blue-green color palettes were inspired by the colors found in
@@ -4022,7 +4022,7 @@ static const char _data_FX_MODE_HEARTBEAT[] PROGMEM = "Heartbeat@!,!;!,!;!;01;m1
//
// Modified for WLED, based on https://github.com/FastLED/FastLED/blob/master/examples/Pacifica/Pacifica.ino
//
-// Add one layer of waves into the led array
+// Add one capa of waves into the LED matriz
static CRGB pacifica_one_layer(uint16_t i, const CRGBPalette16& p, uint16_t cistart, uint16_t wavescale, uint8_t bri, uint16_t ioff)
{
unsigned ci = cistart;
@@ -4058,8 +4058,8 @@ uint16_t mode_pacifica()
pacifica_palette_3 = SEGPALETTE;
}
- // Increment the four "color index start" counters, one for each wave layer.
- // Each is incremented at a different speed, and the speeds vary over time.
+ // Increment the four "color índice iniciar" counters, one for each wave capa.
+ // Each is incremented at a different velocidad, and the speeds vary over time.
unsigned sCIStart1 = SEGENV.aux0, sCIStart2 = SEGENV.aux1, sCIStart3 = SEGENV.step & 0xFFFF, sCIStart4 = (SEGENV.step >> 16);
uint32_t deltams = (FRAMETIME >> 2) + ((FRAMETIME * SEGMENT.speed) >> 7);
uint64_t deltat = (strip.now >> 2) + ((strip.now * SEGMENT.speed) >> 7);
@@ -4077,15 +4077,15 @@ uint16_t mode_pacifica()
SEGENV.aux0 = sCIStart1; SEGENV.aux1 = sCIStart2;
SEGENV.step = (sCIStart4 << 16) | (sCIStart3 & 0xFFFF);
- // Clear out the LED array to a dim background blue-green
- //SEGMENT.fill(132618);
+ // Limpiar out the LED matriz to a dim background blue-green
+ //SEGMENTO.fill(132618);
unsigned basethreshold = beatsin8_t( 9, 55, 65);
unsigned wave = beat8( 7 );
for (unsigned i = 0; i < SEGLEN; i++) {
CRGB c = CRGB(2, 6, 10);
- // Render each of four layers, with different scales and speeds, that vary over time
+ // Renderizar each of four layers, with different scales and speeds, that vary over time
c += pacifica_one_layer(i, pacifica_palette_1, sCIStart1, beatsin16_t(3, 11 * 256, 14 * 256), beatsin8_t(10, 70, 130), 0-beat16(301));
c += pacifica_one_layer(i, pacifica_palette_2, sCIStart2, beatsin16_t(4, 6 * 256, 9 * 256), beatsin8_t(17, 40, 80), beat16(401));
c += pacifica_one_layer(i, pacifica_palette_3, sCIStart3, 6 * 256 , beatsin8_t(9, 10,38) , 0-beat16(503));
@@ -4120,10 +4120,10 @@ static const char _data_FX_MODE_PACIFICA[] PROGMEM = "Pacifica@!,Angle;;!;;pal=5
*/
uint16_t mode_sunrise() {
if (SEGLEN <= 1) return mode_static();
- //speed 0 - static sun
- //speed 1 - 60: sunrise time in minutes
- //speed 60 - 120 : sunset time in minutes - 60;
- //speed above: "breathing" rise and set
+ //velocidad 0 - estático sun
+ //velocidad 1 - 60: sunrise time in minutes
+ //velocidad 60 - 120 : sunset time in minutes - 60;
+ //velocidad above: "breathing" rise and set
if (SEGENV.call == 0 || SEGMENT.speed != SEGENV.aux0) {
SEGENV.step = millis(); //save starting time, millis() because strip.now can change from sync
SEGENV.aux0 = SEGMENT.speed;
@@ -4227,7 +4227,7 @@ static const char _data_FX_MODE_TWINKLEUP[] PROGMEM = "Twinkleup@!,Intensity;!,!
// Peaceful noise that's slow and with gradually changing palettes. Does not support WLED palettes or default colours or controls.
uint16_t mode_noisepal(void) { // Slow noise palette by Andrew Tuline.
unsigned scale = 15 + (SEGMENT.intensity >> 2); //default was 30
- //#define scale 30
+ //#definir escala 30
unsigned dataSize = sizeof(CRGBPalette16) * 2; //allocate space for 2 Palettes (2 * 16 * 3 = 96 bytes)
if (!SEGENV.allocateData(dataSize)) return mode_static(); //allocation failed
@@ -4243,7 +4243,7 @@ uint16_t mode_noisepal(void) { // Slow noise
palettes[1] = CRGBPalette16(CHSV(baseI+hw_random8(64), 255, hw_random8(128,255)), CHSV(baseI+128, 255, hw_random8(128,255)), CHSV(baseI+hw_random8(92), 192, hw_random8(128,255)), CHSV(baseI+hw_random8(92), 255, hw_random8(128,255)));
}
- //EVERY_N_MILLIS(10) { //(don't have to time this, effect function is only called every 24ms)
+ //EVERY_N_MILLIS(10) { //(don't have to time this, efecto función is only called every 24ms)
nblendPaletteTowardPalette(palettes[0], palettes[1], 48); // Blend towards the target palette over 48 iterations.
if (SEGMENT.palette > 0) palettes[0] = SEGPALETTE;
@@ -4260,11 +4260,11 @@ uint16_t mode_noisepal(void) { // Slow noise
static const char _data_FX_MODE_NOISEPAL[] PROGMEM = "Noise Pal@!,Scale;;!";
-// Sine waves that have controllable phase change speed, frequency and cutoff. By Andrew Tuline.
-// SEGMENT.speed ->Speed, SEGMENT.intensity -> Frequency (SEGMENT.fft1 -> Color change, SEGMENT.fft2 -> PWM cutoff)
+// Sine waves that have controllable phase change velocidad, frecuencia and cutoff. By Andrew Tuline.
+// SEGMENTO.velocidad ->Velocidad, SEGMENTO.intensidad -> Frecuencia (SEGMENTO.fft1 -> Color change, SEGMENTO.fft2 -> PWM cutoff)
//
uint16_t mode_sinewave(void) { // Adjustable sinewave. By Andrew Tuline
- //#define qsuba(x, b) ((x>b)?x-b:0) // Analog Unsigned subtraction macro. if result <0, then => 0
+ //#definir qsuba(x, b) ((x>b)?x-b:0) // Analog Unsigned subtraction macro. if resultado <0, then => 0
unsigned colorIndex = strip.now /32;//(256 - SEGMENT.fft1); // Amount of colour change.
@@ -4283,7 +4283,7 @@ static const char _data_FX_MODE_SINEWAVE[] PROGMEM = "Sine@!,Scale;;!";
/*
- * Best of both worlds from Palette and Spot effects. By Aircoookie
+ * Best of both worlds from Paleta and Spot effects. By Aircoookie
*/
uint16_t mode_flow(void)
{
@@ -4322,7 +4322,7 @@ static const char _data_FX_MODE_FLOW[] PROGMEM = "Flow@!,Zones;;!;;m12=1"; //ver
/*
* Dots waving around in a sine/pendulum motion.
- * Little pixel birds flying in a circle. By Aircoookie
+ * Little píxel birds flying in a circle. By Aircoookie
*/
uint16_t mode_chunchun(void)
{
@@ -4369,8 +4369,8 @@ typedef struct Spotlight {
} spotlight;
/*
- * Spotlights moving back and forth that cast dancing shadows.
- * Shine this through tree branches/leaves or other close-up objects that cast
+ * Spotlights moving back and forth that conversión dancing shadows.
+ * Shine this through árbol branches/leaves or other close-up objects that conversión
* interesting shadows onto a ceiling or tarp.
*
* By Steve Pomeroy @xxv
@@ -4393,7 +4393,7 @@ uint16_t mode_dancing_shadows(void)
for (size_t i = 0; i < numSpotlights; i++) {
if (!initialize) {
- // advance the position of the spotlight
+ // advance the posición of the spotlight
int delta = (float)(time - spotlights[i].lastUpdateTime) *
(spotlights[i].speed * ((1.0 + SEGMENT.speed)/100.0));
@@ -4494,7 +4494,7 @@ static const char _data_FX_MODE_DANCING_SHADOWS[] PROGMEM = "Dancing Shadows@!,#
#endif // WLED_PS_DONT_REPLACE_1D_FX
/*
- Imitates a washing machine, rotating same waves forward, then pause, then backward.
+ Imitates a washing machine, rotating same waves forward, then pausar, then backward.
By Stefan Seegel
*/
uint16_t mode_washing_machine(void) {
@@ -4513,8 +4513,8 @@ static const char _data_FX_MODE_WASHING_MACHINE[] PROGMEM = "Washing Machine@!,!
/*
- Image effect
- Draws a .gif image from filesystem on the matrix/strip
+ Image efecto
+ Draws a .gif image from filesystem on the matrix/tira
*/
uint16_t mode_image(void) {
#ifndef WLED_ENABLE_GIF
@@ -4523,9 +4523,9 @@ uint16_t mode_image(void) {
renderImageToSegment(SEGMENT);
return FRAMETIME;
#endif
- // if (status != 0 && status != 254 && status != 255) {
- // Serial.print("GIF renderer return: ");
- // Serial.println(status);
+ // if (estado != 0 && estado != 254 && estado != 255) {
+ // Serie.imprimir("GIF renderer retorno: ");
+ // Serie.println(estado);
// }
}
static const char _data_FX_MODE_IMAGE[] PROGMEM = "Image@!,Blur,;;;12;sx=128,ix=0";
@@ -4599,7 +4599,7 @@ uint16_t mode_tv_simulator(void) {
SEGENV.aux1 = 0;
}
- // create a new sceene
+ // crear a new sceene
if (((strip.now - tvSimulator->sceeneStart) >= tvSimulator->sceeneDuration) || SEGENV.aux1 == 0) {
tvSimulator->sceeneStart = strip.now; // remember the start of the new sceene
tvSimulator->sceeneDuration = hw_random16(60* 250* colorSpeed, 60* 750 * colorSpeed); // duration of a "movie sceene" which has similar colors (5 to 15 minutes with max speed slider)
@@ -4621,12 +4621,12 @@ uint16_t mode_tv_simulator(void) {
j = hw_random8(2 * colorIntensity);
sat = (tvSimulator->sceeneColorSat - j) < 0 ? 0 : tvSimulator->sceeneColorSat - j;
- // brightness
+ // brillo
j = hw_random8(100);
bri = (tvSimulator->sceeneColorBri - j) < 0 ? 0 : tvSimulator->sceeneColorBri - j;
// calculate R,G,B from HSV
- // Source: https://blog.adafruit.com/2012/03/14/constant-brightness-hsb-to-rgb-algorithm/
+ // Source: https://blog.adafruit.com/2012/03/14/constante-brillo-hsb-to-rgb-algoritmo/
{ // just to create a local scope for the variables
uint8_t temp[5], n = (hue >> 8) % 3;
uint8_t x = ((((hue & 255) * sat) >> 8) * bri) >> 8;
@@ -4647,7 +4647,7 @@ uint16_t mode_tv_simulator(void) {
if (SEGENV.aux0 == 0) { // initialize next iteration
SEGENV.aux0 = 1;
- // randomize total duration and fade duration for the actual color
+ // randomize total duración and fade duración for the actual color
tvSimulator->totalTime = hw_random16(250, 2500); // Semi-random pixel-to-pixel time
tvSimulator->fadeTime = hw_random16(0, tvSimulator->totalTime); // Pixel-to-pixel transition time
if (hw_random8(10) < 3) tvSimulator->fadeTime = 0; // Force scene cut 30% of time
@@ -4669,12 +4669,12 @@ uint16_t mode_tv_simulator(void) {
b = nb;
}
- // set strip color
+ // set tira color
for (i = 0; i < (int)SEGLEN; i++) {
SEGMENT.setPixelColor(i, r >> 8, g >> 8, b >> 8); // Quantize to 8-bit
}
- // if total duration has passed, remember last color and restart the loop
+ // if total duración has passed, remember last color and restart the bucle
if ( tvSimulator->elapsed >= tvSimulator->totalTime) {
tvSimulator->pr = nr; // Prev RGB = new RGB
tvSimulator->pg = ng;
@@ -4688,8 +4688,8 @@ static const char _data_FX_MODE_TV_SIMULATOR[] PROGMEM = "TV Simulator@!,!;;!;01
/*
- Aurora effect by @Mazen
- improved and converted to integer math by @dedehai
+ Aurora efecto by @Mazen
+ improved and converted to entero math by @dedehai
*/
//CONFIG
@@ -4749,7 +4749,7 @@ class AuroraWave {
}
CRGBW getColorForLED(int ledIndex) {
- // linear brightness falloff from center to edge of wave
+ // linear brillo falloff from center to edge of wave
if (ledIndex < wave_start || ledIndex > wave_end) return 0;
int32_t ledIndex_scaled = (int32_t)ledIndex << AW_SHIFT;
int32_t offset = ledIndex_scaled - center;
@@ -4769,7 +4769,7 @@ class AuroraWave {
return rgb;
};
- //Change position and age of wave
+ //Change posición and age of wave
//Determine if its still "alive"
void update(uint32_t segment_length, uint32_t speed) {
int32_t step = speed_factor * speed;
@@ -4805,7 +4805,7 @@ uint16_t mode_aurora(void) {
}
waves = reinterpret_cast(SEGENV.data);
- // note: on first call, SEGENV.data is zero -> all waves are dead and will be initialized
+ // note: on first call, SEGENV.datos is zero -> all waves are dead and will be initialized
for (int i = 0; i < SEGENV.aux1; i++) {
waves[i].update(SEGLEN, SEGMENT.speed);
if (!(waves[i].stillAlive())) {
@@ -4841,7 +4841,7 @@ static const char _data_FX_MODE_AURORA[] PROGMEM = "Aurora@!,!;1,2,3;!;;sx=24,pa
// Perlin Move //
/////////////////////////
// 16 bit perlinmove. Use Perlin Noise instead of sinewaves for movement. By Andrew Tuline.
-// Controls are speed, # of pixels, faderate.
+// Controls are velocidad, # of pixels, faderate.
uint16_t mode_perlinmove(void) {
if (SEGLEN <= 1) return mode_static();
SEGMENT.fade_out(255-SEGMENT.custom1);
@@ -4865,7 +4865,7 @@ uint16_t mode_wavesins(void) {
for (unsigned i = 0; i < SEGLEN; i++) {
uint8_t bri = sin8_t(strip.now/4 + i * SEGMENT.intensity);
uint8_t index = beatsin8_t(SEGMENT.speed, SEGMENT.custom1, SEGMENT.custom1+SEGMENT.custom2, 0, i * (SEGMENT.custom3<<3)); // custom3 is reduced resolution slider
- //SEGMENT.setPixelColor(i, ColorFromPalette(SEGPALETTE, index, bri, LINEARBLEND));
+ //SEGMENTO.setPixelColor(i, ColorFromPalette(SEGPALETTE, índice, bri, LINEARBLEND));
SEGMENT.setPixelColor(i, SEGMENT.color_from_palette(index, false, PALETTE_SOLID_WRAP, 0, bri));
}
@@ -4877,7 +4877,7 @@ static const char _data_FX_MODE_WAVESINS[] PROGMEM = "Wavesins@!,Brightness vari
//////////////////////////////
// Flow Stripe //
//////////////////////////////
-// By: ldirko https://editor.soulmatelights.com/gallery/392-flow-led-stripe , modifed by: Andrew Tuline, fixed by @DedeHai
+// By: ldirko https://editor.soulmatelights.com/gallery/392-flow-LED-stripe , modifed by: Andrew Tuline, fixed by @DedeHai
uint16_t mode_FlowStripe(void) {
if (SEGLEN <= 1) return mode_static();
const int hl = SEGLEN * 10 / 13;
@@ -4897,7 +4897,7 @@ uint16_t mode_FlowStripe(void) {
static const char _data_FX_MODE_FLOWSTRIPE[] PROGMEM = "Flow Stripe@Hue speed,Effect speed;;!;pal=11";
/*
- Shimmer effect: moves a gradient with optional modulators across the strip at a given interval, up to 60 seconds
+ Shimmer efecto: moves a gradient with optional modulators across the tira at a given intervalo, up to 60 seconds
It can be used as an overlay to other effects or standalone
by DedeHai (Damian Schneider), based on idea from @Charming-Lime (#4905)
*/
@@ -4927,7 +4927,7 @@ uint16_t mode_shimmer() {
if (SEGENV.aux0 > 0) {
SEGENV.aux0 = (SEGENV.aux0 > deltaTime) ? SEGENV.aux0 - deltaTime : 0;
} else {
- // calculate movement step and update position
+ // calculate movement paso and actualizar posición
int32_t step = 1 + ((speed * deltaTime) >> 5); // subpixels moved this frame. note >>5 as speed is in subpixels/512ms
position += step;
int endposition = (SEGLEN + radius) << 8;
@@ -4976,282 +4976,282 @@ static const char _data_FX_MODE_SHIMMER[] PROGMEM = "Shimmer@Speed,Interval,Size
// Black hole
uint16_t mode_2DBlackHole(void) { // By: Stepko https://editor.soulmatelights.com/gallery/1012 , Modified by: Andrew Tuline
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
int x, y;
- SEGMENT.fadeToBlackBy(16 + (SEGMENT.speed>>3)); // create fading trails
- unsigned long t = strip.now/128; // timebase
+ SEGMENTO.fadeToBlackBy(16 + (SEGMENTO.velocidad>>3)); // crear fading trails
+ unsigned long t = tira.now/128; // timebase
// outer stars
for (size_t i = 0; i < 8; i++) {
- x = beatsin8_t(SEGMENT.custom1>>3, 0, cols - 1, 0, ((i % 2) ? 128 : 0) + t * i);
- y = beatsin8_t(SEGMENT.intensity>>3, 0, rows - 1, 0, ((i % 2) ? 192 : 64) + t * i);
- SEGMENT.addPixelColorXY(x, y, SEGMENT.color_from_palette(i*32, false, PALETTE_SOLID_WRAP, SEGMENT.check1?0:255));
+ x = beatsin8_t(SEGMENTO.custom1>>3, 0, cols - 1, 0, ((i % 2) ? 128 : 0) + t * i);
+ y = beatsin8_t(SEGMENTO.intensidad>>3, 0, rows - 1, 0, ((i % 2) ? 192 : 64) + t * i);
+ SEGMENTO.addPixelColorXY(x, y, SEGMENTO.color_from_palette(i*32, falso, PALETTE_SOLID_WRAP, SEGMENTO.check1?0:255));
}
// inner stars
for (size_t i = 0; i < 4; i++) {
- x = beatsin8_t(SEGMENT.custom2>>3, cols/4, cols - 1 - cols/4, 0, ((i % 2) ? 128 : 0) + t * i);
- y = beatsin8_t(SEGMENT.custom3 , rows/4, rows - 1 - rows/4, 0, ((i % 2) ? 192 : 64) + t * i);
- SEGMENT.addPixelColorXY(x, y, SEGMENT.color_from_palette(255-i*64, false, PALETTE_SOLID_WRAP, SEGMENT.check1?0:255));
+ x = beatsin8_t(SEGMENTO.custom2>>3, cols/4, cols - 1 - cols/4, 0, ((i % 2) ? 128 : 0) + t * i);
+ y = beatsin8_t(SEGMENTO.custom3 , rows/4, rows - 1 - rows/4, 0, ((i % 2) ? 192 : 64) + t * i);
+ SEGMENTO.addPixelColorXY(x, y, SEGMENTO.color_from_palette(255-i*64, falso, PALETTE_SOLID_WRAP, SEGMENTO.check1?0:255));
}
// central white dot
- SEGMENT.setPixelColorXY(cols/2, rows/2, WHITE);
+ SEGMENTO.setPixelColorXY(cols/2, rows/2, WHITE);
// blur everything a bit
- if (SEGMENT.check3) SEGMENT.blur(16, cols*rows < 100);
+ if (SEGMENTO.check3) SEGMENTO.blur(16, cols*rows < 100);
- return FRAMETIME;
+ retorno FRAMETIME;
} // mode_2DBlackHole()
-static const char _data_FX_MODE_2DBLACKHOLE[] PROGMEM = "Black Hole@Fade rate,Outer Y freq.,Outer X freq.,Inner X freq.,Inner Y freq.,Solid,,Blur;!;!;2;pal=11";
+estático constante char _data_FX_MODE_2DBLACKHOLE[] PROGMEM = "Black Hole@Fade rate,Outer Y freq.,Outer X freq.,Inner X freq.,Inner Y freq.,Solid,,Blur;!;!;2;pal=11";
////////////////////////////
// 2D Colored Bursts //
////////////////////////////
uint16_t mode_2DColoredBursts() { // By: ldirko https://editor.soulmatelights.com/gallery/819-colored-bursts , modified by: Andrew Tuline
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
if (SEGENV.call == 0) {
- SEGENV.aux0 = 0; // start with red hue
+ SEGENV.aux0 = 0; // iniciar with red hue
}
- bool dot = SEGMENT.check3;
- bool grad = SEGMENT.check1;
+ bool dot = SEGMENTO.check3;
+ bool grad = SEGMENTO.check1;
- byte numLines = SEGMENT.intensity/16 + 1;
+ byte numLines = SEGMENTO.intensidad/16 + 1;
SEGENV.aux0++; // hue
- SEGMENT.fadeToBlackBy(40 - SEGMENT.check2 * 8);
+ SEGMENTO.fadeToBlackBy(40 - SEGMENTO.check2 * 8);
for (size_t i = 0; i < numLines; i++) {
- byte x1 = beatsin8_t(2 + SEGMENT.speed/16, 0, (cols - 1));
- byte x2 = beatsin8_t(1 + SEGMENT.speed/16, 0, (rows - 1));
- byte y1 = beatsin8_t(5 + SEGMENT.speed/16, 0, (cols - 1), 0, i * 24);
- byte y2 = beatsin8_t(3 + SEGMENT.speed/16, 0, (rows - 1), 0, i * 48 + 64);
+ byte x1 = beatsin8_t(2 + SEGMENTO.velocidad/16, 0, (cols - 1));
+ byte x2 = beatsin8_t(1 + SEGMENTO.velocidad/16, 0, (rows - 1));
+ byte y1 = beatsin8_t(5 + SEGMENTO.velocidad/16, 0, (cols - 1), 0, i * 24);
+ byte y2 = beatsin8_t(3 + SEGMENTO.velocidad/16, 0, (rows - 1), 0, i * 48 + 64);
uint32_t color = ColorFromPalette(SEGPALETTE, i * 255 / numLines + (SEGENV.aux0&0xFF), 255, LINEARBLEND);
byte xsteps = abs8(x1 - y1) + 1;
byte ysteps = abs8(x2 - y2) + 1;
byte steps = xsteps >= ysteps ? xsteps : ysteps;
- //Draw gradient line
+ //Dibujar gradient line
for (size_t j = 1; j <= steps; j++) {
uint8_t rate = j * 255 / steps;
byte dx = lerp8by8(x1, y1, rate);
byte dy = lerp8by8(x2, y2, rate);
- //SEGMENT.setPixelColorXY(dx, dy, grad ? color.nscale8_video(255-rate) : color); // use addPixelColorXY for different look
- SEGMENT.addPixelColorXY(dx, dy, color); // use setPixelColorXY for different look
- if (grad) SEGMENT.fadePixelColorXY(dx, dy, rate);
+ //SEGMENTO.setPixelColorXY(dx, dy, grad ? color.nscale8_video(255-rate) : color); // use addPixelColorXY for different look
+ SEGMENTO.addPixelColorXY(dx, dy, color); // use setPixelColorXY for different look
+ if (grad) SEGMENTO.fadePixelColorXY(dx, dy, rate);
}
if (dot) { //add white point at the ends of line
- SEGMENT.setPixelColorXY(x1, x2, WHITE);
- SEGMENT.setPixelColorXY(y1, y2, DARKSLATEGRAY);
+ SEGMENTO.setPixelColorXY(x1, x2, WHITE);
+ SEGMENTO.setPixelColorXY(y1, y2, DARKSLATEGRAY);
}
}
- SEGMENT.blur(SEGMENT.custom3>>1, SEGMENT.check2);
+ SEGMENTO.blur(SEGMENTO.custom3>>1, SEGMENTO.check2);
- return FRAMETIME;
+ retorno FRAMETIME;
} // mode_2DColoredBursts()
-static const char _data_FX_MODE_2DCOLOREDBURSTS[] PROGMEM = "Colored Bursts@Speed,# of lines,,,Blur,Gradient,Smear,Dots;;!;2;c3=16";
+estático constante char _data_FX_MODE_2DCOLOREDBURSTS[] PROGMEM = "Colored Bursts@Velocidad,# of lines,,,Blur,Gradient,Smear,Dots;;!;2;c3=16";
/////////////////////
// 2D DNA //
/////////////////////
uint16_t mode_2Ddna(void) { // dna originally by by ldirko at https://pastebin.com/pCkkkzcs. Updated by Preyy. WLED conversion by Andrew Tuline.
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
- SEGMENT.fadeToBlackBy(64);
+ SEGMENTO.fadeToBlackBy(64);
for (int i = 0; i < cols; i++) {
- SEGMENT.setPixelColorXY(i, beatsin8_t(SEGMENT.speed/8, 0, rows-1, 0, i*4 ), ColorFromPalette(SEGPALETTE, i*5+strip.now/17, beatsin8_t(5, 55, 255, 0, i*10), LINEARBLEND));
- SEGMENT.setPixelColorXY(i, beatsin8_t(SEGMENT.speed/8, 0, rows-1, 0, i*4+128), ColorFromPalette(SEGPALETTE, i*5+128+strip.now/17, beatsin8_t(5, 55, 255, 0, i*10+128), LINEARBLEND));
+ SEGMENTO.setPixelColorXY(i, beatsin8_t(SEGMENTO.velocidad/8, 0, rows-1, 0, i*4 ), ColorFromPalette(SEGPALETTE, i*5+tira.now/17, beatsin8_t(5, 55, 255, 0, i*10), LINEARBLEND));
+ SEGMENTO.setPixelColorXY(i, beatsin8_t(SEGMENTO.velocidad/8, 0, rows-1, 0, i*4+128), ColorFromPalette(SEGPALETTE, i*5+128+tira.now/17, beatsin8_t(5, 55, 255, 0, i*10+128), LINEARBLEND));
}
- SEGMENT.blur(SEGMENT.intensity / (8 - (SEGMENT.check1 * 2)), SEGMENT.check1);
+ SEGMENTO.blur(SEGMENTO.intensidad / (8 - (SEGMENTO.check1 * 2)), SEGMENTO.check1);
- return FRAMETIME;
+ retorno FRAMETIME;
} // mode_2Ddna()
-static const char _data_FX_MODE_2DDNA[] PROGMEM = "DNA@Scroll speed,Blur,,,,Smear;;!;2;ix=0";
+estático constante char _data_FX_MODE_2DDNA[] PROGMEM = "DNA@Scroll velocidad,Blur,,,,Smear;;!;2;ix=0";
/////////////////////////
// 2D DNA Spiral //
/////////////////////////
uint16_t mode_2DDNASpiral() { // By: ldirko https://editor.soulmatelights.com/gallery/512-dna-spiral-variation , modified by: Andrew Tuline
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
if (SEGENV.call == 0) {
- SEGMENT.fill(BLACK);
+ SEGMENTO.fill(BLACK);
}
- unsigned speeds = SEGMENT.speed/2 + 7;
- unsigned freq = SEGMENT.intensity/8;
+ unsigned speeds = SEGMENTO.velocidad/2 + 7;
+ unsigned freq = SEGMENTO.intensidad/8;
- uint32_t ms = strip.now / 20;
- SEGMENT.fadeToBlackBy(135);
+ uint32_t ms = tira.now / 20;
+ SEGMENTO.fadeToBlackBy(135);
for (int i = 0; i < rows; i++) {
int x = beatsin8_t(speeds, 0, cols - 1, 0, i * freq) + beatsin8_t(speeds - 7, 0, cols - 1, 0, i * freq + 128);
int x1 = beatsin8_t(speeds, 0, cols - 1, 0, 128 + i * freq) + beatsin8_t(speeds - 7, 0, cols - 1, 0, 128 + 64 + i * freq);
unsigned hue = (i * 128 / rows) + ms;
- // skip every 4th row every now and then (fade it more)
+ // omitir every 4th row every now and then (fade it more)
if ((i + ms / 8) & 3) {
- // draw a gradient line between x and x1
+ // dibujar a gradient line between x and x1
x = x / 2; x1 = x1 / 2;
unsigned steps = abs8(x - x1) + 1;
bool positive = (x1 >= x); // direction of drawing
for (size_t k = 1; k <= steps; k++) {
unsigned rate = k * 255 / steps;
//unsigned dx = lerp8by8(x, x1, rate);
- unsigned dx = positive? (x + k-1) : (x - k+1); // behaves the same as "lerp8by8" but does not create holes
- //SEGMENT.setPixelColorXY(dx, i, ColorFromPalette(SEGPALETTE, hue, 255, LINEARBLEND).nscale8_video(rate));
- SEGMENT.addPixelColorXY(dx, i, ColorFromPalette(SEGPALETTE, hue, 255, LINEARBLEND)); // use setPixelColorXY for different look
- SEGMENT.fadePixelColorXY(dx, i, rate);
+ unsigned dx = positive? (x + k-1) : (x - k+1); // behaves the same as "lerp8by8" but does not crear holes
+ //SEGMENTO.setPixelColorXY(dx, i, ColorFromPalette(SEGPALETTE, hue, 255, LINEARBLEND).nscale8_video(rate));
+ SEGMENTO.addPixelColorXY(dx, i, ColorFromPalette(SEGPALETTE, hue, 255, LINEARBLEND)); // use setPixelColorXY for different look
+ SEGMENTO.fadePixelColorXY(dx, i, rate);
}
- SEGMENT.setPixelColorXY(x, i, DARKSLATEGRAY);
- SEGMENT.setPixelColorXY(x1, i, WHITE);
+ SEGMENTO.setPixelColorXY(x, i, DARKSLATEGRAY);
+ SEGMENTO.setPixelColorXY(x1, i, WHITE);
}
}
- SEGMENT.blur(((uint16_t)SEGMENT.custom1 * 3) / (6 + SEGMENT.check1), SEGMENT.check1);
+ SEGMENTO.blur(((uint16_t)SEGMENTO.custom1 * 3) / (6 + SEGMENTO.check1), SEGMENTO.check1);
- return FRAMETIME;
+ retorno FRAMETIME;
} // mode_2DDNASpiral()
-static const char _data_FX_MODE_2DDNASPIRAL[] PROGMEM = "DNA Spiral@Scroll speed,Y frequency,Blur,,,Smear;;!;2;c1=0";
+estático constante char _data_FX_MODE_2DDNASPIRAL[] PROGMEM = "DNA Spiral@Scroll velocidad,Y frecuencia,Blur,,,Smear;;!;2;c1=0";
/////////////////////////
// 2D Drift //
/////////////////////////
uint16_t mode_2DDrift() { // By: Stepko https://editor.soulmatelights.com/gallery/884-drift , Modified by: Andrew Tuline
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
- const int colsCenter = (cols>>1) + (cols%2);
- const int rowsCenter = (rows>>1) + (rows%2);
+ constante int colsCenter = (cols>>1) + (cols%2);
+ constante int rowsCenter = (rows>>1) + (rows%2);
- SEGMENT.fadeToBlackBy(128);
- const float maxDim = MAX(cols, rows)/2;
- unsigned long t = strip.now / (32 - (SEGMENT.speed>>3));
+ SEGMENTO.fadeToBlackBy(128);
+ constante flotante maxDim = MAX(cols, rows)/2;
+ unsigned long t = tira.now / (32 - (SEGMENTO.velocidad>>3));
unsigned long t_20 = t/20; // softhack007: pre-calculating this gives about 10% speedup
- for (float i = 1.0f; i < maxDim; i += 0.25f) {
- float angle = radians(t * (maxDim - i));
+ for (flotante i = 1.0f; i < maxDim; i += 0.25f) {
+ flotante angle = radians(t * (maxDim - i));
int mySin = sin_t(angle) * i;
int myCos = cos_t(angle) * i;
- SEGMENT.setPixelColorXY(colsCenter + mySin, rowsCenter + myCos, ColorFromPalette(SEGPALETTE, (i * 20) + t_20, 255, LINEARBLEND));
- if (SEGMENT.check1) SEGMENT.setPixelColorXY(colsCenter + myCos, rowsCenter + mySin, ColorFromPalette(SEGPALETTE, (i * 20) + t_20, 255, LINEARBLEND));
+ SEGMENTO.setPixelColorXY(colsCenter + mySin, rowsCenter + myCos, ColorFromPalette(SEGPALETTE, (i * 20) + t_20, 255, LINEARBLEND));
+ if (SEGMENTO.check1) SEGMENTO.setPixelColorXY(colsCenter + myCos, rowsCenter + mySin, ColorFromPalette(SEGPALETTE, (i * 20) + t_20, 255, LINEARBLEND));
}
- SEGMENT.blur(SEGMENT.intensity>>(3 - SEGMENT.check2), SEGMENT.check2);
+ SEGMENTO.blur(SEGMENTO.intensidad>>(3 - SEGMENTO.check2), SEGMENTO.check2);
- return FRAMETIME;
+ retorno FRAMETIME;
} // mode_2DDrift()
-static const char _data_FX_MODE_2DDRIFT[] PROGMEM = "Drift@Rotation speed,Blur,,,,Twin,Smear;;!;2;ix=0";
+estático constante char _data_FX_MODE_2DDRIFT[] PROGMEM = "Drift@Rotation velocidad,Blur,,,,Twin,Smear;;!;2;ix=0";
//////////////////////////
// 2D Firenoise //
//////////////////////////
-uint16_t mode_2Dfirenoise(void) { // firenoise2d. By Andrew Tuline. Yet another short routine.
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+uint16_t mode_2Dfirenoise(void) { // firenoise2d. By Andrew Tuline. Yet another short rutina.
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
if (SEGENV.call == 0) {
- SEGMENT.fill(BLACK);
+ SEGMENTO.fill(BLACK);
}
- unsigned xscale = SEGMENT.intensity*4;
- unsigned yscale = SEGMENT.speed*8;
+ unsigned xscale = SEGMENTO.intensidad*4;
+ unsigned yscale = SEGMENTO.velocidad*8;
unsigned indexx = 0;
- //CRGBPalette16 pal = SEGMENT.check1 ? SEGPALETTE : SEGMENT.loadPalette(pal, 35);
- CRGBPalette16 pal = SEGMENT.check1 ? SEGPALETTE : CRGBPalette16(CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black,
+ //CRGBPalette16 pal = SEGMENTO.check1 ? SEGPALETTE : SEGMENTO.loadPalette(pal, 35);
+ CRGBPalette16 pal = SEGMENTO.check1 ? SEGPALETTE : CRGBPalette16(CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black,
CRGB::Red, CRGB::Red, CRGB::Red, CRGB::DarkOrange,
CRGB::DarkOrange,CRGB::DarkOrange, CRGB::Orange, CRGB::Orange,
CRGB::Yellow, CRGB::Orange, CRGB::Yellow, CRGB::Yellow);
for (int j=0; j < cols; j++) {
for (int i=0; i < rows; i++) {
- indexx = perlin8(j*yscale*rows/255, i*xscale+strip.now/4); // We're moving along our Perlin map.
- SEGMENT.setPixelColorXY(j, i, ColorFromPalette(pal, min(i*indexx/11, 225U), i*255/rows, LINEARBLEND)); // With that value, look up the 8 bit colour palette value and assign it to the current LED.
+ indexx = perlin8(j*yscale*rows/255, i*xscale+tira.now/4); // We're moving along our Perlin map.
+ SEGMENTO.setPixelColorXY(j, i, ColorFromPalette(pal, min(i*indexx/11, 225U), i*255/rows, LINEARBLEND)); // With that valor, look up the 8 bit colour palette valor and assign it to the current LED.
} // for i
} // for j
- return FRAMETIME;
+ retorno FRAMETIME;
} // mode_2Dfirenoise()
-static const char _data_FX_MODE_2DFIRENOISE[] PROGMEM = "Firenoise@X scale,Y scale,,,,Palette;;!;2;pal=66";
+estático constante char _data_FX_MODE_2DFIRENOISE[] PROGMEM = "Firenoise@X escala,Y escala,,,,Paleta;;!;2;pal=66";
//////////////////////////////
// 2D Frizzles //
//////////////////////////////
uint16_t mode_2DFrizzles(void) { // By: Stepko https://editor.soulmatelights.com/gallery/640-color-frizzles , Modified by: Andrew Tuline
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
- SEGMENT.fadeToBlackBy(16 + SEGMENT.check1 * 10);
+ SEGMENTO.fadeToBlackBy(16 + SEGMENTO.check1 * 10);
for (size_t i = 8; i > 0; i--) {
- SEGMENT.addPixelColorXY(beatsin8_t(SEGMENT.speed/8 + i, 0, cols - 1),
- beatsin8_t(SEGMENT.intensity/8 - i, 0, rows - 1),
+ SEGMENTO.addPixelColorXY(beatsin8_t(SEGMENTO.velocidad/8 + i, 0, cols - 1),
+ beatsin8_t(SEGMENTO.intensidad/8 - i, 0, rows - 1),
ColorFromPalette(SEGPALETTE, beatsin8_t(12, 0, 255), 255, LINEARBLEND));
}
- SEGMENT.blur(SEGMENT.custom1 >> (3 + SEGMENT.check1), SEGMENT.check1);
- return FRAMETIME;
+ SEGMENTO.blur(SEGMENTO.custom1 >> (3 + SEGMENTO.check1), SEGMENTO.check1);
+ retorno FRAMETIME;
} // mode_2DFrizzles()
-static const char _data_FX_MODE_2DFRIZZLES[] PROGMEM = "Frizzles@X frequency,Y frequency,Blur,,,Smear;;!;2";
+estático constante char _data_FX_MODE_2DFRIZZLES[] PROGMEM = "Frizzles@X frecuencia,Y frecuencia,Blur,,,Smear;;!;2";
///////////////////////////////////////////
// 2D Cellular Automata Game of life //
///////////////////////////////////////////
-typedef struct Cell {
+definición de tipo estructura Cell {
uint8_t alive : 1, faded : 1, toggleStatus : 1, edgeCell: 1, oscillatorCheck : 1, spaceshipCheck : 1, unused : 2;
} Cell;
uint16_t mode_2Dgameoflife(void) { // Written by Ewoud Wijma, inspired by https://natureofcode.com/book/chapter-7-cellular-automata/
// and https://github.com/DougHaber/nlife-color , Modified By: Brandon Butler
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
- const int cols = SEG_W, rows = SEG_H;
- const unsigned maxIndex = cols * rows;
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
+ constante int cols = SEG_W, rows = SEG_H;
+ constante unsigned maxIndex = cols * rows;
- if (!SEGENV.allocateData(SEGMENT.length() * sizeof(Cell))) return mode_static(); // allocation failed
+ if (!SEGENV.allocateData(SEGMENTO.longitud() * sizeof(Cell))) retorno mode_static(); // allocation failed
- Cell *cells = reinterpret_cast (SEGENV.data);
+ Cell *cells = reinterpret_cast (SEGENV.datos);
uint16_t& generation = SEGENV.aux0, &gliderLength = SEGENV.aux1; // rename aux variables for clarity
- bool mutate = SEGMENT.check3;
- uint8_t blur = map(SEGMENT.custom1, 0, 255, 255, 4);
+ bool mutate = SEGMENTO.check3;
+ uint8_t blur = map(SEGMENTO.custom1, 0, 255, 255, 4);
uint32_t bgColor = SEGCOLOR(1);
- uint32_t birthColor = SEGMENT.color_from_palette(128, false, PALETTE_SOLID_WRAP, 255);
+ uint32_t birthColor = SEGMENTO.color_from_palette(128, falso, PALETTE_SOLID_WRAP, 255);
- bool setup = SEGENV.call == 0;
- if (setup) {
- // Calculate glider length LCM(rows,cols)*4 once
+ bool configuración = SEGENV.call == 0;
+ if (configuración) {
+ // Calculate glider longitud LCM(rows,cols)*4 once
unsigned a = rows, b = cols;
while (b) { unsigned t = b; b = a % b; a = t; }
gliderLength = (cols * rows / a) << 2;
}
- if (abs(long(strip.now) - long(SEGENV.step)) > 2000) SEGENV.step = 0; // Timebase jump fix
- bool paused = SEGENV.step > strip.now;
+ if (abs(long(tira.now) - long(SEGENV.paso)) > 2000) SEGENV.paso = 0; // Timebase jump fix
+ bool paused = SEGENV.paso > tira.now;
- // Setup New Game of Life
- if ((!paused && generation == 0) || setup) {
- SEGENV.step = strip.now + 1280; // show initial state for 1.28 seconds
+ // Configuración New Game of Life
+ if ((!paused && generation == 0) || configuración) {
+ SEGENV.paso = tira.now + 1280; // show initial estado for 1.28 seconds
generation = 1;
- paused = true;
- //Setup Grid
+ paused = verdadero;
+ //Configuración Grid
memset(cells, 0, maxIndex * sizeof(Cell));
for (unsigned i = 0; i < maxIndex; i++) {
@@ -5261,48 +5261,48 @@ uint16_t mode_2Dgameoflife(void) { // Written by Ewoud Wijma, inspired by https:
unsigned x = i % cols, y = i / cols;
cells[i].edgeCell = (x == 0 || x == cols-1 || y == 0 || y == rows-1);
- SEGMENT.setPixelColor(i, isAlive ? SEGMENT.color_from_palette(hw_random8(), false, PALETTE_SOLID_WRAP, 0) : bgColor);
+ SEGMENTO.setPixelColor(i, isAlive ? SEGMENTO.color_from_palette(hw_random8(), falso, PALETTE_SOLID_WRAP, 0) : bgColor);
}
}
- if (paused || (strip.now - SEGENV.step < 1000 / map(SEGMENT.speed,0,255,1,42))) {
- // Redraw if paused or between updates to remove blur
+ if (paused || (tira.now - SEGENV.paso < 1000 / map(SEGMENTO.velocidad,0,255,1,42))) {
+ // Redraw if paused or between updates to eliminar blur
for (unsigned i = maxIndex; i--; ) {
if (!cells[i].alive) {
- uint32_t cellColor = SEGMENT.getPixelColor(i);
+ uint32_t cellColor = SEGMENTO.getPixelColor(i);
if (cellColor != bgColor) {
uint32_t newColor;
- bool needsColor = false;
- if (cells[i].faded) { newColor = bgColor; needsColor = true; }
+ bool needsColor = falso;
+ if (cells[i].faded) { newColor = bgColor; needsColor = verdadero; }
else {
uint32_t blended = color_blend(cellColor, bgColor, 2);
if (blended == cellColor) { blended = bgColor; cells[i].faded = 1; }
- newColor = blended; needsColor = true;
+ newColor = blended; needsColor = verdadero;
}
- if (needsColor) SEGMENT.setPixelColor(i, newColor);
+ if (needsColor) SEGMENTO.setPixelColor(i, newColor);
}
}
}
- return FRAMETIME;
+ retorno FRAMETIME;
}
// Repeat detection
bool updateOscillator = generation % 16 == 0;
bool updateSpaceship = gliderLength && generation % gliderLength == 0;
- bool repeatingOscillator = true, repeatingSpaceship = true, emptyGrid = true;
+ bool repeatingOscillator = verdadero, repeatingSpaceship = verdadero, emptyGrid = verdadero;
unsigned cIndex = maxIndex-1;
for (unsigned y = rows; y--; ) for (unsigned x = cols; x--; cIndex--) {
Cell& cell = cells[cIndex];
- if (cell.alive) emptyGrid = false;
- if (cell.oscillatorCheck != cell.alive) repeatingOscillator = false;
- if (cell.spaceshipCheck != cell.alive) repeatingSpaceship = false;
+ if (cell.alive) emptyGrid = falso;
+ if (cell.oscillatorCheck != cell.alive) repeatingOscillator = falso;
+ if (cell.spaceshipCheck != cell.alive) repeatingSpaceship = falso;
if (updateOscillator) cell.oscillatorCheck = cell.alive;
if (updateSpaceship) cell.spaceshipCheck = cell.alive;
unsigned neighbors = 0, aliveParents = 0, parentIdx[3];
- // Count alive neighbors
+ // Conteo alive neighbors
for (int i = -1; i <= 1; i++) for (int j = -1; j <= 1; j++) if (i || j) {
int nX = x + j, nY = y + i;
if (cell.edgeCell) {
@@ -5320,13 +5320,13 @@ uint16_t mode_2Dgameoflife(void) { // Written by Ewoud Wijma, inspired by https:
}
uint32_t newColor;
- bool needsColor = false;
+ bool needsColor = falso;
if (cell.alive && (neighbors < 2 || neighbors > 3)) { // Loneliness or Overpopulation
cell.toggleStatus = 1;
if (blur == 255) cell.faded = 1;
- newColor = cell.faded ? bgColor : color_blend(SEGMENT.getPixelColor(cIndex), bgColor, blur);
- needsColor = true;
+ newColor = cell.faded ? bgColor : color_blend(SEGMENTO.getPixelColor(cIndex), bgColor, blur);
+ needsColor = verdadero;
}
else if (!cell.alive) {
byte mutationRoll = mutate ? hw_random8(128) : 1; // if 0: 3 neighbor births fail and 2 neighbor births mutate
@@ -5337,109 +5337,109 @@ uint16_t mode_2Dgameoflife(void) { // Written by Ewoud Wijma, inspired by https:
if (aliveParents) {
// Set color based on random neighbor
unsigned parentIndex = parentIdx[random8(aliveParents)];
- birthColor = SEGMENT.getPixelColor(parentIndex);
+ birthColor = SEGMENTO.getPixelColor(parentIndex);
}
newColor = birthColor;
- needsColor = true;
+ needsColor = verdadero;
}
else if (!cell.faded) {// No change, fade dead cells
- uint32_t cellColor = SEGMENT.getPixelColor(cIndex);
+ uint32_t cellColor = SEGMENTO.getPixelColor(cIndex);
uint32_t blended = color_blend(cellColor, bgColor, blur);
if (blended == cellColor) { blended = bgColor; cell.faded = 1; }
newColor = blended;
- needsColor = true;
+ needsColor = verdadero;
}
}
- if (needsColor) SEGMENT.setPixelColor(cIndex, newColor);
+ if (needsColor) SEGMENTO.setPixelColor(cIndex, newColor);
}
- // Loop through cells, if toggle, swap alive status
+ // Bucle through cells, if toggle, swap alive estado
for (unsigned i = maxIndex; i--; ) {
cells[i].alive ^= cells[i].toggleStatus;
cells[i].toggleStatus = 0;
}
if (repeatingOscillator || repeatingSpaceship || emptyGrid) {
- generation = 0; // reset on next call
- SEGENV.step += 1024; // pause final generation for ~1 second
+ generation = 0; // restablecer on next call
+ SEGENV.paso += 1024; // pausar final generation for ~1 second
}
else {
++generation;
- SEGENV.step = strip.now;
+ SEGENV.paso = tira.now;
}
- return FRAMETIME;
+ retorno FRAMETIME;
} // mode_2Dgameoflife()
-static const char _data_FX_MODE_2DGAMEOFLIFE[] PROGMEM = "Game Of Life@!,,Blur,,,,,Mutation;!,!;!;2;pal=11,sx=128";
+estático constante char _data_FX_MODE_2DGAMEOFLIFE[] PROGMEM = "Game Of Life@!,,Blur,,,,,Mutation;!,!;!;2;pal=11,sx=128";
/////////////////////////
// 2D Hiphotic //
/////////////////////////
uint16_t mode_2DHiphotic() { // By: ldirko https://editor.soulmatelights.com/gallery/810 , Modified by: Andrew Tuline
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
- const uint32_t a = strip.now / ((SEGMENT.custom3>>1)+1);
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
+ constante uint32_t a = tira.now / ((SEGMENTO.custom3>>1)+1);
for (int x = 0; x < cols; x++) {
for (int y = 0; y < rows; y++) {
- SEGMENT.setPixelColorXY(x, y, SEGMENT.color_from_palette(sin8_t(cos8_t(x * SEGMENT.speed/16 + a / 3) + sin8_t(y * SEGMENT.intensity/16 + a / 4) + a), false, PALETTE_SOLID_WRAP, 0));
+ SEGMENTO.setPixelColorXY(x, y, SEGMENTO.color_from_palette(sin8_t(cos8_t(x * SEGMENTO.velocidad/16 + a / 3) + sin8_t(y * SEGMENTO.intensidad/16 + a / 4) + a), falso, PALETTE_SOLID_WRAP, 0));
}
}
- return FRAMETIME;
+ retorno FRAMETIME;
} // mode_2DHiphotic()
-static const char _data_FX_MODE_2DHIPHOTIC[] PROGMEM = "Hiphotic@X scale,Y scale,,,Speed;!;!;2";
+estático constante char _data_FX_MODE_2DHIPHOTIC[] PROGMEM = "Hiphotic@X escala,Y escala,,,Velocidad;!;!;2";
/////////////////////////
// 2D Julia //
/////////////////////////
// Sliders are:
-// intensity = Maximum number of iterations per pixel.
+// intensidad = Máximo number of iterations per píxel.
// Custom1 = Location of X centerpoint
// Custom2 = Location of Y centerpoint
-// Custom3 = Size of the area (small value = smaller area)
-typedef struct Julia {
- float xcen;
- float ycen;
- float xymag;
+// Custom3 = Tamaño of the area (small valor = smaller area)
+definición de tipo estructura Julia {
+ flotante xcen;
+ flotante ycen;
+ flotante xymag;
} julia;
uint16_t mode_2DJulia(void) { // An animated Julia set by Andrew Tuline.
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
- if (!SEGENV.allocateData(sizeof(julia))) return mode_static();
- Julia* julias = reinterpret_cast(SEGENV.data);
+ if (!SEGENV.allocateData(sizeof(julia))) retorno mode_static();
+ Julia* julias = reinterpret_cast(SEGENV.datos);
- float reAl;
- float imAg;
+ flotante reAl;
+ flotante imAg;
- if (SEGENV.call == 0) { // Reset the center if we've just re-started this animation.
+ if (SEGENV.call == 0) { // Restablecer the center if we've just re-started this animación.
julias->xcen = 0.;
julias->ycen = 0.;
julias->xymag = 1.0;
- SEGMENT.custom1 = 128; // Make sure the location widgets are centered to start.
- SEGMENT.custom2 = 128;
- SEGMENT.custom3 = 16;
- SEGMENT.intensity = 24;
+ SEGMENTO.custom1 = 128; // Make sure the location widgets are centered to iniciar.
+ SEGMENTO.custom2 = 128;
+ SEGMENTO.custom3 = 16;
+ SEGMENTO.intensidad = 24;
}
- julias->xcen = julias->xcen + (float)(SEGMENT.custom1 - 128)/100000.f;
- julias->ycen = julias->ycen + (float)(SEGMENT.custom2 - 128)/100000.f;
- julias->xymag = julias->xymag + (float)((SEGMENT.custom3 - 16)<<3)/100000.f; // reduced resolution slider
+ julias->xcen = julias->xcen + (flotante)(SEGMENTO.custom1 - 128)/100000.f;
+ julias->ycen = julias->ycen + (flotante)(SEGMENTO.custom2 - 128)/100000.f;
+ julias->xymag = julias->xymag + (flotante)((SEGMENTO.custom3 - 16)<<3)/100000.f; // reduced resolución slider
if (julias->xymag < 0.01f) julias->xymag = 0.01f;
if (julias->xymag > 1.0f) julias->xymag = 1.0f;
- float xmin = julias->xcen - julias->xymag;
- float xmax = julias->xcen + julias->xymag;
- float ymin = julias->ycen - julias->xymag;
- float ymax = julias->ycen + julias->xymag;
+ flotante xmin = julias->xcen - julias->xymag;
+ flotante xmax = julias->xcen + julias->xymag;
+ flotante ymin = julias->ycen - julias->xymag;
+ flotante ymax = julias->ycen + julias->xymag;
// Whole set should be within -1.2,1.2 to -.8 to 1.
xmin = constrain(xmin, -1.2f, 1.2f);
@@ -5447,44 +5447,44 @@ uint16_t mode_2DJulia(void) { // An animated Julia set
ymin = constrain(ymin, -0.8f, 1.0f);
ymax = constrain(ymax, -0.8f, 1.0f);
- float dx; // Delta x is mapped to the matrix size.
- float dy; // Delta y is mapped to the matrix size.
+ flotante dx; // Delta x is mapped to the matrix tamaño.
+ flotante dy; // Delta y is mapped to the matrix tamaño.
- int maxIterations = 15; // How many iterations per pixel before we give up. Make it 8 bits to match our range of colours.
- float maxCalc = 16.0; // How big is each calculation allowed to be before we give up.
+ int maxIterations = 15; // How many iterations per píxel before we give up. Make it 8 bits to coincidir our rango of colours.
+ flotante maxCalc = 16.0; // How big is each cálculo allowed to be before we give up.
- maxIterations = SEGMENT.intensity/2;
+ maxIterations = SEGMENTO.intensidad/2;
// Resize section on the fly for some animaton.
reAl = -0.94299f; // PixelBlaze example
imAg = 0.3162f;
- reAl += (float)sin16_t(strip.now * 34) / 655340.f;
- imAg += (float)sin16_t(strip.now * 26) / 655340.f;
+ reAl += (flotante)sin16_t(tira.now * 34) / 655340.f;
+ imAg += (flotante)sin16_t(tira.now * 26) / 655340.f;
- dx = (xmax - xmin) / (cols); // Scale the delta x and y values to our matrix size.
+ dx = (xmax - xmin) / (cols); // Escala the delta x and y values to our matrix tamaño.
dy = (ymax - ymin) / (rows);
- // Start y
- float y = ymin;
+ // Iniciar y
+ flotante y = ymin;
for (int j = 0; j < rows; j++) {
- // Start x
- float x = xmin;
+ // Iniciar x
+ flotante x = xmin;
for (int i = 0; i < cols; i++) {
- // Now we test, as we iterate z = z^2 + c does z tend towards infinity?
- float a = x;
- float b = y;
+ // Now we test, as we iterate z = z^2 + c does z tend towards infinito?
+ flotante a = x;
+ flotante b = y;
int iter = 0;
while (iter < maxIterations) { // Here we determine whether or not we're out of bounds.
- float aa = a * a;
- float bb = b * b;
- float len = aa + bb;
- if (len > maxCalc) { // |z| = sqrt(a^2+b^2) OR z^2 = a^2+b^2 to save on having to perform a square root.
- break; // Bail
+ flotante aa = a * a;
+ flotante bb = b * b;
+ flotante len = aa + bb;
+ if (len > maxCalc) { // |z| = sqrt(a^2+b^2) OR z^2 = a^2+b^2 to guardar on having to perform a square root.
+ ruptura; // Bail
}
// This operation corresponds to z -> z^2+c where z=a+ib c=(x,y). Remember to use 'foil'.
@@ -5493,77 +5493,77 @@ uint16_t mode_2DJulia(void) { // An animated Julia set
iter++;
} // while
- // We color each pixel based on how long it takes to get to infinity, or black if it never gets there.
+ // We color each píxel based on how long it takes to get to infinito, or black if it never gets there.
if (iter == maxIterations) {
- SEGMENT.setPixelColorXY(i, j, 0);
+ SEGMENTO.setPixelColorXY(i, j, 0);
} else {
- SEGMENT.setPixelColorXY(i, j, SEGMENT.color_from_palette(iter*255/maxIterations, false, PALETTE_SOLID_WRAP, 0));
+ SEGMENTO.setPixelColorXY(i, j, SEGMENTO.color_from_palette(iter*255/maxIterations, falso, PALETTE_SOLID_WRAP, 0));
}
x += dx;
}
y += dy;
}
- if(SEGMENT.check1)
- SEGMENT.blur(100, true);
+ if(SEGMENTO.check1)
+ SEGMENTO.blur(100, verdadero);
- return FRAMETIME;
+ retorno FRAMETIME;
} // mode_2DJulia()
-static const char _data_FX_MODE_2DJULIA[] PROGMEM = "Julia@,Max iterations per pixel,X center,Y center,Area size, Blur;!;!;2;ix=24,c1=128,c2=128,c3=16";
+estático constante char _data_FX_MODE_2DJULIA[] PROGMEM = "Julia@,Max iterations per píxel,X center,Y center,Area tamaño, Blur;!;!;2;ix=24,c1=128,c2=128,c3=16";
//////////////////////////////
// 2D Lissajous //
//////////////////////////////
uint16_t mode_2DLissajous(void) { // By: Andrew Tuline
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
- SEGMENT.fadeToBlackBy(SEGMENT.intensity);
- uint_fast16_t phase = (strip.now * (1 + SEGENV.custom3)) /32; // allow user to control rotation speed
+ SEGMENTO.fadeToBlackBy(SEGMENTO.intensidad);
+ uint_fast16_t phase = (tira.now * (1 + SEGENV.custom3)) /32; // allow usuario to control rotation velocidad
//for (int i=0; i < 4*(cols+rows); i ++) {
for (int i=0; i < 256; i ++) {
- //float xlocn = float(sin8_t(now/4+i*(SEGMENT.speed>>5))) / 255.0f;
- //float ylocn = float(cos8_t(now/4+i*2)) / 255.0f;
- uint_fast8_t xlocn = sin8_t(phase/2 + (i*SEGMENT.speed)/32);
+ //flotante xlocn = flotante(sin8_t(now/4+i*(SEGMENTO.velocidad>>5))) / 255.0f;
+ //flotante ylocn = flotante(cos8_t(now/4+i*2)) / 255.0f;
+ uint_fast8_t xlocn = sin8_t(phase/2 + (i*SEGMENTO.velocidad)/32);
uint_fast8_t ylocn = cos8_t(phase/2 + i*2);
xlocn = (cols < 2) ? 1 : (map(2*xlocn, 0,511, 0,2*(cols-1)) +1) /2; // softhack007: "(2* ..... +1) /2" for proper rounding
ylocn = (rows < 2) ? 1 : (map(2*ylocn, 0,511, 0,2*(rows-1)) +1) /2; // "rows > 1" is needed to avoid div/0 in map()
- SEGMENT.setPixelColorXY((uint8_t)xlocn, (uint8_t)ylocn, SEGMENT.color_from_palette(strip.now/100+i, false, PALETTE_SOLID_WRAP, 0));
+ SEGMENTO.setPixelColorXY((uint8_t)xlocn, (uint8_t)ylocn, SEGMENTO.color_from_palette(tira.now/100+i, falso, PALETTE_SOLID_WRAP, 0));
}
- SEGMENT.blur(SEGMENT.custom1 >> (1 + SEGMENT.check1 * 3), SEGMENT.check1);
+ SEGMENTO.blur(SEGMENTO.custom1 >> (1 + SEGMENTO.check1 * 3), SEGMENTO.check1);
- return FRAMETIME;
+ retorno FRAMETIME;
} // mode_2DLissajous()
-static const char _data_FX_MODE_2DLISSAJOUS[] PROGMEM = "Lissajous@X frequency,Fade rate,Blur,,Speed,Smear;!;!;2;c1=0";
+estático constante char _data_FX_MODE_2DLISSAJOUS[] PROGMEM = "Lissajous@X frecuencia,Fade rate,Blur,,Velocidad,Smear;!;!;2;c1=0";
///////////////////////
// 2D Matrix //
///////////////////////
uint16_t mode_2Dmatrix(void) { // Matrix2D. By Jeremy Williams. Adapted by Andrew Tuline & improved by merkisoft and ewowi, and softhack007.
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
- const auto XY = [&](int x, int y) { return (x%cols) + (y%rows) * cols; };
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
+ constante auto XY = [&](int x, int y) { retorno (x%cols) + (y%rows) * cols; };
- unsigned dataSize = (SEGMENT.length()+7) >> 3; //1 bit per LED for trails
- if (!SEGENV.allocateData(dataSize)) return mode_static(); //allocation failed
+ unsigned dataSize = (SEGMENTO.longitud()+7) >> 3; //1 bit per LED for trails
+ if (!SEGENV.allocateData(dataSize)) retorno mode_static(); //allocation failed
if (SEGENV.call == 0) {
- SEGMENT.fill(BLACK);
- SEGENV.step = 0;
+ SEGMENTO.fill(BLACK);
+ SEGENV.paso = 0;
}
- uint8_t fade = map(SEGMENT.custom1, 0, 255, 50, 250); // equals trail size
- uint8_t speed = (256-SEGMENT.speed) >> map(min(rows, 150), 0, 150, 0, 3); // slower speeds for small displays
+ uint8_t fade = map(SEGMENTO.custom1, 0, 255, 50, 250); // equals trail tamaño
+ uint8_t velocidad = (256-SEGMENTO.velocidad) >> map(min(rows, 150), 0, 150, 0, 3); // slower speeds for small displays
uint32_t spawnColor;
uint32_t trailColor;
- if (SEGMENT.check1) {
+ if (SEGMENTO.check1) {
spawnColor = SEGCOLOR(0);
trailColor = SEGCOLOR(1);
} else {
@@ -5571,71 +5571,71 @@ uint16_t mode_2Dmatrix(void) { // Matrix2D. By Jeremy Williams.
trailColor = RGBW32(27,130,39,0);
}
- bool emptyScreen = true;
- if (strip.now - SEGENV.step >= speed) {
- SEGENV.step = strip.now;
+ bool emptyScreen = verdadero;
+ if (tira.now - SEGENV.paso >= velocidad) {
+ SEGENV.paso = tira.now;
// move pixels one row down. Falling codes keep color and add trail pixels; all others pixels are faded
- // TODO: it would be better to paint trails idividually instead of relying on fadeToBlackBy()
- SEGMENT.fadeToBlackBy(fade);
+ // TODO: it would be better to pintar trails idividually instead of relying on fadeToBlackBy()
+ SEGMENTO.fadeToBlackBy(fade);
for (int row = rows-1; row >= 0; row--) {
for (int col = 0; col < cols; col++) {
- unsigned index = XY(col, row) >> 3;
+ unsigned índice = XY(col, row) >> 3;
unsigned bitNum = XY(col, row) & 0x07;
- if (bitRead(SEGENV.data[index], bitNum)) {
- SEGMENT.setPixelColorXY(col, row, trailColor); // create trail
- bitClear(SEGENV.data[index], bitNum);
+ if (bitRead(SEGENV.datos[índice], bitNum)) {
+ SEGMENTO.setPixelColorXY(col, row, trailColor); // crear trail
+ bitClear(SEGENV.datos[índice], bitNum);
if (row < rows-1) {
- SEGMENT.setPixelColorXY(col, row+1, spawnColor);
- index = XY(col, row+1) >> 3;
+ SEGMENTO.setPixelColorXY(col, row+1, spawnColor);
+ índice = XY(col, row+1) >> 3;
bitNum = XY(col, row+1) & 0x07;
- bitSet(SEGENV.data[index], bitNum);
- emptyScreen = false;
+ bitSet(SEGENV.datos[índice], bitNum);
+ emptyScreen = falso;
}
}
}
}
- // spawn new falling code
- if (hw_random8() <= SEGMENT.intensity || emptyScreen) {
+ // spawn new falling código
+ if (hw_random8() <= SEGMENTO.intensidad || emptyScreen) {
uint8_t spawnX = hw_random8(cols);
- SEGMENT.setPixelColorXY(spawnX, 0, spawnColor);
- // update hint for next run
- unsigned index = XY(spawnX, 0) >> 3;
+ SEGMENTO.setPixelColorXY(spawnX, 0, spawnColor);
+ // actualizar hint for next run
+ unsigned índice = XY(spawnX, 0) >> 3;
unsigned bitNum = XY(spawnX, 0) & 0x07;
- bitSet(SEGENV.data[index], bitNum);
+ bitSet(SEGENV.datos[índice], bitNum);
}
}
- return FRAMETIME;
+ retorno FRAMETIME;
} // mode_2Dmatrix()
-static const char _data_FX_MODE_2DMATRIX[] PROGMEM = "Matrix@!,Spawning rate,Trail,,,Custom color;Spawn,Trail;;2";
+estático constante char _data_FX_MODE_2DMATRIX[] PROGMEM = "Matrix@!,Spawning rate,Trail,,,Personalizado color;Spawn,Trail;;2";
/////////////////////////
// 2D Metaballs //
/////////////////////////
uint16_t mode_2Dmetaballs(void) { // Metaballs by Stefan Petrick. Cannot have one of the dimensions be 2 or less. Adapted by Andrew Tuline.
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
- float speed = 0.25f * (1+(SEGMENT.speed>>6));
+ flotante velocidad = 0.25f * (1+(SEGMENTO.velocidad>>6));
// get some 2 random moving points
- int x2 = map(perlin8(strip.now * speed, 25355, 685), 0, 255, 0, cols-1);
- int y2 = map(perlin8(strip.now * speed, 355, 11685), 0, 255, 0, rows-1);
+ int x2 = map(perlin8(tira.now * velocidad, 25355, 685), 0, 255, 0, cols-1);
+ int y2 = map(perlin8(tira.now * velocidad, 355, 11685), 0, 255, 0, rows-1);
- int x3 = map(perlin8(strip.now * speed, 55355, 6685), 0, 255, 0, cols-1);
- int y3 = map(perlin8(strip.now * speed, 25355, 22685), 0, 255, 0, rows-1);
+ int x3 = map(perlin8(tira.now * velocidad, 55355, 6685), 0, 255, 0, cols-1);
+ int y3 = map(perlin8(tira.now * velocidad, 25355, 22685), 0, 255, 0, rows-1);
- // and one Lissajou function
- int x1 = beatsin8_t(23 * speed, 0, cols-1);
- int y1 = beatsin8_t(28 * speed, 0, rows-1);
+ // and one Lissajou función
+ int x1 = beatsin8_t(23 * velocidad, 0, cols-1);
+ int y1 = beatsin8_t(28 * velocidad, 0, rows-1);
for (int y = 0; y < rows; y++) {
for (int x = 0; x < cols; x++) {
- // calculate distances of the 3 points from actual pixel
+ // calculate distances of the 3 points from actual píxel
// and add them together with weightening
unsigned dx = abs(x - x1);
unsigned dy = abs(y - y1);
@@ -5649,61 +5649,61 @@ uint16_t mode_2Dmetaballs(void) { // Metaballs by Stefan Petrick. Cannot have
dy = abs(y - y3);
dist += sqrt32_bw((dx * dx) + (dy * dy));
- // inverse result
+ // inverse resultado
int color = dist ? 1000 / dist : 255;
// map color between thresholds
if (color > 0 and color < 60) {
- SEGMENT.setPixelColorXY(x, y, SEGMENT.color_from_palette(map(color * 9, 9, 531, 0, 255), false, PALETTE_SOLID_WRAP, 0));
+ SEGMENTO.setPixelColorXY(x, y, SEGMENTO.color_from_palette(map(color * 9, 9, 531, 0, 255), falso, PALETTE_SOLID_WRAP, 0));
} else {
- SEGMENT.setPixelColorXY(x, y, SEGMENT.color_from_palette(0, false, PALETTE_SOLID_WRAP, 0));
+ SEGMENTO.setPixelColorXY(x, y, SEGMENTO.color_from_palette(0, falso, PALETTE_SOLID_WRAP, 0));
}
// show the 3 points, too
- SEGMENT.setPixelColorXY(x1, y1, WHITE);
- SEGMENT.setPixelColorXY(x2, y2, WHITE);
- SEGMENT.setPixelColorXY(x3, y3, WHITE);
+ SEGMENTO.setPixelColorXY(x1, y1, WHITE);
+ SEGMENTO.setPixelColorXY(x2, y2, WHITE);
+ SEGMENTO.setPixelColorXY(x3, y3, WHITE);
}
}
- return FRAMETIME;
+ retorno FRAMETIME;
} // mode_2Dmetaballs()
-static const char _data_FX_MODE_2DMETABALLS[] PROGMEM = "Metaballs@!;;!;2";
+estático constante char _data_FX_MODE_2DMETABALLS[] PROGMEM = "Metaballs@!;;!;2";
//////////////////////
// 2D Noise //
//////////////////////
uint16_t mode_2Dnoise(void) { // By Andrew Tuline
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
- const unsigned scale = SEGMENT.intensity+2;
+ constante unsigned escala = SEGMENTO.intensidad+2;
for (int y = 0; y < rows; y++) {
for (int x = 0; x < cols; x++) {
- uint8_t pixelHue8 = perlin8(x * scale, y * scale, strip.now / (16 - SEGMENT.speed/16));
- SEGMENT.setPixelColorXY(x, y, ColorFromPalette(SEGPALETTE, pixelHue8));
+ uint8_t pixelHue8 = perlin8(x * escala, y * escala, tira.now / (16 - SEGMENTO.velocidad/16));
+ SEGMENTO.setPixelColorXY(x, y, ColorFromPalette(SEGPALETTE, pixelHue8));
}
}
- return FRAMETIME;
+ retorno FRAMETIME;
} // mode_2Dnoise()
-static const char _data_FX_MODE_2DNOISE[] PROGMEM = "Noise2D@!,Scale;;!;2";
+estático constante char _data_FX_MODE_2DNOISE[] PROGMEM = "Noise2D@!,Escala;;!;2";
//////////////////////////////
// 2D Plasma Ball //
//////////////////////////////
uint16_t mode_2DPlasmaball(void) { // By: Stepko https://editor.soulmatelights.com/gallery/659-plasm-ball , Modified by: Andrew Tuline
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
- SEGMENT.fadeToBlackBy(SEGMENT.custom1>>2);
- uint_fast32_t t = (strip.now * 8) / (256 - SEGMENT.speed); // optimized to avoid float
+ SEGMENTO.fadeToBlackBy(SEGMENTO.custom1>>2);
+ uint_fast32_t t = (tira.now * 8) / (256 - SEGMENTO.velocidad); // optimized to avoid flotante
for (int i = 0; i < cols; i++) {
unsigned thisVal = perlin8(i * 30, t, t);
unsigned thisMax = map(thisVal, 0, 255, 0, cols-1);
@@ -5715,7 +5715,7 @@ uint16_t mode_2DPlasmaball(void) { // By: Stepko https://edito
int cx = (i + thisMax_);
int cy = (j + thisMax);
- SEGMENT.addPixelColorXY(i, j, ((x - y > -2) && (x - y < 2)) ||
+ SEGMENTO.addPixelColorXY(i, j, ((x - y > -2) && (x - y < 2)) ||
((cols - 1 - x - y) > -2 && (cols - 1 - x - y < 2)) ||
(cols - cx == 0) ||
(cols - 1 - cx == 0) ||
@@ -5723,11 +5723,11 @@ uint16_t mode_2DPlasmaball(void) { // By: Stepko https://edito
(rows - 1 - cy == 0)) ? ColorFromPalette(SEGPALETTE, beat8(5), thisVal, LINEARBLEND) : CRGB::Black);
}
}
- SEGMENT.blur(SEGMENT.custom2>>5);
+ SEGMENTO.blur(SEGMENTO.custom2>>5);
- return FRAMETIME;
+ retorno FRAMETIME;
} // mode_2DPlasmaball()
-static const char _data_FX_MODE_2DPLASMABALL[] PROGMEM = "Plasma Ball@Speed,,Fade,Blur;;!;2";
+estático constante char _data_FX_MODE_2DPLASMABALL[] PROGMEM = "Plasma Ball@Velocidad,,Fade,Blur;;!;2";
////////////////////////////////
@@ -5735,85 +5735,85 @@ static const char _data_FX_MODE_2DPLASMABALL[] PROGMEM = "Plasma Ball@Speed,,Fad
////////////////////////////////
uint16_t mode_2DPolarLights(void) { // By: Kostyantyn Matviyevskyy https://editor.soulmatelights.com/gallery/762-polar-lights , Modified by: Andrew Tuline & @dedehai (palette support)
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
if (SEGENV.call == 0) {
- SEGMENT.fill(BLACK);
- SEGENV.step = 0;
+ SEGMENTO.fill(BLACK);
+ SEGENV.paso = 0;
}
- float adjustHeight = (float)map(rows, 8, 32, 28, 12); // maybe use mapf() ???
+ flotante adjustHeight = (flotante)map(rows, 8, 32, 28, 12); // maybe use mapf() ???
unsigned adjScale = map(cols, 8, 64, 310, 63);
- unsigned _scale = map(SEGMENT.intensity, 0, 255, 30, adjScale);
- int _speed = map(SEGMENT.speed, 0, 255, 128, 16);
+ unsigned _scale = map(SEGMENTO.intensidad, 0, 255, 30, adjScale);
+ int _speed = map(SEGMENTO.velocidad, 0, 255, 128, 16);
for (int x = 0; x < cols; x++) {
for (int y = 0; y < rows; y++) {
- SEGENV.step++;
- uint8_t palindex = qsub8(perlin8((SEGENV.step%2) + x * _scale, y * 16 + SEGENV.step % 16, SEGENV.step / _speed), fabsf((float)rows / 2.0f - (float)y) * adjustHeight);
+ SEGENV.paso++;
+ uint8_t palindex = qsub8(perlin8((SEGENV.paso%2) + x * _scale, y * 16 + SEGENV.paso % 16, SEGENV.paso / _speed), fabsf((flotante)rows / 2.0f - (flotante)y) * adjustHeight);
uint8_t palbrightness = palindex;
- if(SEGMENT.check1) palindex = 255 - palindex; //flip palette
- SEGMENT.setPixelColorXY(x, y, SEGMENT.color_from_palette(palindex, false, false, 255, palbrightness));
+ if(SEGMENTO.check1) palindex = 255 - palindex; //flip palette
+ SEGMENTO.setPixelColorXY(x, y, SEGMENTO.color_from_palette(palindex, falso, falso, 255, palbrightness));
}
}
- return FRAMETIME;
+ retorno FRAMETIME;
} // mode_2DPolarLights()
-static const char _data_FX_MODE_2DPOLARLIGHTS[] PROGMEM = "Polar Lights@!,Scale,,,,Flip Palette;;!;2;pal=71";
+estático constante char _data_FX_MODE_2DPOLARLIGHTS[] PROGMEM = "Polar Lights@!,Escala,,,,Flip Paleta;;!;2;pal=71";
/////////////////////////
// 2D Pulser //
/////////////////////////
uint16_t mode_2DPulser(void) { // By: ldirko https://editor.soulmatelights.com/gallery/878-pulse-test , modifed by: Andrew Tuline
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
- SEGMENT.fadeToBlackBy(8 - (SEGMENT.intensity>>5));
- uint32_t a = strip.now / (18 - SEGMENT.speed / 16);
+ SEGMENTO.fadeToBlackBy(8 - (SEGMENTO.intensidad>>5));
+ uint32_t a = tira.now / (18 - SEGMENTO.velocidad / 16);
int x = (a / 14) % cols;
int y = map((sin8_t(a * 5) + sin8_t(a * 4) + sin8_t(a * 2)), 0, 765, rows-1, 0);
- SEGMENT.setPixelColorXY(x, y, ColorFromPalette(SEGPALETTE, map(y, 0, rows-1, 0, 255), 255, LINEARBLEND));
+ SEGMENTO.setPixelColorXY(x, y, ColorFromPalette(SEGPALETTE, map(y, 0, rows-1, 0, 255), 255, LINEARBLEND));
- SEGMENT.blur(SEGMENT.intensity>>4);
+ SEGMENTO.blur(SEGMENTO.intensidad>>4);
- return FRAMETIME;
+ retorno FRAMETIME;
} // mode_2DPulser()
-static const char _data_FX_MODE_2DPULSER[] PROGMEM = "Pulser@!,Blur;;!;2";
+estático constante char _data_FX_MODE_2DPULSER[] PROGMEM = "Pulser@!,Blur;;!;2";
/////////////////////////
// 2D Sindots //
/////////////////////////
uint16_t mode_2DSindots(void) { // By: ldirko https://editor.soulmatelights.com/gallery/597-sin-dots , modified by: Andrew Tuline
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
if (SEGENV.call == 0) {
- SEGMENT.fill(BLACK);
+ SEGMENTO.fill(BLACK);
}
- SEGMENT.fadeToBlackBy((SEGMENT.custom1>>3) + (SEGMENT.check1 * 24));
+ SEGMENTO.fadeToBlackBy((SEGMENTO.custom1>>3) + (SEGMENTO.check1 * 24));
- byte t1 = strip.now / (257 - SEGMENT.speed); // 20;
+ byte t1 = tira.now / (257 - SEGMENTO.velocidad); // 20;
byte t2 = sin8_t(t1) / 4 * 2;
for (int i = 0; i < 13; i++) {
- int x = sin8_t(t1 + i * SEGMENT.intensity/8)*(cols-1)/255; // max index now 255x15/255=15!
- int y = sin8_t(t2 + i * SEGMENT.intensity/8)*(rows-1)/255; // max index now 255x15/255=15!
- SEGMENT.setPixelColorXY(x, y, ColorFromPalette(SEGPALETTE, i * 255 / 13, 255, LINEARBLEND));
+ int x = sin8_t(t1 + i * SEGMENTO.intensidad/8)*(cols-1)/255; // max índice now 255x15/255=15!
+ int y = sin8_t(t2 + i * SEGMENTO.intensidad/8)*(rows-1)/255; // max índice now 255x15/255=15!
+ SEGMENTO.setPixelColorXY(x, y, ColorFromPalette(SEGPALETTE, i * 255 / 13, 255, LINEARBLEND));
}
- SEGMENT.blur(SEGMENT.custom2 >> (3 + SEGMENT.check1), SEGMENT.check1);
+ SEGMENTO.blur(SEGMENTO.custom2 >> (3 + SEGMENTO.check1), SEGMENTO.check1);
- return FRAMETIME;
+ retorno FRAMETIME;
} // mode_2DSindots()
-static const char _data_FX_MODE_2DSINDOTS[] PROGMEM = "Sindots@!,Dot distance,Fade rate,Blur,,Smear;;!;2;";
+estático constante char _data_FX_MODE_2DSINDOTS[] PROGMEM = "Sindots@!,Dot distance,Fade rate,Blur,,Smear;;!;2;";
//////////////////////////////
@@ -5822,17 +5822,17 @@ static const char _data_FX_MODE_2DSINDOTS[] PROGMEM = "Sindots@!,Dot distance,Fa
// custom3 affects the blur amount.
uint16_t mode_2Dsquaredswirl(void) { // By: Mark Kriegsman. https://gist.github.com/kriegsman/368b316c55221134b160
// Modifed by: Andrew Tuline
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
- const uint8_t kBorderWidth = 2;
+ constante uint8_t kBorderWidth = 2;
- SEGMENT.fadeToBlackBy(1 + SEGMENT.intensity / 5);
- SEGMENT.blur(SEGMENT.custom3>>1);
+ SEGMENTO.fadeToBlackBy(1 + SEGMENTO.intensidad / 5);
+ SEGMENTO.blur(SEGMENTO.custom3>>1);
- // Use two out-of-sync sine waves
+ // Use two out-of-sincronizar sine waves
int i = beatsin8_t(19, kBorderWidth, cols-kBorderWidth);
int j = beatsin8_t(22, kBorderWidth, cols-kBorderWidth);
int k = beatsin8_t(17, kBorderWidth, cols-kBorderWidth);
@@ -5840,39 +5840,39 @@ uint16_t mode_2Dsquaredswirl(void) { // By: Mark Kriegsman. https://g
int n = beatsin8_t(15, kBorderWidth, rows-kBorderWidth);
int p = beatsin8_t(20, kBorderWidth, rows-kBorderWidth);
- SEGMENT.addPixelColorXY(i, m, ColorFromPalette(SEGPALETTE, strip.now/29, 255, LINEARBLEND));
- SEGMENT.addPixelColorXY(j, n, ColorFromPalette(SEGPALETTE, strip.now/41, 255, LINEARBLEND));
- SEGMENT.addPixelColorXY(k, p, ColorFromPalette(SEGPALETTE, strip.now/73, 255, LINEARBLEND));
+ SEGMENTO.addPixelColorXY(i, m, ColorFromPalette(SEGPALETTE, tira.now/29, 255, LINEARBLEND));
+ SEGMENTO.addPixelColorXY(j, n, ColorFromPalette(SEGPALETTE, tira.now/41, 255, LINEARBLEND));
+ SEGMENTO.addPixelColorXY(k, p, ColorFromPalette(SEGPALETTE, tira.now/73, 255, LINEARBLEND));
- return FRAMETIME;
+ retorno FRAMETIME;
} // mode_2Dsquaredswirl()
-static const char _data_FX_MODE_2DSQUAREDSWIRL[] PROGMEM = "Squared Swirl@,Fade,,,Blur;;!;2";
+estático constante char _data_FX_MODE_2DSQUAREDSWIRL[] PROGMEM = "Squared Swirl@,Fade,,,Blur;;!;2";
//////////////////////////////
// 2D Sun Radiation //
//////////////////////////////
uint16_t mode_2DSunradiation(void) { // By: ldirko https://editor.soulmatelights.com/gallery/599-sun-radiation , modified by: Andrew Tuline
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
- if (!SEGENV.allocateData(sizeof(byte)*(cols+2)*(rows+2))) return mode_static(); //allocation failed
- byte *bump = reinterpret_cast(SEGENV.data);
+ if (!SEGENV.allocateData(sizeof(byte)*(cols+2)*(rows+2))) retorno mode_static(); //allocation failed
+ byte *bump = reinterpret_cast(SEGENV.datos);
if (SEGENV.call == 0) {
- SEGMENT.fill(BLACK);
+ SEGMENTO.fill(BLACK);
}
- unsigned long t = strip.now / 4;
- unsigned index = 0;
- uint8_t someVal = SEGMENT.speed/4; // Was 25.
+ unsigned long t = tira.now / 4;
+ unsigned índice = 0;
+ uint8_t someVal = SEGMENTO.velocidad/4; // Was 25.
for (int j = 0; j < (rows + 2); j++) {
for (int i = 0; i < (cols + 2); i++) {
//byte col = (inoise8_raw(i * someVal, j * someVal, t)) / 2;
byte col = ((int16_t)perlin8(i * someVal, j * someVal, t) - 0x7F) / 3;
- bump[index++] = col;
+ bump[índice++] = col;
}
}
@@ -5888,112 +5888,112 @@ uint16_t mode_2DSunradiation(void) { // By: ldirko https://edi
unsigned difx = abs8(vlx * 7 - nx);
unsigned dify = abs8(vly * 7 - ny);
int temp = difx * difx + dify * dify;
- int col = 255 - temp / 8; //8 its a size of effect
+ int col = 255 - temp / 8; //8 its a tamaño of efecto
if (col < 0) col = 0;
- SEGMENT.setPixelColorXY(x, y, HeatColor(col / (3.0f-(float)(SEGMENT.intensity)/128.f)));
+ SEGMENTO.setPixelColorXY(x, y, HeatColor(col / (3.0f-(flotante)(SEGMENTO.intensidad)/128.f)));
}
yindex += (cols + 2);
}
- return FRAMETIME;
+ retorno FRAMETIME;
} // mode_2DSunradiation()
-static const char _data_FX_MODE_2DSUNRADIATION[] PROGMEM = "Sun Radiation@Variance,Brightness;;;2";
+estático constante char _data_FX_MODE_2DSUNRADIATION[] PROGMEM = "Sun Radiation@Varianza,Brillo;;;2";
/////////////////////////
// 2D Tartan //
/////////////////////////
uint16_t mode_2Dtartan(void) { // By: Elliott Kember https://editor.soulmatelights.com/gallery/3-tartan , Modified by: Andrew Tuline
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
if (SEGENV.call == 0) {
- SEGMENT.fill(BLACK);
+ SEGMENTO.fill(BLACK);
}
uint8_t hue, bri;
- size_t intensity;
+ size_t intensidad;
int offsetX = beatsin16_t(3, -360, 360);
int offsetY = beatsin16_t(2, -360, 360);
- int sharpness = SEGMENT.custom3 / 8; // 0-3
+ int sharpness = SEGMENTO.custom3 / 8; // 0-3
for (int x = 0; x < cols; x++) {
for (int y = 0; y < rows; y++) {
hue = x * beatsin16_t(10, 1, 10) + offsetY;
- intensity = bri = sin8_t(x * SEGMENT.speed/2 + offsetX);
- for (int i=0; i>= 8*sharpness;
- SEGMENT.setPixelColorXY(x, y, ColorFromPalette(SEGPALETTE, hue, intensity, LINEARBLEND));
+ intensidad = bri = sin8_t(x * SEGMENTO.velocidad/2 + offsetX);
+ for (int i=0; i>= 8*sharpness;
+ SEGMENTO.setPixelColorXY(x, y, ColorFromPalette(SEGPALETTE, hue, intensidad, LINEARBLEND));
hue = y * 3 + offsetX;
- intensity = bri = sin8_t(y * SEGMENT.intensity/2 + offsetY);
- for (int i=0; i>= 8*sharpness;
- SEGMENT.addPixelColorXY(x, y, ColorFromPalette(SEGPALETTE, hue, intensity, LINEARBLEND));
+ intensidad = bri = sin8_t(y * SEGMENTO.intensidad/2 + offsetY);
+ for (int i=0; i>= 8*sharpness;
+ SEGMENTO.addPixelColorXY(x, y, ColorFromPalette(SEGPALETTE, hue, intensidad, LINEARBLEND));
}
}
- return FRAMETIME;
+ retorno FRAMETIME;
} // mode_2DTartan()
-static const char _data_FX_MODE_2DTARTAN[] PROGMEM = "Tartan@X scale,Y scale,,,Sharpness;;!;2";
+estático constante char _data_FX_MODE_2DTARTAN[] PROGMEM = "Tartan@X escala,Y escala,,,Sharpness;;!;2";
/////////////////////////
// 2D spaceships //
/////////////////////////
uint16_t mode_2Dspaceships(void) { //// Space ships by stepko (c)05.02.21 [https://editor.soulmatelights.com/gallery/639-space-ships], adapted by Blaz Kristan (AKA blazoncek)
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
- uint32_t tb = strip.now >> 12; // every ~4s
- if (tb > SEGENV.step) {
+ uint32_t tb = tira.now >> 12; // every ~4s
+ if (tb > SEGENV.paso) {
int dir = ++SEGENV.aux0;
dir += (int)hw_random8(3)-1;
if (dir > 7) SEGENV.aux0 = 0;
else if (dir < 0) SEGENV.aux0 = 7;
else SEGENV.aux0 = dir;
- SEGENV.step = tb + hw_random8(4);
+ SEGENV.paso = tb + hw_random8(4);
}
- SEGMENT.fadeToBlackBy(map(SEGMENT.speed, 0, 255, 248, 16));
- SEGMENT.move(SEGENV.aux0, 1);
+ SEGMENTO.fadeToBlackBy(map(SEGMENTO.velocidad, 0, 255, 248, 16));
+ SEGMENTO.move(SEGENV.aux0, 1);
for (size_t i = 0; i < 8; i++) {
int x = beatsin8_t(12 + i, 2, cols - 3);
int y = beatsin8_t(15 + i, 2, rows - 3);
uint32_t color = ColorFromPalette(SEGPALETTE, beatsin8_t(12 + i, 0, 255), 255);
- SEGMENT.addPixelColorXY(x, y, color);
+ SEGMENTO.addPixelColorXY(x, y, color);
if (cols > 24 || rows > 24) {
- SEGMENT.addPixelColorXY(x+1, y, color);
- SEGMENT.addPixelColorXY(x-1, y, color);
- SEGMENT.addPixelColorXY(x, y+1, color);
- SEGMENT.addPixelColorXY(x, y-1, color);
+ SEGMENTO.addPixelColorXY(x+1, y, color);
+ SEGMENTO.addPixelColorXY(x-1, y, color);
+ SEGMENTO.addPixelColorXY(x, y+1, color);
+ SEGMENTO.addPixelColorXY(x, y-1, color);
}
}
- SEGMENT.blur(SEGMENT.intensity >> 3, SEGMENT.check1);
+ SEGMENTO.blur(SEGMENTO.intensidad >> 3, SEGMENTO.check1);
- return FRAMETIME;
+ retorno FRAMETIME;
}
-static const char _data_FX_MODE_2DSPACESHIPS[] PROGMEM = "Spaceships@!,Blur,,,,Smear;;!;2";
+estático constante char _data_FX_MODE_2DSPACESHIPS[] PROGMEM = "Spaceships@!,Blur,,,,Smear;;!;2";
/////////////////////////
// 2D Crazy Bees //
/////////////////////////
//// Crazy bees by stepko (c)12.02.21 [https://editor.soulmatelights.com/gallery/651-crazy-bees], adapted by Blaz Kristan (AKA blazoncek), improved by @dedehai
-#define MAX_BEES 5
+#definir MAX_BEES 5
uint16_t mode_2Dcrazybees(void) {
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
byte n = MIN(MAX_BEES, (rows * cols) / 256 + 1);
- typedef struct Bee {
+ definición de tipo estructura Bee {
uint8_t posX, posY, aimX, aimY, hue;
int8_t deltaX, deltaY, signX, signY, error;
void aimed(uint16_t w, uint16_t h) {
@@ -6009,11 +6009,11 @@ uint16_t mode_2Dcrazybees(void) {
};
} bee_t;
- if (!SEGENV.allocateData(sizeof(bee_t)*MAX_BEES)) return mode_static(); //allocation failed
- bee_t *bee = reinterpret_cast(SEGENV.data);
+ if (!SEGENV.allocateData(sizeof(bee_t)*MAX_BEES)) retorno mode_static(); //allocation failed
+ bee_t *bee = reinterpret_cast(SEGENV.datos);
if (SEGENV.call == 0) {
- random16_set_seed(strip.now);
+ random16_set_seed(tira.now);
for (size_t i = 0; i < n; i++) {
bee[i].posX = random8(0, cols);
bee[i].posY = random8(0, rows);
@@ -6021,18 +6021,18 @@ uint16_t mode_2Dcrazybees(void) {
}
}
- if (strip.now > SEGENV.step) {
- SEGENV.step = strip.now + (FRAMETIME * 16 / ((SEGMENT.speed>>4)+1));
- SEGMENT.fadeToBlackBy(32 + ((SEGMENT.check1*SEGMENT.intensity) / 25));
- SEGMENT.blur(SEGMENT.intensity / (2 + SEGMENT.check1 * 9), SEGMENT.check1);
+ if (tira.now > SEGENV.paso) {
+ SEGENV.paso = tira.now + (FRAMETIME * 16 / ((SEGMENTO.velocidad>>4)+1));
+ SEGMENTO.fadeToBlackBy(32 + ((SEGMENTO.check1*SEGMENTO.intensidad) / 25));
+ SEGMENTO.blur(SEGMENTO.intensidad / (2 + SEGMENTO.check1 * 9), SEGMENTO.check1);
for (size_t i = 0; i < n; i++) {
- uint32_t flowerCcolor = SEGMENT.color_from_palette(bee[i].hue, false, true, 255);
- SEGMENT.addPixelColorXY(bee[i].aimX + 1, bee[i].aimY, flowerCcolor);
- SEGMENT.addPixelColorXY(bee[i].aimX, bee[i].aimY + 1, flowerCcolor);
- SEGMENT.addPixelColorXY(bee[i].aimX - 1, bee[i].aimY, flowerCcolor);
- SEGMENT.addPixelColorXY(bee[i].aimX, bee[i].aimY - 1, flowerCcolor);
+ uint32_t flowerCcolor = SEGMENTO.color_from_palette(bee[i].hue, falso, verdadero, 255);
+ SEGMENTO.addPixelColorXY(bee[i].aimX + 1, bee[i].aimY, flowerCcolor);
+ SEGMENTO.addPixelColorXY(bee[i].aimX, bee[i].aimY + 1, flowerCcolor);
+ SEGMENTO.addPixelColorXY(bee[i].aimX - 1, bee[i].aimY, flowerCcolor);
+ SEGMENTO.addPixelColorXY(bee[i].aimX, bee[i].aimY - 1, flowerCcolor);
if (bee[i].posX != bee[i].aimX || bee[i].posY != bee[i].aimY) {
- SEGMENT.setPixelColorXY(bee[i].posX, bee[i].posY, CRGB(CHSV(bee[i].hue, 60, 255)));
+ SEGMENTO.setPixelColorXY(bee[i].posX, bee[i].posY, CRGB(CHSV(bee[i].hue, 60, 255)));
int error2 = bee[i].error * 2;
if (error2 > -bee[i].deltaY) {
bee[i].error -= bee[i].deltaY;
@@ -6047,24 +6047,24 @@ uint16_t mode_2Dcrazybees(void) {
}
}
}
- return FRAMETIME;
+ retorno FRAMETIME;
}
-static const char _data_FX_MODE_2DCRAZYBEES[] PROGMEM = "Crazy Bees@!,Blur,,,,Smear;;!;2;pal=11,ix=0";
+estático constante char _data_FX_MODE_2DCRAZYBEES[] PROGMEM = "Crazy Bees@!,Blur,,,,Smear;;!;2;pal=11,ix=0";
#undef MAX_BEES
-#ifdef WLED_PS_DONT_REPLACE_2D_FX
+#si está definido WLED_PS_DONT_REPLACE_2D_FX
/////////////////////////
// 2D Ghost Rider //
/////////////////////////
//// Ghost Rider by stepko (c)2021 [https://editor.soulmatelights.com/gallery/716-ghost-rider], adapted by Blaz Kristan (AKA blazoncek)
-#define LIGHTERS_AM 64 // max lighters (adequate for 32x32 matrix)
+#definir LIGHTERS_AM 64 // max lighters (adequate for 32x32 matrix)
uint16_t mode_2Dghostrider(void) {
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
- typedef struct Lighter {
+ definición de tipo estructura Lighter {
int16_t gPosX;
int16_t gPosY;
uint16_t gAngle;
@@ -6077,10 +6077,10 @@ uint16_t mode_2Dghostrider(void) {
int8_t Vspeed;
} lighter_t;
- if (!SEGENV.allocateData(sizeof(lighter_t))) return mode_static(); //allocation failed
- lighter_t *lighter = reinterpret_cast(SEGENV.data);
+ if (!SEGENV.allocateData(sizeof(lighter_t))) retorno mode_static(); //allocation failed
+ lighter_t *lighter = reinterpret_cast(SEGENV.datos);
- const size_t maxLighters = min(cols + rows, LIGHTERS_AM);
+ constante size_t maxLighters = min(cols + rows, LIGHTERS_AM);
if (SEGENV.aux0 != cols || SEGENV.aux1 != rows) {
SEGENV.aux0 = cols;
@@ -6094,17 +6094,17 @@ uint16_t mode_2Dghostrider(void) {
lighter->lightersPosX[i] = lighter->gPosX;
lighter->lightersPosY[i] = lighter->gPosY + i;
lighter->time[i] = i * 2;
- lighter->reg[i] = false;
+ lighter->reg[i] = falso;
}
}
- if (strip.now > SEGENV.step) {
- SEGENV.step = strip.now + 1024 / (cols+rows);
+ if (tira.now > SEGENV.paso) {
+ SEGENV.paso = tira.now + 1024 / (cols+rows);
- SEGMENT.fadeToBlackBy((SEGMENT.speed>>2)+64);
+ SEGMENTO.fadeToBlackBy((SEGMENTO.velocidad>>2)+64);
CRGB color = CRGB::White;
- SEGMENT.wu_pixel(lighter->gPosX * 256 / 10, lighter->gPosY * 256 / 10, color);
+ SEGMENTO.wu_pixel(lighter->gPosX * 256 / 10, lighter->gPosY * 256 / 10, color);
lighter->gPosX += lighter->Vspeed * sin_t(radians(lighter->gAngle));
lighter->gPosY += lighter->Vspeed * cos_t(radians(lighter->gAngle));
@@ -6120,60 +6120,60 @@ uint16_t mode_2Dghostrider(void) {
(lighter->lightersPosX[i] >= (cols - 1) * 10) ||
(lighter->lightersPosY[i] <= 0) ||
(lighter->lightersPosY[i] >= (rows - 1) * 10)) {
- lighter->reg[i] = true;
+ lighter->reg[i] = verdadero;
}
if (lighter->reg[i]) {
lighter->lightersPosY[i] = lighter->gPosY;
lighter->lightersPosX[i] = lighter->gPosX;
lighter->Angle[i] = lighter->gAngle + ((int)hw_random8(20) - 10);
lighter->time[i] = 0;
- lighter->reg[i] = false;
+ lighter->reg[i] = falso;
} else {
lighter->lightersPosX[i] += -7 * sin_t(radians(lighter->Angle[i]));
lighter->lightersPosY[i] += -7 * cos_t(radians(lighter->Angle[i]));
}
- SEGMENT.wu_pixel(lighter->lightersPosX[i] * 256 / 10, lighter->lightersPosY[i] * 256 / 10, ColorFromPalette(SEGPALETTE, (256 - lighter->time[i])));
+ SEGMENTO.wu_pixel(lighter->lightersPosX[i] * 256 / 10, lighter->lightersPosY[i] * 256 / 10, ColorFromPalette(SEGPALETTE, (256 - lighter->time[i])));
}
- SEGMENT.blur(SEGMENT.intensity>>3);
+ SEGMENTO.blur(SEGMENTO.intensidad>>3);
}
- return FRAMETIME;
+ retorno FRAMETIME;
}
-static const char _data_FX_MODE_2DGHOSTRIDER[] PROGMEM = "Ghost Rider@Fade rate,Blur;;!;2";
+estático constante char _data_FX_MODE_2DGHOSTRIDER[] PROGMEM = "Ghost Rider@Fade rate,Blur;;!;2";
#undef LIGHTERS_AM
////////////////////////////
// 2D Floating Blobs //
////////////////////////////
//// Floating Blobs by stepko (c)2021 [https://editor.soulmatelights.com/gallery/573-blobs], adapted by Blaz Kristan (AKA blazoncek)
-#define MAX_BLOBS 8
+#definir MAX_BLOBS 8
uint16_t mode_2Dfloatingblobs(void) {
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
- typedef struct Blob {
- float x[MAX_BLOBS], y[MAX_BLOBS];
- float sX[MAX_BLOBS], sY[MAX_BLOBS]; // speed
- float r[MAX_BLOBS];
+ definición de tipo estructura Blob {
+ flotante x[MAX_BLOBS], y[MAX_BLOBS];
+ flotante sX[MAX_BLOBS], sY[MAX_BLOBS]; // velocidad
+ flotante r[MAX_BLOBS];
bool grow[MAX_BLOBS];
byte color[MAX_BLOBS];
} blob_t;
- size_t Amount = (SEGMENT.intensity>>5) + 1; // NOTE: be sure to update MAX_BLOBS if you change this
+ size_t Amount = (SEGMENTO.intensidad>>5) + 1; // NOTE: be sure to actualizar MAX_BLOBS if you change this
- if (!SEGENV.allocateData(sizeof(blob_t))) return mode_static(); //allocation failed
- blob_t *blob = reinterpret_cast(SEGENV.data);
+ if (!SEGENV.allocateData(sizeof(blob_t))) retorno mode_static(); //allocation failed
+ blob_t *blob = reinterpret_cast(SEGENV.datos);
if (SEGENV.aux0 != cols || SEGENV.aux1 != rows) {
- SEGENV.aux0 = cols; // re-initialise if virtual size changes
+ SEGENV.aux0 = cols; // re-initialise if virtual tamaño changes
SEGENV.aux1 = rows;
- //SEGMENT.fill(BLACK);
+ //SEGMENTO.fill(BLACK);
for (size_t i = 0; i < MAX_BLOBS; i++) {
blob->r[i] = hw_random8(1, cols>8 ? (cols/4) : 2);
- blob->sX[i] = (float) hw_random8(3, cols) / (float)(256 - SEGMENT.speed); // speed x
- blob->sY[i] = (float) hw_random8(3, rows) / (float)(256 - SEGMENT.speed); // speed y
+ blob->sX[i] = (flotante) hw_random8(3, cols) / (flotante)(256 - SEGMENTO.velocidad); // velocidad x
+ blob->sY[i] = (flotante) hw_random8(3, rows) / (flotante)(256 - SEGMENTO.velocidad); // velocidad y
blob->x[i] = hw_random8(0, cols-1);
blob->y[i] = hw_random8(0, rows-1);
blob->color[i] = hw_random8();
@@ -6183,28 +6183,28 @@ uint16_t mode_2Dfloatingblobs(void) {
}
}
- SEGMENT.fadeToBlackBy((SEGMENT.custom2>>3)+1);
+ SEGMENTO.fadeToBlackBy((SEGMENTO.custom2>>3)+1);
// Bounce balls around
for (size_t i = 0; i < Amount; i++) {
- if (SEGENV.step < strip.now) blob->color[i] = add8(blob->color[i], 4); // slowly change color
+ if (SEGENV.paso < tira.now) blob->color[i] = add8(blob->color[i], 4); // slowly change color
// change radius if needed
if (blob->grow[i]) {
// enlarge radius until it is >= 4
blob->r[i] += (fabsf(blob->sX[i]) > fabsf(blob->sY[i]) ? fabsf(blob->sX[i]) : fabsf(blob->sY[i])) * 0.05f;
if (blob->r[i] >= MIN(cols/4.f,2.f)) {
- blob->grow[i] = false;
+ blob->grow[i] = falso;
}
} else {
// reduce radius until it is < 1
blob->r[i] -= (fabsf(blob->sX[i]) > fabsf(blob->sY[i]) ? fabsf(blob->sX[i]) : fabsf(blob->sY[i])) * 0.05f;
if (blob->r[i] < 1.f) {
- blob->grow[i] = true;
+ blob->grow[i] = verdadero;
}
}
- uint32_t c = SEGMENT.color_from_palette(blob->color[i], false, false, 0);
- if (blob->r[i] > 1.f) SEGMENT.fillCircle(roundf(blob->x[i]), roundf(blob->y[i]), roundf(blob->r[i]), c);
- else SEGMENT.setPixelColorXY((int)roundf(blob->x[i]), (int)roundf(blob->y[i]), c);
+ uint32_t c = SEGMENTO.color_from_palette(blob->color[i], falso, falso, 0);
+ if (blob->r[i] > 1.f) SEGMENTO.fillCircle(roundf(blob->x[i]), roundf(blob->y[i]), roundf(blob->r[i]), c);
+ else SEGMENTO.setPixelColorXY((int)roundf(blob->x[i]), (int)roundf(blob->y[i]), c);
// move x
if (blob->x[i] + blob->r[i] >= cols - 1) blob->x[i] += (blob->sX[i] * ((cols - 1 - blob->x[i]) / blob->r[i] + 0.005f));
else if (blob->x[i] - blob->r[i] <= 0) blob->x[i] += (blob->sX[i] * (blob->x[i] / blob->r[i] + 0.005f));
@@ -6215,54 +6215,54 @@ uint16_t mode_2Dfloatingblobs(void) {
else blob->y[i] += blob->sY[i];
// bounce x
if (blob->x[i] < 0.01f) {
- blob->sX[i] = (float)hw_random8(3, cols) / (256 - SEGMENT.speed);
+ blob->sX[i] = (flotante)hw_random8(3, cols) / (256 - SEGMENTO.velocidad);
blob->x[i] = 0.01f;
- } else if (blob->x[i] > (float)cols - 1.01f) {
- blob->sX[i] = (float)hw_random8(3, cols) / (256 - SEGMENT.speed);
+ } else if (blob->x[i] > (flotante)cols - 1.01f) {
+ blob->sX[i] = (flotante)hw_random8(3, cols) / (256 - SEGMENTO.velocidad);
blob->sX[i] = -blob->sX[i];
- blob->x[i] = (float)cols - 1.01f;
+ blob->x[i] = (flotante)cols - 1.01f;
}
// bounce y
if (blob->y[i] < 0.01f) {
- blob->sY[i] = (float)hw_random8(3, rows) / (256 - SEGMENT.speed);
+ blob->sY[i] = (flotante)hw_random8(3, rows) / (256 - SEGMENTO.velocidad);
blob->y[i] = 0.01f;
- } else if (blob->y[i] > (float)rows - 1.01f) {
- blob->sY[i] = (float)hw_random8(3, rows) / (256 - SEGMENT.speed);
+ } else if (blob->y[i] > (flotante)rows - 1.01f) {
+ blob->sY[i] = (flotante)hw_random8(3, rows) / (256 - SEGMENTO.velocidad);
blob->sY[i] = -blob->sY[i];
- blob->y[i] = (float)rows - 1.01f;
+ blob->y[i] = (flotante)rows - 1.01f;
}
}
- SEGMENT.blur(SEGMENT.custom1>>2);
+ SEGMENTO.blur(SEGMENTO.custom1>>2);
- if (SEGENV.step < strip.now) SEGENV.step = strip.now + 2000; // change colors every 2 seconds
+ if (SEGENV.paso < tira.now) SEGENV.paso = tira.now + 2000; // change colors every 2 seconds
- return FRAMETIME;
+ retorno FRAMETIME;
}
-static const char _data_FX_MODE_2DBLOBS[] PROGMEM = "Blobs@!,# blobs,Blur,Trail;!;!;2;c1=8";
+estático constante char _data_FX_MODE_2DBLOBS[] PROGMEM = "Blobs@!,# blobs,Blur,Trail;!;!;2;c1=8";
#undef MAX_BLOBS
-#endif // WLED_PS_DONT_REPLACE_2D_FX
+#fin si // WLED_PS_DONT_REPLACE_2D_FX
////////////////////////////
-// 2D Scrolling text //
+// 2D Scrolling texto //
////////////////////////////
uint16_t mode_2Dscrollingtext(void) {
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
unsigned letterWidth, rotLW;
unsigned letterHeight, rotLH;
- switch (map(SEGMENT.custom2, 0, 255, 1, 5)) {
+ conmutador (map(SEGMENTO.custom2, 0, 255, 1, 5)) {
default:
- case 1: letterWidth = 4; letterHeight = 6; break;
- case 2: letterWidth = 5; letterHeight = 8; break;
- case 3: letterWidth = 6; letterHeight = 8; break;
- case 4: letterWidth = 7; letterHeight = 9; break;
- case 5: letterWidth = 5; letterHeight = 12; break;
+ case 1: letterWidth = 4; letterHeight = 6; ruptura;
+ case 2: letterWidth = 5; letterHeight = 8; ruptura;
+ case 3: letterWidth = 6; letterHeight = 8; ruptura;
+ case 4: letterWidth = 7; letterHeight = 9; ruptura;
+ case 5: letterWidth = 5; letterHeight = 12; ruptura;
}
// letters are rotated
- const int8_t rotate = map(SEGMENT.custom3, 0, 31, -2, 2);
+ constante int8_t rotate = map(SEGMENTO.custom3, 0, 31, -2, 2);
if (rotate == 1 || rotate == -1) {
rotLH = letterWidth;
rotLW = letterHeight;
@@ -6271,13 +6271,13 @@ uint16_t mode_2Dscrollingtext(void) {
rotLH = letterHeight;
}
- char text[WLED_MAX_SEGNAME_LEN+1] = {'\0'};
+ char texto[WLED_MAX_SEGNAME_LEN+1] = {'\0'};
size_t result_pos = 0;
char sec[5];
int AmPmHour = hour(localTime);
- bool isitAM = true;
+ bool isitAM = verdadero;
if (useAMPM) {
- if (AmPmHour > 11) { AmPmHour -= 12; isitAM = false; }
+ if (AmPmHour > 11) { AmPmHour -= 12; isitAM = falso; }
if (AmPmHour == 0) { AmPmHour = 12; }
sprintf_P(sec, PSTR(" %2s"), (isitAM ? "AM" : "PM"));
} else {
@@ -6285,26 +6285,26 @@ uint16_t mode_2Dscrollingtext(void) {
}
size_t len = 0;
- if (SEGMENT.name) len = strlen(SEGMENT.name); // note: SEGMENT.name is limited to WLED_MAX_SEGNAME_LEN
- if (len == 0) { // fallback if empty segment name: display date and time
- sprintf_P(text, PSTR("%s %d, %d %d:%02d%s"), monthShortStr(month(localTime)), day(localTime), year(localTime), AmPmHour, minute(localTime), sec);
+ if (SEGMENTO.name) len = strlen(SEGMENTO.name); // note: SEGMENTO.name is limited to WLED_MAX_SEGNAME_LEN
+ if (len == 0) { // fallback if empty segmento name: display date and time
+ sprintf_P(texto, PSTR("%s %d, %d %d:%02d%s"), monthShortStr(month(localTime)), day(localTime), year(localTime), AmPmHour, minute(localTime), sec);
} else {
size_t i = 0;
while (i < len) {
- if (SEGMENT.name[i] == '#') {
- char token[7]; // copy up to 6 chars + null terminator
- bool zero = false; // a 0 suffix means display leading zeros
+ if (SEGMENTO.name[i] == '#') {
+ char token[7]; // copy up to 6 chars + nulo terminator
+ bool zero = falso; // a 0 suffix means display leading zeros
size_t j = 0;
while (j < 6 && i + j < len) {
- token[j] = std::toupper(SEGMENT.name[i + j]);
+ token[j] = std::toupper(SEGMENTO.name[i + j]);
if(token[j] == '0')
- zero = true; // 0 suffix found. Note: there is an edge case where a '0' could be part of a trailing text and not the token, handling it is not worth the effort
+ zero = verdadero; // 0 suffix found. Note: there is an edge case where a '0' could be part of a trailing texto and not the token, handling it is not worth the effort
j++;
}
token[j] = '\0';
- int advance = 5; // number of chars to advance in 'text' after processing the token
+ int advance = 5; // number of chars to advance in 'texto' after processing the token
- // Process token
+ // Proceso token
char temp[32];
if (!strncmp_P(token,PSTR("#DATE"),5)) sprintf_P(temp, zero?PSTR("%02d.%02d.%04d"):PSTR("%d.%d.%d"), day(localTime), month(localTime), year(localTime));
else if (!strncmp_P(token,PSTR("#DDMM"),5)) sprintf_P(temp, zero?PSTR("%02d.%02d") :PSTR("%d.%d"), day(localTime), month(localTime));
@@ -6322,12 +6322,12 @@ uint16_t mode_2Dscrollingtext(void) {
else if (!strncmp_P(token,PSTR("#MO"),3)) { sprintf (temp, zero? ("%02d") : ("%d"), month(localTime)); advance = 3; }
else if (!strncmp_P(token,PSTR("#DAY"),4)) { sprintf (temp, ("%s") , dayShortStr(weekday(localTime))); advance = 4; }
else if (!strncmp_P(token,PSTR("#DD"),3)) { sprintf (temp, zero? ("%02d") : ("%d"), day(localTime)); advance = 3; }
- else { temp[0] = '#'; temp[1] = '\0'; zero = false; advance = 1; } // Unknown token, just copy the #
+ else { temp[0] = '#'; temp[1] = '\0'; zero = falso; advance = 1; } // Unknown token, just copy the #
- if(zero) advance++; // skip the '0' suffix
+ if(zero) advance++; // omitir the '0' suffix
size_t temp_len = strlen(temp);
if (result_pos + temp_len < WLED_MAX_SEGNAME_LEN) {
- strcpy(text + result_pos, temp);
+ strcpy(texto + result_pos, temp);
result_pos += temp_len;
}
@@ -6335,47 +6335,47 @@ uint16_t mode_2Dscrollingtext(void) {
}
else {
if (result_pos < WLED_MAX_SEGNAME_LEN) {
- text[result_pos++] = SEGMENT.name[i++]; // no token, just copy char
+ texto[result_pos++] = SEGMENTO.name[i++]; // no token, just copy char
} else
- break; // buffer full
+ ruptura; // búfer full
}
}
}
- const int numberOfLetters = strlen(text);
+ constante int numberOfLetters = strlen(texto);
int width = (numberOfLetters * rotLW);
- int yoffset = map(SEGMENT.intensity, 0, 255, -rows/2, rows/2) + (rows-rotLH)/2;
+ int yoffset = map(SEGMENTO.intensidad, 0, 255, -rows/2, rows/2) + (rows-rotLH)/2;
if (width <= cols) {
// scroll vertically (e.g. ^^ Way out ^^) if it fits
- int speed = map(SEGMENT.speed, 0, 255, 5000, 1000);
- int frac = strip.now % speed + 1;
- if (SEGMENT.intensity == 255) {
- yoffset = (2 * frac * rows)/speed - rows;
- } else if (SEGMENT.intensity == 0) {
- yoffset = rows - (2 * frac * rows)/speed;
+ int velocidad = map(SEGMENTO.velocidad, 0, 255, 5000, 1000);
+ int frac = tira.now % velocidad + 1;
+ if (SEGMENTO.intensidad == 255) {
+ yoffset = (2 * frac * rows)/velocidad - rows;
+ } else if (SEGMENTO.intensidad == 0) {
+ yoffset = rows - (2 * frac * rows)/velocidad;
}
}
- if (SEGENV.step < strip.now) {
- // calculate start offset
+ if (SEGENV.paso < tira.now) {
+ // calculate iniciar desplazamiento
if (width > cols) {
- if (SEGMENT.check3) {
+ if (SEGMENTO.check3) {
if (SEGENV.aux0 == 0) SEGENV.aux0 = width + cols - 1;
else --SEGENV.aux0;
} else ++SEGENV.aux0 %= width + cols;
} else SEGENV.aux0 = (cols + width)/2;
++SEGENV.aux1 &= 0xFF; // color shift
- SEGENV.step = strip.now + map(SEGMENT.speed, 0, 255, 250, 50); // shift letters every ~250ms to ~50ms
+ SEGENV.paso = tira.now + map(SEGMENTO.velocidad, 0, 255, 250, 50); // shift letters every ~250ms to ~50ms
}
- SEGMENT.fade_out(255 - (SEGMENT.custom1>>4)); // trail
- uint32_t col1 = SEGMENT.color_from_palette(SEGENV.aux1, false, PALETTE_SOLID_WRAP, 0);
+ SEGMENTO.fade_out(255 - (SEGMENTO.custom1>>4)); // trail
+ uint32_t col1 = SEGMENTO.color_from_palette(SEGENV.aux1, falso, PALETTE_SOLID_WRAP, 0);
uint32_t col2 = BLACK;
// if gradient is selected and palette is default (0) drawCharacter() uses gradient from SEGCOLOR(0) to SEGCOLOR(2)
// otherwise col2 == BLACK means use currently selected palette for gradient
// if gradient is not selected set both colors the same
- if (SEGMENT.check1) { // use gradient
- if (SEGMENT.palette == 0) { // use colors for gradient
+ if (SEGMENTO.check1) { // use gradient
+ if (SEGMENTO.palette == 0) { // use colors for gradient
col1 = SEGCOLOR(0);
col2 = SEGCOLOR(2);
}
@@ -6383,90 +6383,90 @@ uint16_t mode_2Dscrollingtext(void) {
for (int i = 0; i < numberOfLetters; i++) {
int xoffset = int(cols) - int(SEGENV.aux0) + rotLW*i;
- if (xoffset + rotLW < 0) continue; // don't draw characters off-screen
- SEGMENT.drawCharacter(text[i], xoffset, yoffset, letterWidth, letterHeight, col1, col2, rotate);
+ if (xoffset + rotLW < 0) continuar; // don't dibujar characters off-screen
+ SEGMENTO.drawCharacter(texto[i], xoffset, yoffset, letterWidth, letterHeight, col1, col2, rotate);
}
- return FRAMETIME;
+ retorno FRAMETIME;
}
-static const char _data_FX_MODE_2DSCROLLTEXT[] PROGMEM = "Scrolling Text@!,Y Offset,Trail,Font size,Rotate,Gradient,,Reverse;!,!,Gradient;!;2;ix=128,c1=0,rev=0,mi=0,rY=0,mY=0";
+estático constante char _data_FX_MODE_2DSCROLLTEXT[] PROGMEM = "Scrolling Texto@!,Y Desplazamiento,Trail,Font tamaño,Rotate,Gradient,,Reverse;!,!,Gradient;!;2;ix=128,c1=0,rev=0,mi=0,rY=0,mY=0";
////////////////////////////
// 2D Drift Rose //
////////////////////////////
-//// Drift Rose by stepko (c)2021 [https://editor.soulmatelights.com/gallery/1369-drift-rose-pattern], adapted by Blaz Kristan (AKA blazoncek) improved by @dedehai
+//// Drift Rose by stepko (c)2021 [https://editor.soulmatelights.com/gallery/1369-drift-rose-patrón], adapted by Blaz Kristan (AKA blazoncek) improved by @dedehai
uint16_t mode_2Ddriftrose(void) {
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
- const float CX = (cols-cols%2)/2.f - .5f;
- const float CY = (rows-rows%2)/2.f - .5f;
- const float L = min(cols, rows) / 2.f;
+ constante flotante CX = (cols-cols%2)/2.f - .5f;
+ constante flotante CY = (rows-rows%2)/2.f - .5f;
+ constante flotante L = min(cols, rows) / 2.f;
- SEGMENT.fadeToBlackBy(32+(SEGMENT.speed>>3));
+ SEGMENTO.fadeToBlackBy(32+(SEGMENTO.velocidad>>3));
for (size_t i = 1; i < 37; i++) {
- float angle = radians(i * 10);
+ flotante angle = radians(i * 10);
uint32_t x = (CX + (sin_t(angle) * (beatsin8_t(i, 0, L*2)-L))) * 255.f;
uint32_t y = (CY + (cos_t(angle) * (beatsin8_t(i, 0, L*2)-L))) * 255.f;
- if(SEGMENT.palette == 0) SEGMENT.wu_pixel(x, y, CHSV(i * 10, 255, 255));
- else SEGMENT.wu_pixel(x, y, ColorFromPalette(SEGPALETTE, i * 10));
+ if(SEGMENTO.palette == 0) SEGMENTO.wu_pixel(x, y, CHSV(i * 10, 255, 255));
+ else SEGMENTO.wu_pixel(x, y, ColorFromPalette(SEGPALETTE, i * 10));
}
- SEGMENT.blur(SEGMENT.intensity >> 4, SEGMENT.check1);
+ SEGMENTO.blur(SEGMENTO.intensidad >> 4, SEGMENTO.check1);
- return FRAMETIME;
+ retorno FRAMETIME;
}
-static const char _data_FX_MODE_2DDRIFTROSE[] PROGMEM = "Drift Rose@Fade,Blur,,,,Smear;;!;2;pal=11";
+estático constante char _data_FX_MODE_2DDRIFTROSE[] PROGMEM = "Drift Rose@Fade,Blur,,,,Smear;;!;2;pal=11";
/////////////////////////////
// 2D PLASMA ROTOZOOMER //
/////////////////////////////
// Plasma Rotozoomer by ldirko (c)2020 [https://editor.soulmatelights.com/gallery/457-plasma-rotozoomer], adapted for WLED by Blaz Kristan (AKA blazoncek)
uint16_t mode_2Dplasmarotozoom() {
- if (!strip.isMatrix || !SEGMENT.is2D()) return mode_static(); // not a 2D set-up
+ if (!tira.isMatrix || !SEGMENTO.is2D()) retorno mode_static(); // not a 2D set-up
- const int cols = SEG_W;
- const int rows = SEG_H;
+ constante int cols = SEG_W;
+ constante int rows = SEG_H;
- unsigned dataSize = SEGMENT.length() + sizeof(float);
- if (!SEGENV.allocateData(dataSize)) return mode_static(); //allocation failed
- float *a = reinterpret_cast(SEGENV.data);
- byte *plasma = reinterpret_cast(SEGENV.data+sizeof(float));
+ unsigned dataSize = SEGMENTO.longitud() + sizeof(flotante);
+ if (!SEGENV.allocateData(dataSize)) retorno mode_static(); //allocation failed
+ flotante *a = reinterpret_cast(SEGENV.datos);
+ byte *plasma = reinterpret_cast(SEGENV.datos+sizeof(flotante));
- unsigned ms = strip.now/15;
+ unsigned ms = tira.now/15;
// plasma
for (int j = 0; j < rows; j++) {
- int index = j*cols;
+ int índice = j*cols;
for (int i = 0; i < cols; i++) {
- if (SEGMENT.check1) plasma[index+i] = (i * 4 ^ j * 4) + ms / 6;
- else plasma[index+i] = inoise8(i * 40, j * 40, ms);
+ if (SEGMENTO.check1) plasma[índice+i] = (i * 4 ^ j * 4) + ms / 6;
+ else plasma[índice+i] = inoise8(i * 40, j * 40, ms);
}
}
// rotozoom
- float f = (sin_t(*a/2)+((128-SEGMENT.intensity)/128.0f)+1.1f)/1.5f; // scale factor
- float kosinus = cos_t(*a) * f;
- float sinus = sin_t(*a) * f;
+ flotante f = (sin_t(*a/2)+((128-SEGMENTO.intensidad)/128.0f)+1.1f)/1.5f; // escala factor
+ flotante kosinus = cos_t(*a) * f;
+ flotante sinus = sin_t(*a) * f;
for (int i = 0; i < cols; i++) {
- float u1 = i * kosinus;
- float v1 = i * sinus;
+ flotante u1 = i * kosinus;
+ flotante v1 = i * sinus;
for (int j = 0; j < rows; j++) {
byte u = abs8(u1 - j * sinus) % cols;
byte v = abs8(v1 + j * kosinus) % rows;
- SEGMENT.setPixelColorXY(i, j, SEGMENT.color_from_palette(plasma[v*cols+u], false, PALETTE_SOLID_WRAP, 255));
+ SEGMENTO.setPixelColorXY(i, j, SEGMENTO.color_from_palette(plasma[v*cols+u], falso, PALETTE_SOLID_WRAP, 255));
}
}
- *a -= 0.03f + float(SEGENV.speed-128)*0.0002f; // rotation speed
- if(*a < -6283.18530718f) *a += 6283.18530718f; // 1000*2*PI, protect sin/cos from very large input float values (will give wrong results)
+ *a -= 0.03f + flotante(SEGENV.velocidad-128)*0.0002f; // rotation velocidad
+ if(*a < -6283.18530718f) *a += 6283.18530718f; // 1000*2*PI, protect sin/cos from very large entrada flotante values (will give wrong results)
- return FRAMETIME;
+ retorno FRAMETIME;
}
-static const char _data_FX_MODE_2DPLASMAROTOZOOM[] PROGMEM = "Rotozoomer@!,Scale,,,,Alt;;!;2;pal=54";
+estático constante char _data_FX_MODE_2DPLASMAROTOZOOM[] PROGMEM = "Rotozoomer@!,Escala,,,,Alt;;!;2;pal=54";
-#endif // WLED_DISABLE_2D
+#fin si // WLED_DISABLE_2D
///////////////////////////////////////////////////////////////////////////////
@@ -6626,7 +6626,7 @@ static const char _data_FX_MODE_2DWAVERLY[] PROGMEM = "Waverly@Amplification,Sen
#endif // WLED_DISABLE_2D
-// Gravity struct requited for GRAV* effects
+// Gravity estructura requited for GRAV* effects
typedef struct Gravity {
int topLED;
int gravityCounter;
@@ -6636,7 +6636,7 @@ typedef struct Gravity {
// * GRAVCENTER //
///////////////////////
// Gravcenter effects By Andrew Tuline.
-// Gravcenter base function for Gravcenter (0), Gravcentric (1), Gravimeter (2), Gravfreq (3) (merged by @dedehai)
+// Gravcenter base función for Gravcenter (0), Gravcentric (1), Gravimeter (2), Gravfreq (3) (merged by @dedehai)
uint16_t mode_gravcenter_base(unsigned mode) {
if (SEGLEN == 1) return mode_static();
@@ -6766,7 +6766,7 @@ uint16_t mode_juggles(void) { // Juggles. By Andrew Tuline.
uint8_t my_sampleAgc = fmax(fmin(volumeSmth, 255.0), 0);
for (size_t i=0; iu_data[0];
int volumeRaw = *(int16_t*)um_data->u_data[1];
- //uint8_t fadeRate = map(SEGMENT.speed,0,255,224,255);
+ //uint8_t fadeRate = map(SEGMENTO.velocidad,0,255,224,255);
uint8_t fadeRate = map(SEGMENT.speed,0,255,200,254);
SEGMENT.fade_out(fadeRate);
@@ -6907,7 +6907,7 @@ static const char _data_FX_MODE_NOISEMETER[] PROGMEM = "Noisemeter@Fade rate,Wid
//////////////////////
uint16_t mode_pixelwave(void) { // Pixelwave. By Andrew Tuline.
if (SEGLEN <= 1) return mode_static();
- // even with 1D effect we have to take logic for 2D segments for allocation as fill_solid() fills whole segment
+ // even with 1D efecto we have to take logic for 2D segments for allocation as fill_solid() fills whole segmento
if (SEGENV.call == 0) {
SEGMENT.fill(BLACK);
@@ -6941,7 +6941,7 @@ typedef struct Plasphase {
} plasphase;
uint16_t mode_plasmoid(void) { // Plasmoid. By Andrew Tuline.
- // even with 1D effect we have to take logic for 2D segments for allocation as fill_solid() fills whole segment
+ // even with 1D efecto we have to take logic for 2D segments for allocation as fill_solid() fills whole segmento
if (!SEGENV.allocateData(sizeof(plasphase))) return mode_static(); //allocation failed
Plasphase* plasmoip = reinterpret_cast(SEGENV.data);
@@ -6954,7 +6954,7 @@ uint16_t mode_plasmoid(void) { // Plasmoid. By Andrew Tuline.
plasmoip->thatphase += beatsin8_t(7,-4,4); // Two phase values to make a complex pattern. By Andrew Tuline.
for (unsigned i = 0; i < SEGLEN; i++) { // For each of the LED's in the strand, set a brightness based on a wave as follows.
- // updated, similar to "plasma" effect - softhack007
+ // updated, similar to "plasma" efecto - softhack007
uint8_t thisbright = cubicwave8(((i*(1 + (3*SEGMENT.speed/32)))+plasmoip->thisphase) & 0xFF)/2;
thisbright += cos8_t(((i*(97 +(5*SEGMENT.speed/32)))+plasmoip->thatphase) & 0xFF)/2; // Let's munge the brightness a bit and animate it all with the phases.
@@ -7053,7 +7053,7 @@ static const char _data_FX_MODE_PIXELS[] PROGMEM = "Pixels@Fade rate,# of pixels
//////////////////////
uint16_t mode_blurz(void) { // Blurz. By Andrew Tuline.
if (SEGLEN <= 1) return mode_static();
- // even with 1D effect we have to take logic for 2D segments for allocation as fill_solid() fills whole segment
+ // even with 1D efecto we have to take logic for 2D segments for allocation as fill_solid() fills whole segmento
um_data_t *um_data = getAudioData();
uint8_t *fftResult = (uint8_t*)um_data->u_data[2];
@@ -7085,7 +7085,7 @@ static const char _data_FX_MODE_BLURZ[] PROGMEM = "Blurz@Fade rate,Blur;!,Color
// ** DJLight //
/////////////////////////
uint16_t mode_DJLight(void) { // Written by ??? Adapted by Will Tatam.
- // No need to prevent from executing on single led strips, only mid will be set (mid = 0)
+ // No need to prevent from executing on single LED strips, only mid will be set (mid = 0)
const int mid = SEGLEN / 2;
um_data_t *um_data = getAudioData();
@@ -7117,8 +7117,8 @@ static const char _data_FX_MODE_DJLIGHT[] PROGMEM = "DJ Light@Speed;;;01f;m12=2,
////////////////////
uint16_t mode_freqmap(void) { // Map FFT_MajorPeak to SEGLEN. Would be better if a higher framerate.
if (SEGLEN <= 1) return mode_static();
- // Start frequency = 60 Hz and log10(60) = 1.78
- // End frequency = MAX_FREQUENCY in Hz and lo10(MAX_FREQUENCY) = MAX_FREQ_LOG10
+ // Iniciar frecuencia = 60 Hz and log10(60) = 1.78
+ // End frecuencia = MAX_FREQUENCY in Hz and lo10(MAX_FREQUENCY) = MAX_FREQ_LOG10
um_data_t *um_data = getAudioData();
float FFT_MajorPeak = *(float*)um_data->u_data[4];
@@ -7149,7 +7149,7 @@ static const char _data_FX_MODE_FREQMAP[] PROGMEM = "Freqmap@Fade rate,Starting
// ** Freqmatrix //
///////////////////////
uint16_t mode_freqmatrix(void) { // Freqmatrix. By Andreas Pleschung.
- // No need to prevent from executing on single led strips, we simply change pixel 0 each time and avoid the shift
+ // No need to prevent from executing on single LED strips, we simply change píxel 0 each time and avoid the shift
um_data_t *um_data = getAudioData();
float FFT_MajorPeak = *(float*)um_data->u_data[4];
float volumeSmth = *(float*)um_data->u_data[0];
@@ -7171,8 +7171,8 @@ uint16_t mode_freqmatrix(void) { // Freqmatrix. By Andreas Plesch
CRGB color = CRGB::Black;
if (FFT_MajorPeak > MAX_FREQUENCY) FFT_MajorPeak = 1;
- // MajorPeak holds the freq. value which is most abundant in the last sample.
- // With our sampling rate of 10240Hz we have a usable freq range from roughly 80Hz to 10240/2 Hz
+ // MajorPeak holds the freq. valor which is most abundant in the last sample.
+ // With our sampling rate of 10240Hz we have a usable freq rango from roughly 80Hz to 10240/2 Hz
// we will treat everything with less than 65Hz as 0
if (FFT_MajorPeak < 80) {
@@ -7186,9 +7186,9 @@ uint16_t mode_freqmatrix(void) { // Freqmatrix. By Andreas Plesch
color = CHSV(i, 240, (uint8_t)b); // implicit conversion to RGB supplied by FastLED
}
- // shift the pixels one pixel up
+ // shift the pixels one píxel up
SEGMENT.setPixelColor(0, color);
- // if SEGLEN equals 1 this loop won't execute
+ // if SEGLEN equals 1 this bucle won't execute
for (int i = SEGLEN - 1; i > 0; i--) SEGMENT.setPixelColor(i, SEGMENT.getPixelColor(i-1)); //move to the left
}
@@ -7200,19 +7200,19 @@ static const char _data_FX_MODE_FREQMATRIX[] PROGMEM = "Freqmatrix@Speed,Sound e
//////////////////////
// ** Freqpixels //
//////////////////////
-// Start frequency = 60 Hz and log10(60) = 1.78
-// End frequency = 5120 Hz and lo10(5120) = 3.71
-// SEGMENT.speed select faderate
-// SEGMENT.intensity select colour index
+// Iniciar frecuencia = 60 Hz and log10(60) = 1.78
+// End frecuencia = 5120 Hz and lo10(5120) = 3.71
+// SEGMENTO.velocidad select faderate
+// SEGMENTO.intensidad select colour índice
uint16_t mode_freqpixels(void) { // Freqpixel. By Andrew Tuline.
um_data_t *um_data = getAudioData();
float FFT_MajorPeak = *(float*)um_data->u_data[4];
float my_magnitude = *(float*)um_data->u_data[5] / 16.0f;
if (FFT_MajorPeak < 1) FFT_MajorPeak = 1.0f; // log10(0) is "forbidden" (throws exception)
- // this code translates to speed * (2 - speed/255) which is a) speed*2 or b) speed (when speed is 255)
- // and since fade_out() can only take 0-255 it will behave incorrectly when speed > 127
- //uint16_t fadeRate = 2*SEGMENT.speed - SEGMENT.speed*SEGMENT.speed/255; // Get to 255 as quick as you can.
+ // this código translates to velocidad * (2 - velocidad/255) which is a) velocidad*2 or b) velocidad (when velocidad is 255)
+ // and since fade_out() can only take 0-255 it will behave incorrectly when velocidad > 127
+ //uint16_t fadeRate = 2*SEGMENTO.velocidad - SEGMENTO.velocidad*SEGMENTO.velocidad/255; // Get to 255 as quick as you can.
unsigned fadeRate = SEGMENT.speed*SEGMENT.speed; // Get to 255 as quick as you can.
fadeRate = map(fadeRate, 0, 65535, 1, 255);
@@ -7235,19 +7235,19 @@ static const char _data_FX_MODE_FREQPIXELS[] PROGMEM = "Freqpixels@Fade rate,Sta
// ** Freqwave //
//////////////////////
// Assign a color to the central (starting pixels) based on the predominant frequencies and the volume. The color is being determined by mapping the MajorPeak from the FFT
-// and then mapping this to the HSV color circle. Currently we are sampling at 10240 Hz, so the highest frequency we can look at is 5120Hz.
+// and then mapping this to the HSV color circle. Currently we are sampling at 10240 Hz, so the highest frecuencia we can look at is 5120Hz.
//
-// SEGMENT.custom1: the lower cut off point for the FFT. (many, most time the lowest values have very little information since they are FFT conversion artifacts. Suggested value is close to but above 0
-// SEGMENT.custom2: The high cut off point. This depends on your sound profile. Most music looks good when this slider is between 50% and 100%.
-// SEGMENT.custom3: "preamp" for the audio signal for audio10.
+// SEGMENTO.custom1: the lower cut off point for the FFT. (many, most time the lowest values have very little information since they are FFT conversion artifacts. Suggested valor is close to but above 0
+// SEGMENTO.custom2: The high cut off point. This depends on your sound perfil. Most music looks good when this slider is between 50% and 100%.
+// SEGMENTO.custom3: "preamp" for the audio señal for audio10.
//
-// I suggest that for this effect you turn the brightness to 95%-100% but again it depends on your soundprofile you find yourself in.
-// Instead of using colorpalettes, This effect works on the HSV color circle with red being the lowest frequency
+// I suggest that for this efecto you turn the brillo to 95%-100% but again it depends on your soundprofile you encontrar yourself in.
+// Instead of usando colorpalettes, This efecto works on the HSV color circle with red being the lowest frecuencia
//
-// As a compromise between speed and accuracy we are currently sampling with 10240Hz, from which we can then determine with a 512bin FFT our max frequency is 5120Hz.
-// Depending on the music stream you have you might find it useful to change the frequency mapping.
+// As a compromise between velocidad and accuracy we are currently sampling with 10240Hz, from which we can then determine with a 512bin FFT our max frecuencia is 5120Hz.
+// Depending on the music stream you have you might encontrar it useful to change the frecuencia mapping.
uint16_t mode_freqwave(void) { // Freqwave. By Andreas Pleschung.
- // As before, this effect can also work on single pixels, we just lose the shifting effect
+ // As before, this efecto can also work on single pixels, we just lose the shifting efecto
um_data_t *um_data = getAudioData();
float FFT_MajorPeak = *(float*)um_data->u_data[4];
float volumeSmth = *(float*)um_data->u_data[0];
@@ -7267,8 +7267,8 @@ uint16_t mode_freqwave(void) { // Freqwave. By Andreas Pleschun
CRGB color = 0;
if (FFT_MajorPeak > MAX_FREQUENCY) FFT_MajorPeak = 1.0f;
- // MajorPeak holds the freq. value which is most abundant in the last sample.
- // With our sampling rate of 10240Hz we have a usable freq range from roughly 80Hz to 10240/2 Hz
+ // MajorPeak holds the freq. valor which is most abundant in the last sample.
+ // With our sampling rate of 10240Hz we have a usable freq rango from roughly 80Hz to 10240/2 Hz
// we will treat everything with less than 65Hz as 0
if (FFT_MajorPeak < 80) {
@@ -7283,7 +7283,7 @@ uint16_t mode_freqwave(void) { // Freqwave. By Andreas Pleschun
SEGMENT.setPixelColor(SEGLEN/2, color);
- // shift the pixels one pixel outwards
+ // shift the pixels one píxel outwards
// if SEGLEN equals 1 these loops won't execute
for (unsigned i = SEGLEN - 1; i > SEGLEN/2; i--) SEGMENT.setPixelColor(i, SEGMENT.getPixelColor(i-1)); //move to the left
for (unsigned i = 0; i < SEGLEN/2; i++) SEGMENT.setPixelColor(i, SEGMENT.getPixelColor(i+1)); // move to the right
@@ -7307,7 +7307,7 @@ uint16_t mode_noisemove(void) { // Noisemove. By: Andrew Tuli
uint8_t numBins = map(SEGMENT.intensity,0,255,0,16); // Map slider to fftResult bins.
for (int i=0; i(SEGENV.data + dataSize);
uint8_t *offsY = reinterpret_cast(SEGENV.data + dataSize + 1);
- // re-init if SEGMENT dimensions or offset changed
+ // re-init if SEGMENTO dimensions or desplazamiento changed
if (SEGENV.call == 0 || SEGENV.aux0 != cols || SEGENV.aux1 != rows || SEGMENT.custom1 != *offsX || SEGMENT.custom2 != *offsY) {
SEGENV.step = 0; // t
SEGENV.aux0 = cols;
@@ -7861,7 +7861,7 @@ uint16_t mode_2Doctopus() {
for (int y = 0; y < rows; y++) {
byte angle = rMap[XY(x,y)].angle;
byte radius = rMap[XY(x,y)].radius;
- //CRGB c = CHSV(SEGENV.step / 2 - radius, 255, sin8_t(sin8_t((angle * 4 - radius) / 4 + SEGENV.step) + radius - SEGENV.step * 2 + angle * (SEGMENT.custom3/3+1)));
+ //CRGB c = CHSV(SEGENV.paso / 2 - radius, 255, sin8_t(sin8_t((angle * 4 - radius) / 4 + SEGENV.paso) + radius - SEGENV.paso * 2 + angle * (SEGMENTO.custom3/3+1)));
unsigned intensity = sin8_t(sin8_t((angle * 4 - radius) / 4 + SEGENV.step/2) + radius - SEGENV.step + angle * (SEGMENT.custom3/4+1));
intensity = map((intensity*intensity) & 0xFFFF, 0, 65535, 0, 255); // add a bit of non-linearity for cleaner display
SEGMENT.setPixelColorXY(x, y, ColorFromPalette(SEGPALETTE, SEGENV.step / 2 - radius, intensity));
@@ -7900,7 +7900,7 @@ static const char _data_FX_MODE_2DWAVINGCELL[] PROGMEM = "Waving Cell@!,Blur,Amp
#ifndef WLED_DISABLE_PARTICLESYSTEM2D
/*
- Particle System Vortex
+ Particle Sistema Vortex
Particles sprayed from center with a rotating spray
Uses palette for particle color
by DedeHai (Damian Schneider)
@@ -7953,14 +7953,14 @@ uint16_t mode_particlevortex(void) {
else
PartSys->setSmearBlur(0); // disable smear blur
- // update colors of the sprays
+ // actualizar colors of the sprays
for (i = 0; i < spraycount; i++) {
uint32_t coloroffset = 0xFF / spraycount;
PartSys->sources[i].source.hue = coloroffset * i;
}
- // set rotation direction and speed
- // can use direction flag to determine current direction
+ // set rotation direction and velocidad
+ // can use direction bandera to determine current direction
bool direction = SEGMENT.check2; //no automatic direction change, set it to flag
int32_t currentspeed = (int32_t)SEGENV.step; // make a signed integer out of step
@@ -8016,7 +8016,7 @@ static const char _data_FX_MODE_PARTICLEVORTEX[] PROGMEM = "PS Vortex@Rotation S
/*
Particle Fireworks
- Rockets shoot up and explode in a random color, sometimes in a defined pattern
+ Rockets shoot up and explode in a random color, sometimes in a defined patrón
by DedeHai (Damian Schneider)
*/
#define NUMBEROFSOURCES 8
@@ -8051,7 +8051,7 @@ uint16_t mode_particlefireworks(void) {
PartSys->setGravity(map(SEGMENT.custom3, 0, 31, SEGMENT.check2 ? 1 : 0, 10)); // if bounded, set gravity to minimum of 1 or they will bounce at top
PartSys->setMotionBlur(map(SEGMENT.custom2, 0, 255, 0, 245)); // anable motion blur
- // update the rockets, set the speed state
+ // actualizar the rockets, set the velocidad estado
for (uint32_t j = 0; j < numRockets; j++) {
PartSys->applyGravity(PartSys->sources[j].source);
PartSys->particleMoveUpdate(PartSys->sources[j].source, PartSys->sources[j].sourceFlags);
@@ -8074,7 +8074,7 @@ uint16_t mode_particlefireworks(void) {
}
}
}
- // check each rocket's state and emit particles according to its state: moving up = emit exhaust, at top = explode; falling down = standby time
+ // verificar each rocket's estado and emit particles according to its estado: moving up = emit exhaust, at top = explode; falling down = standby time
uint32_t emitparticles, frequency, baseangle, hueincrement; // number of particles to emit for each rocket's state
// variables for circular explosions
[[maybe_unused]] int32_t speed, currentspeed, speedvariation, percircle;
@@ -8085,7 +8085,7 @@ uint16_t mode_particlefireworks(void) {
// emit particles for each rocket
for (uint32_t j = 0; j < numRockets; j++) {
- // determine rocket state by its speed:
+ // determine rocket estado by its velocidad:
if (PartSys->sources[j].source.vy > 0) { // moving up, emit exhaust
emitparticles = 1;
}
@@ -8215,7 +8215,7 @@ uint16_t mode_particlevolcano(void) {
}
}
- // Particle System settings
+ // Particle Sistema settings
PartSys->updateSystem(); // update system properties (dimensions and data pointers)
PartSys->setColorByAge(SEGMENT.check1);
PartSys->setBounceX(SEGMENT.check2);
@@ -8234,7 +8234,7 @@ static const char _data_FX_MODE_PARTICLEVOLCANO[] PROGMEM = "PS Volcano@Speed,In
/*
Particle Fire
- realistic fire effect using particles. heat based and using perlin-noise for wind
+ realistic fire efecto usando particles. heat based and usando perlin-noise for wind
by DedeHai (Damian Schneider)
*/
uint16_t mode_particlefire(void) {
@@ -8264,7 +8264,7 @@ uint16_t mode_particlefire(void) {
uint32_t period = strip.now - *lastcall;
if (period < (uint32_t)map(SEGMENT.speed, 0, 99, 50, 10)) { // limit to 90FPS - 20FPS
SEGMENT.call--; //skipping a frame, decrement the counter (on call0, this is never executed as lastcall is 0, so its fine to not check if >0)
- //still need to render the frame or flickering will occur in transitions
+ //still need to renderizar the frame or flickering will occur in transitions
PartSys->updateFire(SEGMENT.intensity, true); // render the fire without updating particles (render only)
return FRAMETIME; //do not update this frame
}
@@ -8275,7 +8275,7 @@ uint16_t mode_particlefire(void) {
numFlames = min((uint32_t)PartSys->numSources, (4 + ((spread / PS_P_RADIUS) << 1))); // number of flames used depends on spread with, good value is (fire width in pixel) * 2
uint32_t percycle = (numFlames * 2) / 3; // maximum number of particles emitted per cycle (TODO: for ESP826 maybe use flames/2)
- // update the flame sprays:
+ // actualizar the flame sprays:
for (i = 0; i < numFlames; i++) {
if (SEGMENT.call & 1 && PartSys->sources[i].source.ttl > 0) { // every second frame
PartSys->sources[i].source.ttl--;
@@ -8312,7 +8312,7 @@ uint16_t mode_particlefire(void) {
}
}
- // emit faster sparks at first flame position, amount and speed mostly dependends on intensity
+ // emit faster sparks at first flame posición, amount and velocidad mostly dependends on intensidad
if(hw_random8() < 10 + (SEGMENT.intensity >> 2)) {
for (i = 0; i < PartSys->usedParticles; i++) {
if (PartSys->particles[i].ttl == 0) { // find a dead particle
@@ -8339,8 +8339,8 @@ uint16_t mode_particlefire(void) {
static const char _data_FX_MODE_PARTICLEFIRE[] PROGMEM = "PS Fire@Speed,Intensity,Flame Height,Wind,Spread,Smooth,Cylinder,Turbulence;;!;2;pal=35,sx=110,c1=110,c2=50,c3=31,o1=1";
/*
- PS Ballpit: particles falling down, user can enable these three options: X-wraparound, side bounce, ground bounce
- sliders control falling speed, intensity (number of particles spawned), inter-particle collision hardness (0 means no particle collisions) and render saturation
+ PS Ballpit: particles falling down, usuario can habilitar these three options: X-wraparound, side bounce, ground bounce
+ sliders control falling velocidad, intensidad (number of particles spawned), inter-particle collision hardness (0 means no particle collisions) and renderizar saturation
this is quite versatile, can be made to look like rain or snow or confetti etc.
Uses palette for particle color
by DedeHai (Damian Schneider)
@@ -8375,7 +8375,7 @@ uint16_t mode_particlepit(void) {
if (SEGMENT.call % (128 - (SEGMENT.intensity >> 1)) == 0 && SEGMENT.intensity > 0) { // every nth frame emit particles, stop emitting if set to zero
for (i = 0; i < PartSys->usedParticles; i++) { // emit particles
if (PartSys->particles[i].ttl == 0) { // find a dead particle
- // emit particle at random position over the top of the matrix (random16 is not random enough)
+ // emit particle at random posición over the top of the matrix (random16 is not random enough)
PartSys->particles[i].ttl = 1500 - (SEGMENT.speed << 2) + hw_random16(500); // if speed is higher, make them die sooner
PartSys->particles[i].x = hw_random(PartSys->maxX); //random(PartSys->maxX >> 1) + (PartSys->maxX >> 2);
PartSys->particles[i].y = (PartSys->maxY << 1); // particles appear somewhere above the matrix, maximum is double the height
@@ -8384,7 +8384,7 @@ uint16_t mode_particlepit(void) {
PartSys->particles[i].hue = hw_random16(); // set random color
PartSys->particleFlags[i].collide = true; // enable collision for particle
PartSys->particles[i].sat = ((SEGMENT.custom3) << 3) + 7;
- // set particle size
+ // set particle tamaño
if (SEGMENT.custom1 == 255) {
PartSys->setParticleSize(1); // set global size to 1 for advanced rendering (no single pixel particles)
PartSys->advPartProps[i].size = hw_random16(SEGMENT.custom1); // set each particle to random size
@@ -8445,7 +8445,7 @@ uint16_t mode_particlewaterfall(void) {
if (PartSys == nullptr)
return mode_static(); // something went wrong, no data!
- // Particle System settings
+ // Particle Sistema settings
PartSys->updateSystem(); // update system properties (dimensions and data pointers)
PartSys->setWrapX(SEGMENT.check1); // cylinder
PartSys->setBounceX(SEGMENT.check2); // walls
@@ -8466,7 +8466,7 @@ uint16_t mode_particlewaterfall(void) {
if (SEGMENT.call % (12 - (SEGMENT.intensity >> 5)) == 0 && SEGMENT.intensity > 0) { // every nth frame, emit particles, do not emit if intensity is zero
for (i = 0; i < numSprays; i++) {
PartSys->sources[i].vy = -SEGMENT.speed >> 3; // emitting speed, down
- //PartSys->sources[i].source.x = map(SEGMENT.custom3, 0, 31, 0, (PartSys->maxXpixel - numSprays * 2) * PS_P_RADIUS) + i * PS_P_RADIUS * 2; // emitter position
+ //PartSys->sources[i].source.x = map(SEGMENTO.custom3, 0, 31, 0, (PartSys->maxXpixel - numSprays * 2) * PS_P_RADIUS) + i * PS_P_RADIUS * 2; // emitter posición
PartSys->sources[i].source.x = map(SEGMENT.custom3, 0, 31, 0, (PartSys->maxXpixel - numSprays) * PS_P_RADIUS) + i * PS_P_RADIUS * 2; // emitter position
PartSys->sources[i].source.y = PartSys->maxY + (PS_P_RADIUS * ((i<<2) + 4)); // source y position, few pixels above the top to increase spreading before entering the matrix
PartSys->sources[i].var = (SEGMENT.custom1 >> 3); // emiting variation 0-32
@@ -8538,7 +8538,7 @@ uint16_t mode_particlebox(void) {
if (SEGMENT.check1) { // random, use perlin noise
xgravity = ((int16_t)perlin8(SEGENV.aux0) - 127);
ygravity = ((int16_t)perlin8(SEGENV.aux0 + 10000) - 127);
- // scale the gravity force
+ // escala the gravity force
xgravity = (xgravity * SEGMENT.custom1) / 128;
ygravity = (ygravity * SEGMENT.custom1) / 128;
}
@@ -8597,7 +8597,7 @@ uint16_t mode_particleperlin(void) {
// apply 'gravity' from a 2D perlin noise map
SEGENV.aux0 += 1 + (SEGMENT.speed >> 5); // noise z-position
- // update position in noise
+ // actualizar posición in noise
for (i = 0; i < PartSys->usedParticles; i++) {
if (PartSys->particles[i].ttl == 0) { // revive dead particles (do not keep them alive forever, they can clump up, need to reseed)
PartSys->particles[i].ttl = hw_random16(500) + 200;
@@ -8655,7 +8655,7 @@ uint16_t mode_particleimpact(void) {
if (PartSys == nullptr)
return mode_static(); // something went wrong, no data!
- // Particle System settings
+ // Particle Sistema settings
PartSys->updateSystem(); // update system properties (dimensions and data pointers)
PartSys->setWrapX(SEGMENT.check1);
PartSys->setBounceX(SEGMENT.check2);
@@ -8667,7 +8667,7 @@ uint16_t mode_particleimpact(void) {
uint32_t emitparticles; // number of particles to emit for each rocket's state
for (uint32_t i = 0; i < numMeteors; i++) {
- // determine meteor state by its speed:
+ // determine meteor estado by its velocidad:
if ( PartSys->sources[i].source.vy < 0) // moving down, emit sparks
emitparticles = 1;
else if ( PartSys->sources[i].source.vy > 0) // moving up means meteor is on 'standby'
@@ -8681,7 +8681,7 @@ uint16_t mode_particleimpact(void) {
}
}
- // update the meteors, set the speed state
+ // actualizar the meteors, set the velocidad estado
for (uint32_t i = 0; i < numMeteors; i++) {
if (PartSys->sources[i].source.ttl) {
PartSys->sources[i].source.ttl--; // note: this saves an if statement, but moving down particles age twice
@@ -8689,7 +8689,7 @@ uint16_t mode_particleimpact(void) {
PartSys->applyGravity(PartSys->sources[i].source);
PartSys->particleMoveUpdate(PartSys->sources[i].source, PartSys->sources[i].sourceFlags, &meteorsettings);
- // if source reaches the bottom, set speed to 0 so it will explode on next function call (handled above)
+ // if source reaches the bottom, set velocidad to 0 so it will explode on next función call (handled above)
if (PartSys->sources[i].source.y < PS_P_RADIUS<<1) { // reached the bottom pixel on its way down
PartSys->sources[i].source.vy = 0; // set speed zero so it will explode
PartSys->sources[i].source.vx = 0;
@@ -8771,7 +8771,7 @@ uint16_t mode_particleattractor(void) {
if (PartSys == nullptr)
return mode_static(); // something went wrong, no data!
- // Particle System settings
+ // Particle Sistema settings
PartSys->updateSystem(); // update system properties (dimensions and data pointers)
attractor = reinterpret_cast(PartSys->PSdataEnd);
@@ -8856,7 +8856,7 @@ uint16_t mode_particlespray(void) {
if (PartSys == nullptr)
return mode_static(); // something went wrong, no data!
- // Particle System settings
+ // Particle Sistema settings
PartSys->updateSystem(); // update system properties (dimensions and data pointers)
PartSys->setBounceX(!SEGMENT.check2);
PartSys->setWrapX(SEGMENT.check2);
@@ -8869,7 +8869,7 @@ uint16_t mode_particlespray(void) {
else
PartSys->enableParticleCollisions(false);
- //position according to sliders
+ //posición according to sliders
PartSys->sources[0].source.x = map(SEGMENT.custom1, 0, 255, 0, PartSys->maxX);
PartSys->sources[0].source.y = map(SEGMENT.custom2, 0, 255, 0, PartSys->maxY);
uint16_t angle = (256 - (((int32_t)SEGMENT.custom3 + 1) << 3)) << 8;
@@ -8904,8 +8904,8 @@ uint16_t mode_particlespray(void) {
PartSys->sources[0].maxLife = 300; // lifetime in frames. note: could be done in init part, but AR moderequires this to be dynamic
PartSys->sources[0].minLife = 100;
PartSys->sources[0].source.hue++; // = hw_random16(); //change hue of spray source
- // PartSys->sources[i].var = SEGMENT.custom3; // emiting variation = nozzle size (custom 3 goes from 0-32)
- // spray[j].source.hue = hw_random16(); //set random color for each particle (using palette)
+ // PartSys->sources[i].var = SEGMENTO.custom3; // emiting variation = nozzle tamaño (custom 3 goes from 0-32)
+ // spray[j].source.hue = hw_random16(); //set random color for each particle (usando palette)
PartSys->angleEmit(PartSys->sources[0], angle, SEGMENT.speed >> 2);
}
#endif
@@ -8936,19 +8936,19 @@ uint16_t mode_particleGEQ(void) {
return mode_static(); // something went wrong, no data!
uint32_t i;
- // set particle system properties
+ // set particle sistema properties
PartSys->updateSystem(); // update system properties (dimensions and data pointers)
PartSys->setWrapX(SEGMENT.check1);
PartSys->setBounceX(SEGMENT.check2);
PartSys->setBounceY(SEGMENT.check3);
- //PartSys->enableParticleCollisions(false);
+ //PartSys->enableParticleCollisions(falso);
PartSys->setWallHardness(SEGMENT.custom2);
PartSys->setGravity(SEGMENT.custom3 << 2); // set gravity strength
um_data_t *um_data = getAudioData();
uint8_t *fftResult = (uint8_t *)um_data->u_data[2]; // 16 bins with FFT data, log mapped already, each band contains frequency amplitude 0-255
- //map the bands into 16 positions on x axis, emit some particles according to frequency loudness
+ //map the bands into 16 positions on x axis, emit some particles according to frecuencia loudness
i = 0;
uint32_t binwidth = (PartSys->maxX + 1)>>4; //emit poisition variation for one bin (+/-) is equal to width/16 (for 16 bins)
uint32_t threshold = 300 - SEGMENT.intensity;
@@ -9099,7 +9099,7 @@ uint16_t mode_particleghostrider(void) {
SEGENV.aux1 = 1;
}
}
- // Particle System settings
+ // Particle Sistema settings
PartSys->updateSystem(); // update system properties (dimensions and data pointers)
PartSys->setMotionBlur(SEGMENT.custom1);
PartSys->sources[0].var = SEGMENT.custom3 >> 1;
@@ -9111,7 +9111,7 @@ uint16_t mode_particleghostrider(void) {
}
}
- // enable/disable walls
+ // habilitar/deshabilitar walls
ghostsettings.bounceX = SEGMENT.check2;
ghostsettings.bounceY = SEGMENT.check2;
@@ -9142,7 +9142,7 @@ uint16_t mode_particleghostrider(void) {
static const char _data_FX_MODE_PARTICLEGHOSTRIDER[] PROGMEM = "PS Ghost Rider@Speed,Spiral,Blur,Color Cycle,Spread,AgeColor,Walls;;!;2;pal=1,sx=70,ix=0,c1=220,c2=30,c3=21,o1=1";
/*
- PS Blobs: large particles bouncing around, changing size and form
+ PS Blobs: large particles bouncing around, changing tamaño and form
Uses palette for particle color
by DedeHai (Damian Schneider)
*/
@@ -9176,7 +9176,7 @@ uint16_t mode_particleblobs(void) {
if (SEGENV.aux1 != SEGMENT.custom1 || PartSys->particles[i].ttl == 0) // size changed or dead
PartSys->advPartSize[i].maxsize = 60 + (SEGMENT.custom1 >> 1) + hw_random16((SEGMENT.custom1 >> 2)); // set each particle to slightly randomized size
- //PartSys->particles[i].perpetual = SEGMENT.check2; //infinite life if set
+ //PartSys->particles[i].perpetual = SEGMENTO.check2; //infinite life if set
if (PartSys->particles[i].ttl == 0) { // find dead particle, renitialize
PartSys->particles[i].ttl = 300 + hw_random16(((uint16_t)SEGMENT.custom2 << 3) + 100);
PartSys->particles[i].x = hw_random(PartSys->maxX);
@@ -9186,7 +9186,7 @@ uint16_t mode_particleblobs(void) {
PartSys->advPartProps[i].size = 0; // start out small
PartSys->advPartSize[i].asymmetry = hw_random16(220);
PartSys->advPartSize[i].asymdir = hw_random16(255);
- // set advanced size control properties
+ // set advanced tamaño control properties
PartSys->advPartSize[i].grow = true;
PartSys->advPartSize[i].growspeed = 1 + hw_random16(9);
PartSys->advPartSize[i].shrinkspeed = 1 + hw_random16(9);
@@ -9244,7 +9244,7 @@ uint16_t mode_particlegalaxy(void) {
}
if (PartSys == nullptr)
return mode_static(); // something went wrong, no data!
- // Particle System settings
+ // Particle Sistema settings
PartSys->updateSystem(); // update system properties (dimensions and data pointers)
uint8_t particlesize = SEGMENT.custom1;
if(SEGMENT.check3)
@@ -9279,7 +9279,7 @@ uint16_t mode_particlegalaxy(void) {
// (dx/dy): vector pointing from particle to center
int32_t dx = centerx - PartSys->particles[i].x;
int32_t dy = centery - PartSys->particles[i].y;
- //speed towards center:
+ //velocidad towards center:
int32_t distance = sqrt32_bw(dx * dx + dy * dy); // absolute distance to center
if (distance < 20) distance = 20; // avoid division by zero, keep a minimum
int32_t speedfactor;
@@ -9294,7 +9294,7 @@ uint16_t mode_particlegalaxy(void) {
// rotate clockwise
int32_t tempVx = (-speedfactor * dy); // speed is orthogonal to center vector
int32_t tempVy = (speedfactor * dx);
- //add speed towards center to make particles spiral in
+ //add velocidad towards center to make particles spiral in
int vxc = (dx << 9) / (distance - 19); // subtract value from distance to make the pull-in force a bit stronger (helps on faster speeds)
int vyc = (dy << 9) / (distance - 19);
//apply velocity
@@ -9322,12 +9322,12 @@ static const char _data_FX_MODE_PARTICLEGALAXY[] PROGMEM = "PS Galaxy@!,!,Size,,
#endif // WLED_DISABLE_2D
///////////////////////////
-// 1D Particle System FX //
+// 1D Particle Sistema FX //
///////////////////////////
#ifndef WLED_DISABLE_PARTICLESYSTEM1D
/*
- Particle version of Drip and Rain
+ Particle versión of Drip and Rain
Uses palette for particle color
by DedeHai (Damian Schneider)
*/
@@ -9347,7 +9347,7 @@ uint16_t mode_particleDrip(void) {
if (PartSys == nullptr)
return mode_static(); // something went wrong, no data!
- // Particle System settings
+ // Particle Sistema settings
PartSys->updateSystem(); // update system properties (dimensions and data pointers)
PartSys->setBounce(true);
PartSys->setWallHardness(50);
@@ -9391,7 +9391,7 @@ uint16_t mode_particleDrip(void) {
if (SEGMENT.call % SEGENV.aux0 == 0) {
int32_t interval = 300 / ((SEGMENT.intensity) + 1);
SEGENV.aux0 = interval + hw_random(interval + 5);
- // if (SEGMENT.check1) // rain mode
+ // if (SEGMENTO.check1) // rain mode
// PartSys->sources[0].source.hue = 0;
// else
PartSys->sources[0].source.hue = hw_random8(); //set random color TODO: maybe also not random but color cycling? need another slider or checkmark for this.
@@ -9419,7 +9419,7 @@ uint16_t mode_particleDrip(void) {
if (PartSys->particles[i].hue < 245)
PartSys->particles[i].hue += 8;
}
- //increase speed on high settings by calling the move function twice
+ //increase velocidad on high settings by calling the move función twice
if (SEGMENT.speed > 200)
PartSys->particleMoveUpdate(PartSys->particles[i], PartSys->particleFlags[i]);
}
@@ -9454,8 +9454,8 @@ uint16_t mode_particlePinball(void) {
if (PartSys == nullptr)
return mode_static(); // something went wrong, no data!
- // Particle System settings
- //uint32_t hardness = 240 + (SEGMENT.custom1>>4);
+ // Particle Sistema settings
+ //uint32_t hardness = 240 + (SEGMENTO.custom1>>4);
PartSys->updateSystem(); // update system properties (dimensions and data pointers)
PartSys->setGravity(map(SEGMENT.custom3, 0 , 31, 0 , 16)); // set gravity (8 is default strength)
PartSys->setBounce(SEGMENT.custom3); // disables bounce if no gravity is used
@@ -9506,7 +9506,7 @@ uint16_t mode_particlePinball(void) {
PartSys->sources[0].var = SEGMENT.speed >> 3;
int32_t newspeed = 2 + (SEGMENT.speed >> 1) - (SEGMENT.speed >> 3);
PartSys->sources[0].v = newspeed;
- //check for balls that are 'laying on the ground' and remove them
+ //verificar for balls that are 'laying on the ground' and eliminar them
for (uint32_t i = 0; i < PartSys->usedParticles; i++) {
if (PartSys->particles[i].vx == 0 && PartSys->particles[i].x < (PS_P_RADIUS_1D + SEGMENT.custom1))
PartSys->particles[i].ttl = 0;
@@ -9539,8 +9539,8 @@ static const char _data_FX_MODE_PSPINBALL[] PROGMEM = "PS Pinball@Speed,!,Size,B
/*
Particle Replacement for original Dancing Shadows:
- "Spotlights moving back and forth that cast dancing shadows.
- Shine this through tree branches/leaves or other close-up objects that cast
+ "Spotlights moving back and forth that conversión dancing shadows.
+ Shine this through árbol branches/leaves or other close-up objects that conversión
interesting shadows onto a ceiling or tarp.
By Steve Pomeroy @xxv"
Uses palette for particle color
@@ -9562,7 +9562,7 @@ uint16_t mode_particleDancingShadows(void) {
if (PartSys == nullptr)
return mode_static(); // something went wrong, no data!
- // Particle System settings
+ // Particle Sistema settings
PartSys->updateSystem(); // update system properties (dimensions and data pointers)
PartSys->setMotionBlur(SEGMENT.custom1);
if (SEGMENT.check1)
@@ -9582,9 +9582,9 @@ uint16_t mode_particleDancingShadows(void) {
PartSys->particleFlags[i].perpetual = true; //particles do not age
if (SEGMENT.call % (32 / (1 + (SEGMENT.custom2 >> 3))) == 0)
PartSys->particles[i].hue += 2 + (SEGMENT.custom2 >> 5);
- //note: updating speed on the fly is not accurately possible, since it is unknown which particles are assigned to which spot
+ //note: updating velocidad on the fly is not accurately possible, since it is unknown which particles are assigned to which spot
if (SEGENV.aux0 != SEGMENT.speed) { //speed changed
- //update all particle speed by setting them to current value
+ //actualizar all particle velocidad by setting them to current valor
PartSys->particles[i].vx = PartSys->particles[i].vx > 0 ? SEGMENT.speed >> 3 : -SEGMENT.speed >> 3;
}
if (PartSys->particles[i].ttl == 0) deadparticles++; // count dead particles
@@ -9593,13 +9593,13 @@ uint16_t mode_particleDancingShadows(void) {
//generate a spotlight: generates particles just outside of view
if (deadparticles > 5 && (SEGMENT.call & 0x03) == 0) {
- //random color, random type
+ //random color, random tipo
uint32_t type = hw_random16(SPOT_TYPES_COUNT);
int8_t speed = 2 + hw_random16(2 + (SEGMENT.speed >> 1)) + (SEGMENT.speed >> 4);
int32_t width = hw_random16(1, 10);
uint32_t ttl = 300; //ttl is particle brightness (below perpetual is set so it does not age, i.e. ttl stays at this value)
int32_t position;
- //choose random start position, left and right from the segment
+ //choose random iniciar posición, left and right from the segmento
if (hw_random() & 0x01) {
position = PartSys->maxXpixel;
speed = -speed;
@@ -9643,7 +9643,7 @@ uint16_t mode_particleDancingShadows(void) {
}
}
//emit particle
- //set the particle source position:
+ //set the particle source posición:
PartSys->sources[0].source.x = position * PS_P_RADIUS_1D;
uint32_t partidx = PartSys->sprayEmit(PartSys->sources[0]);
PartSys->particles[partidx].ttl = ttl;
@@ -9678,7 +9678,7 @@ uint16_t mode_particleFireworks1D(void) {
if (PartSys == nullptr)
return mode_static(); // something went wrong, no data!
- // Particle System settings
+ // Particle Sistema settings
PartSys->updateSystem(); // update system properties (dimensions and data pointers)
forcecounter = PartSys->PSdataEnd;
PartSys->setMotionBlur(SEGMENT.custom2); // anable motion blur
@@ -9710,7 +9710,7 @@ uint16_t mode_particleFireworks1D(void) {
if (SEGENV.aux0) { // inverted rockets launch from end
PartSys->sources[0].sourceFlags.reversegrav = true;
- //PartSys->sources[0].source.x = PartSys->maxX; // start from top
+ //PartSys->sources[0].source.x = PartSys->maxX; // iniciar from top
PartSys->sources[0].source.vx = -PartSys->sources[0].source.vx; // revert direction
PartSys->sources[0].v = -PartSys->sources[0].v; // invert exhaust emit speed
}
@@ -9779,7 +9779,7 @@ uint16_t mode_particleFireworks1D(void) {
static const char _data_FX_MODE_PS_FIREWORKS1D[] PROGMEM = "PS Fireworks 1D@Gravity,Explosion,Firing side,Blur,Color,Colorful,Trail,Smooth;,!;!;1;c2=30,o1=1";
/*
- Particle based Sparkle effect
+ Particle based Sparkle efecto
Uses palette for particle color
by DedeHai (Damian Schneider)
*/
@@ -9797,7 +9797,7 @@ uint16_t mode_particleSparkler(void) {
if (PartSys == nullptr)
return mode_static(); // something went wrong, no data!
- // Particle System settings
+ // Particle Sistema settings
PartSys->updateSystem(); // update system properties (dimensions and data pointers)
sparklersettings.wrap = !SEGMENT.check2;
@@ -9805,7 +9805,7 @@ uint16_t mode_particleSparkler(void) {
numSparklers = PartSys->numSources;
PartSys->setMotionBlur(SEGMENT.custom2); // anable motion blur/overlay
- //PartSys->setSmearBlur(SEGMENT.custom2); // anable smearing blur
+ //PartSys->setSmearBlur(SEGMENTO.custom2); // anable smearing blur
for (uint32_t i = 0; i < numSparklers; i++) {
PartSys->sources[i].source.hue = hw_random16();
@@ -9871,7 +9871,7 @@ uint16_t mode_particleHourglass(void) {
if (PartSys == nullptr)
return mode_static(); // something went wrong, no data!
- // Particle System settings
+ // Particle Sistema settings
PartSys->updateSystem(); // update system properties (dimensions and data pointers)
settingTracker = reinterpret_cast(PartSys->PSdataEnd); //assign data pointer
direction = reinterpret_cast(PartSys->PSdataEnd + 4); //assign data pointer
@@ -9892,7 +9892,7 @@ uint16_t mode_particleHourglass(void) {
SEGENV.aux0 = PartSys->usedParticles - 1; // initial state, start with highest number particle
}
- // calculate target position depending on direction
+ // calculate target posición depending on direction
auto calcTargetPos = [&](size_t i) {
return PartSys->particleFlags[i].reversegrav ?
PartSys->maxX - i * PS_P_RADIUS_1D - positionOffset
@@ -9929,7 +9929,7 @@ uint16_t mode_particleHourglass(void) {
PartSys->particles[i].hue += 120;
}
- // re-order particles in case collisions flipped particles (highest number index particle is on the "bottom")
+ // re-order particles in case collisions flipped particles (highest number índice particle is on the "bottom")
for (uint32_t i = 0; i < PartSys->usedParticles - 1; i++) {
if (PartSys->particles[i].x < PartSys->particles[i+1].x && PartSys->particleFlags[i].fixed == false && PartSys->particleFlags[i+1].fixed == false) {
std::swap(PartSys->particles[i].x, PartSys->particles[i+1].x);
@@ -9978,7 +9978,7 @@ uint16_t mode_particleHourglass(void) {
static const char _data_FX_MODE_PS_HOURGLASS[] PROGMEM = "PS Hourglass@Interval,!,Color,Blur,Gravity,Colorflip,Start,Fast Reset;,!;!;1;pal=34,sx=50,ix=200,c1=140,c2=80,c3=4,o1=1,o2=1,o3=1";
/*
- Particle based Spray effect (like a volcano, possible replacement for popcorn)
+ Particle based Spray efecto (like a volcano, possible replacement for popcorn)
Uses palette for particle color
by DedeHai (Damian Schneider)
*/
@@ -9997,7 +9997,7 @@ uint16_t mode_particle1Dspray(void) {
if (PartSys == nullptr)
return mode_static(); // something went wrong, no data!
- // Particle System settings
+ // Particle Sistema settings
PartSys->updateSystem(); // update system properties (dimensions and data pointers)
PartSys->setBounce(SEGMENT.check2);
PartSys->setMotionBlur(SEGMENT.custom2); // anable motion blur
@@ -10017,7 +10017,7 @@ uint16_t mode_particle1Dspray(void) {
SEGMENT.aux0++; // increment hue
}
- //update color settings
+ //actualizar color settings
PartSys->setColorByAge(SEGMENT.check1); // overruled by 'color by position'
PartSys->setColorByPosition(SEGMENT.check3);
for (uint i = 0; i < PartSys->usedParticles; i++) {
@@ -10030,7 +10030,7 @@ uint16_t mode_particle1Dspray(void) {
static const char _data_FX_MODE_PS_1DSPRAY[] PROGMEM = "PS Spray 1D@Speed(+/-),!,Position,Blur,Gravity(+/-),AgeColor,Bounce,Position Color;,!;!;1;sx=200,ix=220,c1=0,c2=0";
/*
- Particle based balance: particles move back and forth (1D pendent to 2D particle box)
+ Particle based equilibrio: particles move back and forth (1D pendent to 2D particle box)
Uses palette for particle color
by DedeHai (Damian Schneider)
*/
@@ -10048,7 +10048,7 @@ uint16_t mode_particleBalance(void) {
if (PartSys == nullptr)
return mode_static(); // something went wrong, no data!
- // Particle System settings
+ // Particle Sistema settings
PartSys->updateSystem(); // update system properties (dimensions and data pointers)
PartSys->setMotionBlur(SEGMENT.custom2); // enable motion blur
PartSys->setBounce(!SEGMENT.check2);
@@ -10086,7 +10086,7 @@ uint16_t mode_particleBalance(void) {
xgravity = ((int16_t)perlin8(SEGENV.aux0) - 128);
else // sinusoidal
xgravity = (int16_t)cos8(SEGENV.aux0) - 128;//((int32_t)(SEGMENT.custom3 << 2) * cos8(SEGENV.aux0)
- // scale the force
+ // escala the force
xgravity = (xgravity * ((SEGMENT.custom3+1) << 2)) / 128; // xgravity: -127 to +127
PartSys->applyForce(xgravity);
}
@@ -10094,11 +10094,11 @@ uint16_t mode_particleBalance(void) {
uint32_t randomindex = hw_random16(PartSys->usedParticles);
PartSys->particles[randomindex].vx = ((int32_t)PartSys->particles[randomindex].vx * 200) / 255; // apply friction to random particle to reduce clumping (without collisions)
- //if (SEGMENT.check2 && (SEGMENT.call & 0x07) == 0) // no walls, apply friction to smooth things out
+ //if (SEGMENTO.check2 && (SEGMENTO.call & 0x07) == 0) // no walls, apply friction to smooth things out
if ((SEGMENT.call & 0x0F) == 0 && SEGMENT.custom3 > 4) // apply friction every 16th frame to smooth things out (except for low tilt)
PartSys->applyFriction(1); // apply friction to all particles
- //update colors
+ //actualizar colors
PartSys->setColorByPosition(SEGMENT.check1);
if (!SEGMENT.check1) {
for (i = 0; i < PartSys->usedParticles; i++) {
@@ -10111,7 +10111,7 @@ uint16_t mode_particleBalance(void) {
static const char _data_FX_MODE_PS_BALANCE[] PROGMEM = "PS 1D Balance@!,!,Hardness,Blur,Tilt,Position Color,Wrap,Random;,!;!;1;pal=18,c2=0,c3=4,o1=1";
/*
-Particle based Chase effect
+Particle based Chase efecto
Uses palette for particle color
by DedeHai (Damian Schneider)
*/
@@ -10128,7 +10128,7 @@ uint16_t mode_particleChase(void) {
PartSys = reinterpret_cast(SEGENV.data); // if not first call, just set the pointer to the PS
if (PartSys == nullptr)
return mode_static(); // something went wrong, no data!
- // Particle System settings
+ // Particle Sistema settings
PartSys->updateSystem(); // update system properties (dimensions and data pointers)
PartSys->setColorByPosition(SEGMENT.check3);
PartSys->setMotionBlur(7 + ((SEGMENT.custom3) << 3)); // anable motion blur
@@ -10158,7 +10158,7 @@ uint16_t mode_particleChase(void) {
huestep = 1 + (max((int)huestep, 3) * ((int(sin16_t(strip.now * 3) + 32767))) >> 15); // changes gradient spread (scale hue step)
}
- // wrap around (cannot use particle system wrap if distributing colors manually, it also wraps rendering which does not look good)
+ // wrap around (cannot use particle sistema wrap if distributing colors manually, it also wraps rendering which does not look good)
for (int32_t i = (int32_t)PartSys->usedParticles - 1; i >= 0; i--) { // check from the back, last particle wraps first, multiple particles can overrun per frame
if (PartSys->particles[i].x > PartSys->maxX + PS_P_RADIUS_1D + PartSys->advPartProps[i].size) { // wrap it around
uint32_t nextindex = (i + 1) % PartSys->usedParticles;
@@ -10226,7 +10226,7 @@ uint16_t mode_particleStarburst(void) {
if (PartSys == nullptr)
return mode_static(); // something went wrong, no data!
- // Particle System settings
+ // Particle Sistema settings
PartSys->updateSystem(); // update system properties (dimensions and data pointers)
PartSys->setMotionBlur(SEGMENT.custom2); // anable motion blur
PartSys->setGravity(SEGMENT.check1 * 8); // enable gravity
@@ -10266,7 +10266,7 @@ uint16_t mode_particleStarburst(void) {
static const char _data_FX_MODE_PS_STARBURST[] PROGMEM = "PS Starburst@Chance,Fragments,Size,Blur,Cooling,Gravity,Colorful,Push;,!;!;1;pal=52,sx=150,ix=150,c1=120,c2=0,c3=21";
/*
- Particle based 1D GEQ effect, each frequency bin gets an emitter, distributed over the strip
+ Particle based 1D GEQ efecto, each frecuencia bin gets an emitter, distributed over the tira
Uses palette for particle color
by DedeHai (Damian Schneider)
*/
@@ -10284,7 +10284,7 @@ uint16_t mode_particle1DGEQ(void) {
if (PartSys == nullptr)
return mode_static(); // something went wrong, no data!
- // Particle System settings
+ // Particle Sistema settings
PartSys->updateSystem(); // update system properties (dimensions and data pointers)
numSources = PartSys->numSources;
PartSys->setMotionBlur(SEGMENT.custom2); // anable motion blur
@@ -10308,7 +10308,7 @@ uint16_t mode_particle1DGEQ(void) {
um_data_t *um_data = getAudioData();
uint8_t *fftResult = (uint8_t *)um_data->u_data[2]; // 16 bins with FFT data, log mapped already, each band contains frequency amplitude 0-255
- //map the bands into 16 positions on x axis, emit some particles according to frequency loudness
+ //map the bands into 16 positions on x axis, emit some particles according to frecuencia loudness
i = 0;
uint32_t bin = hw_random16(numSources); //current bin , start with random one to distribute available particles fairly
uint32_t threshold = 300 - SEGMENT.intensity;
@@ -10317,7 +10317,7 @@ uint16_t mode_particle1DGEQ(void) {
bin++;
bin = bin % numSources;
uint32_t emitparticle = 0;
- // uint8_t emitspeed = ((uint32_t)fftResult[bin] * (uint32_t)SEGMENT.speed) >> 10; // emit speed according to loudness of band (127 max!)
+ // uint8_t emitspeed = ((uint32_t)fftResult[bin] * (uint32_t)SEGMENTO.velocidad) >> 10; // emit velocidad according to loudness of band (127 max!)
if (fftResult[bin] > threshold) {
emitparticle = 1;
}
@@ -10340,7 +10340,7 @@ uint16_t mode_particle1DGEQ(void) {
static const char _data_FX_MODE_PS_1D_GEQ[] PROGMEM = "PS GEQ 1D@Speed,!,Size,Blur,,,,;,!;!;1f;pal=0,sx=50,ix=200,c1=0,c2=0,c3=0,o1=1,o2=1";
/*
- Particle based Fire effect
+ Particle based Fire efecto
Uses palette for particle color
by DedeHai (Damian Schneider)
*/
@@ -10358,7 +10358,7 @@ uint16_t mode_particleFire1D(void) {
if (PartSys == nullptr)
return mode_static(); // something went wrong, no data!
- // Particle System settings
+ // Particle Sistema settings
PartSys->updateSystem(); // update system properties (dimensions and data pointers)
PartSys->setMotionBlur(128 + (SEGMENT.custom2 >> 1)); // enable motion blur
PartSys->setColorByAge(true);
@@ -10406,7 +10406,7 @@ uint16_t mode_particleFire1D(void) {
static const char _data_FX_MODE_PS_FIRE1D[] PROGMEM = "PS Fire 1D@!,!,Cooling,Blur;,!;!;1;pal=35,sx=100,ix=50,c1=80,c2=100,c3=28,o1=1,o2=1";
/*
- Particle based AR effect, swoop particles along the strip with selected frequency loudness
+ Particle based AR efecto, swoop particles along the tira with selected frecuencia loudness
by DedeHai (Damian Schneider)
*/
uint16_t mode_particle1DsonicStream(void) {
@@ -10425,7 +10425,7 @@ uint16_t mode_particle1DsonicStream(void) {
if (PartSys == nullptr)
return mode_static(); // something went wrong, no data!
- // Particle System settings
+ // Particle Sistema settings
PartSys->updateSystem(); // update system properties (dimensions and data pointers)
PartSys->setMotionBlur(20 + (SEGMENT.custom2 >> 1)); // anable motion blur
PartSys->setSmearBlur(200); // smooth out the edges
@@ -10510,7 +10510,7 @@ static const char _data_FX_MODE_PS_SONICSTREAM[] PROGMEM = "PS Sonic Stream@!,!,
/*
- Particle based AR effect, creates exploding particles on beats
+ Particle based AR efecto, creates exploding particles on beats
by DedeHai (Damian Schneider)
*/
uint16_t mode_particle1DsonicBoom(void) {
@@ -10525,7 +10525,7 @@ uint16_t mode_particle1DsonicBoom(void) {
if (PartSys == nullptr)
return mode_static(); // something went wrong, no data!
- // Particle System settings
+ // Particle Sistema settings
PartSys->updateSystem(); // update system properties (dimensions and data pointers)
PartSys->setMotionBlur(180 * SEGMENT.check3);
PartSys->setSmearBlur(64 * SEGMENT.check3);
@@ -10559,7 +10559,7 @@ uint16_t mode_particle1DsonicBoom(void) {
if (loudness > threshold) {
if (SEGMENT.aux1 == 0) { // edge detected, code only runs once per "beat"
- // update position
+ // actualizar posición
if (SEGMENT.custom2 < 128) // fixed position
PartSys->sources[0].source.x = map(SEGMENT.custom2, 0, 127, 0, PartSys->maxX);
else if (SEGMENT.custom2 < 255) { // advances on each "beat"
@@ -10571,8 +10571,8 @@ uint16_t mode_particle1DsonicBoom(void) {
else // position set to max, use random postion per beat
PartSys->sources[0].source.x = hw_random(PartSys->maxX);
- // update color
- //PartSys->setColorByPosition(SEGMENT.custom1 == 255); // color slider at max: particle color by position
+ // actualizar color
+ //PartSys->setColorByPosition(SEGMENTO.custom1 == 255); // color slider at max: particle color by posición
PartSys->sources[0].sat = SEGMENT.custom1 > 0 ? 255 : 0; // color slider at zero: set to white
if (SEGMENT.custom1 == 255) // emit color by position
SEGMENT.aux0 = map(PartSys->sources[0].source.x , 0, PartSys->maxX, 0, 255);
@@ -10614,12 +10614,12 @@ uint16_t mode_particleSpringy(void) {
PartSys = reinterpret_cast(SEGENV.data); // if not first call, just set the pointer to the PS
if (PartSys == nullptr)
return mode_static(); // something went wrong, no data!
- // Particle System settings
+ // Particle Sistema settings
PartSys->updateSystem(); // update system properties (dimensions and data pointers)
PartSys->setMotionBlur(220 * SEGMENT.check1); // anable motion blur
PartSys->setSmearBlur(50); // smear a little
PartSys->setUsedParticles(map(SEGMENT.custom1, 0, 255, 30 >> SEGMENT.check2, 255 >> (SEGMENT.check2*2))); // depends on density and particle size
- // PartSys->enableParticleCollisions(true, 140); // enable particle collisions, can not be set too hard or impulses will not strech the springs if soft.
+ // PartSys->enableParticleCollisions(verdadero, 140); // habilitar particle collisions, can not be set too hard or impulses will not strech the springs if soft.
int32_t springlength = PartSys->maxX / (PartSys->usedParticles); // spring length (spacing between particles)
int32_t springK = map(SEGMENT.speed, 0, 255, 5, 35); // spring constant (stiffness)
@@ -10627,9 +10627,9 @@ uint16_t mode_particleSpringy(void) {
if (SEGENV.aux0 != settingssum) { // number of particles changed, update distribution
for (int32_t i = 0; i < (int32_t)PartSys->usedParticles; i++) {
PartSys->advPartProps[i].sat = 255; // full saturation
- //PartSys->particleFlags[i].collide = true; // enable collision for particles
+ //PartSys->particleFlags[i].collide = verdadero; // habilitar collision for particles
PartSys->particles[i].x = (i+1) * ((PartSys->maxX) / (PartSys->usedParticles)); // distribute
- //PartSys->particles[i].vx = 0; //reset speed
+ //PartSys->particles[i].vx = 0; //restablecer velocidad
PartSys->advPartProps[i].size = SEGMENT.check2 ? 190 : 2; // set size, small or big
}
SEGENV.aux0 = settingssum;
@@ -10639,7 +10639,7 @@ uint16_t mode_particleSpringy(void) {
int springforce[PartSys->usedParticles]; // spring forces
memset(springforce, 0, PartSys->usedParticles * sizeof(int32_t)); // reset spring forces
- // calculate spring forces and limit particle positions
+ // calculate spring forces and límite particle positions
if (PartSys->particles[0].x < -springlength)
PartSys->particles[0].x = -springlength; // limit the spring length
else if (PartSys->particles[0].x > dxlimit)
@@ -10683,7 +10683,7 @@ uint16_t mode_particleSpringy(void) {
if (SEGMENT.call % ((65 - ((SEGMENT.intensity * (1 + (SEGMENT.speed>>3))) >> 7))) == 0) // more damping for higher stiffness
PartSys->applyFriction((SEGMENT.intensity >> 2));
- // add a small resetting force so particles return to resting position even under high damping
+ // add a small resetting force so particles retorno to resting posición even under high damping
for (uint32_t i = 1; i < PartSys->usedParticles - 1; i++) {
int restposition = (springlength >> 1) + i * springlength; // resting position
int dx = restposition - PartSys->particles[i].x; // distance, always positive
@@ -10717,12 +10717,12 @@ uint16_t mode_particleSpringy(void) {
int index = (SEGMENT.custom3 > 20) ? (PartSys->usedParticles / 2) : 0; // center or start particle
int restposition = 0;
if (index > 0) restposition = PartSys->maxX >> 1; // center
- //int amplitude = 5 + (SEGMENT.speed >> 3) + (SEGMENT.custom1 >> 2); // amplitude depends on density
+ //int amplitude = 5 + (SEGMENTO.velocidad >> 3) + (SEGMENTO.custom1 >> 2); // amplitude depends on density
int amplitude = 5 + (SEGMENT.custom1 >> 2); // amplitude depends on density
int speed = SEGMENT.custom3 - 10 - (index ? 10 : 0); // map 11-20 and 21-30 to 1-10
int phase = strip.now * ((1 + (SEGMENT.speed >> 4)) * speed);
if (SEGMENT.check2) amplitude <<= 1; // double amplitude for XL particles
- //PartSys->applyForce(PartSys->particles[index], (sin16_t(phase) * amplitude) >> 15, PartSys->advPartProps[index].forcecounter); // apply acceleration
+ //PartSys->applyForce(PartSys->particles[índice], (sin16_t(phase) * amplitude) >> 15, PartSys->advPartProps[índice].forcecounter); // apply acceleration
PartSys->particles[index].x = restposition + ((sin16_t(phase) * amplitude) >> 12); // apply position
}
else {
@@ -10737,7 +10737,7 @@ uint16_t mode_particleSpringy(void) {
for (uint32_t i = 0; i < PartSys->usedParticles; i++) {
if (SEGMENT.custom2 == 255) { // map speed to hue
int speedclr = ((int8_t(abs(PartSys->particles[i].vx))) >> 2) << 4; // scale for greater color variation, dump small values to avoid flickering
- //int speed = PartSys->particles[i].vx << 2; // +/- 512
+ //int velocidad = PartSys->particles[i].vx << 2; // +/- 512
if (speedclr > 240) speedclr = 240; // limit color to non-wrapping part of palette
PartSys->particles[i].hue = speedclr;
}
@@ -10770,13 +10770,13 @@ static const char _data_FX_MODE_PS_SPRINGY[] PROGMEM = "PS Springy@Stiffness,Dam
#endif // WLED_DISABLE_PARTICLESYSTEM1D
//////////////////////////////////////////////////////////////////////////////////////////
-// mode data
+// mode datos
static const char _data_RESERVED[] PROGMEM = "RSVD";
-// add (or replace reserved) effect mode and data into vector
-// use id==255 to find unallocated gaps (with "Reserved" data string)
-// if vector size() is smaller than id (single) data is appended at the end (regardless of id)
-// return the actual id used for the effect or 255 if the add failed.
+// add (or reemplazar reserved) efecto mode and datos into vector
+// use id==255 to encontrar unallocated gaps (with "Reserved" datos cadena)
+// if vector tamaño() is smaller than id (single) datos is appended at the end (regardless of id)
+// retorno the actual id used for the efecto or 255 if the add failed.
uint8_t WS2812FX::addEffect(uint8_t id, mode_ptr mode_fn, const char *mode_name) {
if (id == 255) { // find empty slot
for (size_t i=1; i<_mode.size(); i++) if (_modeData[i] == _data_RESERVED) { id = i; break; }
@@ -10797,15 +10797,15 @@ uint8_t WS2812FX::addEffect(uint8_t id, mode_ptr mode_fn, const char *mode_name)
}
void WS2812FX::setupEffectData() {
- // Solid must be first! (assuming vector is empty upon call to setup)
+ // Solid must be first! (assuming vector is empty upon call to configuración)
_mode.push_back(&mode_static);
_modeData.push_back(_data_FX_MODE_STATIC);
- // fill reserved word in case there will be any gaps in the array
+ // fill reserved palabra in case there will be any gaps in the matriz
for (size_t i=1; i<_modeCount; i++) {
_mode.push_back(&mode_static);
_modeData.push_back(_data_RESERVED);
}
- // now replace all pre-allocated effects
+ // now reemplazar all pre-allocated effects
addEffect(FX_MODE_COPY, &mode_copy_segment, _data_FX_MODE_COPY);
// --- 1D non-audio effects ---
addEffect(FX_MODE_BLINK, &mode_blink, _data_FX_MODE_BLINK);
diff --git a/wled00/FX.h b/wled00/FX.h
index 250df2646d..6ffa8836a2 100644
--- a/wled00/FX.h
+++ b/wled00/FX.h
@@ -1,16 +1,16 @@
#pragma once
/*
- WS2812FX.h - Library for WS2812 LED effects.
+ WS2812FX.h - Biblioteca for WS2812 LED effects.
Harm Aldick - 2016
www.aldick.org
Copyright (c) 2016 Harm Aldick
Licensed under the EUPL v. 1.2 or later
- Adapted from code originally licensed under the MIT license
+ Adapted from código originally licensed under the MIT license
Modified for WLED
- Segment class/struct (c) 2022 Blaz Kristan (@blazoncek)
+ Segmento clase/estructura (c) 2022 Blaz Kristan (@blazoncek)
*/
#ifndef WS2812FX_h
@@ -20,7 +20,7 @@
#include "wled.h"
#ifdef WLED_DEBUG
- // enable additional debug output
+ // habilitar additional depuración salida
#if defined(WLED_DEBUG_HOST)
#include "net_debug.h"
#define DEBUGOUT NetDebug
@@ -79,7 +79,7 @@ extern byte realtimeMode; // used in getMappedPixelIndex()
#endif
#define FPS_UNLIMITED 0
-// FPS calculation (can be defined as compile flag for debugging)
+// FPS cálculo (can be defined as compile bandera for debugging)
#ifndef FPS_CALC_AVG
#define FPS_CALC_AVG 7 // average FPS calculation over this many frames (moving average)
#endif
@@ -88,10 +88,10 @@ extern byte realtimeMode; // used in getMappedPixelIndex()
#endif
#define FPS_CALC_SHIFT 7 // bit shift for fixed point math
-// heap memory limit for effects data, pixel buffers try to reserve it if PSRAM is available
+// montón memoria límite for effects datos, píxel buffers try to reserve it if PSRAM is available
#ifdef ESP8266
#define MAX_NUM_SEGMENTS 16
- /* How much data bytes all segments combined may allocate */
+ /* How much datos bytes all segments combined may allocate */
#define MAX_SEGMENT_DATA (6*1024) // 6k by default
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
#define MAX_NUM_SEGMENTS 32
@@ -105,13 +105,13 @@ extern byte realtimeMode; // used in getMappedPixelIndex()
#define MAX_SEGMENT_DATA (64*1024) // 64k by default, limit does not apply if PSRAM is available
#endif
-/* How much data bytes each segment should max allocate to leave enough space for other segments,
- assuming each segment uses the same amount of data. 256 for ESP8266, 640 for ESP32. */
+/* How much datos bytes each segmento should max allocate to leave enough space for other segments,
+ assuming each segmento uses the same amount of datos. 256 for ESP8266, 640 for ESP32. */
#define FAIR_DATA_PER_SEG (MAX_SEGMENT_DATA / MAX_NUM_SEGMENTS)
#define MIN_SHOW_DELAY (_frametime < 16 ? 8 : 15)
-#define NUM_COLORS 3 /* number of colors per segment */
+#define NUM_COLORS 3 /* number of colors per segmento */
#define SEGMENT (*strip._currentSegment)
#define SEGENV (*strip._currentSegment)
#define SEGCOLOR(x) Segment::getCurrentColor(x)
@@ -141,7 +141,7 @@ extern byte realtimeMode; // used in getMappedPixelIndex()
#define DARKSLATEGRAY (uint32_t)0x2F4F4F
#define DARKSLATEGREY DARKSLATEGRAY
-// segment options
+// segmento options
#define NO_OPTIONS (uint16_t)0x0000
#define TRANSPOSED (uint16_t)0x0100 // rotated 90deg & reversed
#define MIRROR_Y_2D (uint16_t)0x0080
@@ -230,7 +230,7 @@ extern byte realtimeMode; // used in getMappedPixelIndex()
#define FX_MODE_COLORTWINKLE 74
#define FX_MODE_LAKE 75
#define FX_MODE_METEOR 76
-//#define FX_MODE_METEOR_SMOOTH 77 // replaced by Meteor
+//#definir FX_MODE_METEOR_SMOOTH 77 // replaced by Meteor
#define FX_MODE_COPY 77
#define FX_MODE_RAILWAY 78
#define FX_MODE_RIPPLE 79
@@ -309,7 +309,7 @@ extern byte realtimeMode; // used in getMappedPixelIndex()
#define FX_MODE_RIPPLEPEAK 148
#define FX_MODE_2DFIRENOISE 149
#define FX_MODE_2DSQUAREDSWIRL 150
-// #define FX_MODE_2DFIRE2012 151
+// #definir FX_MODE_2DFIRE2012 151
#define FX_MODE_2DDNA 152
#define FX_MODE_2DMATRIX 153
#define FX_MODE_2DMETABALLS 154
@@ -319,7 +319,7 @@ extern byte realtimeMode; // used in getMappedPixelIndex()
#define FX_MODE_GRAVFREQ 158
#define FX_MODE_DJLIGHT 159
#define FX_MODE_2DFUNKYPLANK 160
-//#define FX_MODE_2DCENTERBARS 161
+//#definir FX_MODE_2DCENTERBARS 161
#define FX_MODE_SHIMMER 161 // gap fill, non SR 1D effect
#define FX_MODE_2DPULSER 162
#define FX_MODE_BLURZ 163
@@ -328,9 +328,9 @@ extern byte realtimeMode; // used in getMappedPixelIndex()
#define FX_MODE_2DSUNRADIATION 166
#define FX_MODE_2DCOLOREDBURSTS 167
#define FX_MODE_2DJULIA 168
-// #define FX_MODE_2DPOOLNOISE 169 //have been removed in WLED SR in the past because of low mem but should be added back
-// #define FX_MODE_2DTWISTER 170 //have been removed in WLED SR in the past because of low mem but should be added back
-// #define FX_MODE_2DCAELEMENTATY 171 //have been removed in WLED SR in the past because of low mem but should be added back
+// #definir FX_MODE_2DPOOLNOISE 169 //have been removed in WLED SR in the past because of low mem but should be added back
+// #definir FX_MODE_2DTWISTER 170 //have been removed in WLED SR in the past because of low mem but should be added back
+// #definir FX_MODE_2DCAELEMENTATY 171 //have been removed in WLED SR in the past because of low mem but should be added back
#define FX_MODE_2DGAMEOFLIFE 172
#define FX_MODE_2DTARTAN 173
#define FX_MODE_2DPOLARLIGHTS 174
@@ -397,7 +397,7 @@ extern byte realtimeMode; // used in getMappedPixelIndex()
#define BLEND_STYLE_SWIPE_BL 0x0D // 2D
#define BLEND_STYLE_CIRCULAR_OUT 0x0E // 2D
#define BLEND_STYLE_CIRCULAR_IN 0x0F // 2D
-// as there are many push variants to optimise if statements they are groupped together
+// as there are many enviar variants to optimise if statements they are groupped together
#define BLEND_STYLE_PUSH_RIGHT 0x10 // 1D or 2D (& 0b00010000)
#define BLEND_STYLE_PUSH_LEFT 0x11 // 1D or 2D (& 0b00010000)
#define BLEND_STYLE_PUSH_UP 0x12 // 2D (& 0b00010000)
@@ -420,7 +420,7 @@ typedef enum mapping1D2D {
class WS2812FX;
-// segment, 76 bytes
+// segmento, 76 bytes
class Segment {
public:
uint32_t colors[NUM_COLORS];
@@ -448,7 +448,7 @@ class Segment {
};
uint8_t grouping, spacing;
uint8_t opacity, cct; // 0==1900K, 255==10091K
- // effect data
+ // efecto datos
uint8_t mode;
uint8_t palette;
uint8_t speed;
@@ -459,12 +459,12 @@ class Segment {
bool check1 : 1; // checkmark 1
bool check2 : 1; // checkmark 2
bool check3 : 1; // checkmark 3
- //uint8_t blendMode : 4; // segment blending modes: top, bottom, add, subtract, difference, multiply, divide, lighten, darken, screen, overlay, hardlight, softlight, dodge, burn
+ //uint8_t blendMode : 4; // segmento blending modes: top, bottom, add, subtract, difference, multiply, divide, lighten, darken, screen, overlay, hardlight, softlight, dodge, burn
};
uint8_t blendMode; // segment blending modes: top, bottom, add, subtract, difference, multiply, divide, lighten, darken, screen, overlay, hardlight, softlight, dodge, burn
char *name; // segment name
- // runtime data
+ // runtime datos
mutable unsigned long next_time; // millis() of next update
mutable uint32_t step; // custom "step" var
mutable uint32_t call; // call counter
@@ -488,7 +488,7 @@ class Segment {
};
};
- // static variables are use to speed up effect calculations by stashing common pre-calculated values
+ // estático variables are use to velocidad up efecto calculations by stashing common pre-calculated values
static unsigned _usedSegmentData; // amount of data used by all segments
static unsigned _vLength; // 1D dimension used for current effect
static unsigned _vWidth, _vHeight; // 2D dimensions used for current effect
@@ -503,7 +503,7 @@ class Segment {
static uint16_t _clipStart, _clipStop;
static uint8_t _clipStartY, _clipStopY;
- // transition data, holds values during transition (76 bytes/28 bytes)
+ // transición datos, holds values during transición (76 bytes/28 bytes)
struct Transition {
Segment *_oldSegment; // previous segment environment (may be nullptr if effect did not change)
unsigned long _start; // must accommodate millis()
@@ -530,7 +530,7 @@ class Segment {
, _cct(0)
{}
~Transition() {
- //DEBUGFX_PRINTF_P(PSTR("-- Destroying transition: %p\n"), this);
+ //DEBUGFX_PRINTF_P(PSTR("-- Destroying transición: %p\n"), this);
if (_oldSegment) delete _oldSegment;
}
} *_t;
@@ -549,7 +549,7 @@ class Segment {
void resetIfRequired(); // sets all SEGENV variables to 0 and clears data buffer
CRGBPalette16 &loadPalette(CRGBPalette16 &tgt, uint8_t pal);
- // transition functions
+ // transición functions
void stopTransition(); // ends transition mode by destroying transition structure (does nothing if not in transition)
void updateTransitionProgress() const; // sets transition progress (0-65535) based on time passed since transition start
inline void handleTransition() {
@@ -603,7 +603,7 @@ class Segment {
, _t(nullptr)
{
DEBUGFX_PRINTF_P(PSTR("-- Creating segment: %p [%d,%d:%d,%d]\n"), this, (int)start, (int)stop, (int)startY, (int)stopY);
- // allocate render buffer (always entire segment), prefer PSRAM if DRAM is running low. Note: impact on FPS with PSRAM buffer is low (<2% with QSPI PSRAM)
+ // allocate renderizar búfer (always entire segmento), prefer PSRAM if DRAM is running low. Note: impact on FPS with PSRAM búfer is low (<2% with QSPI PSRAM)
pixels = static_cast(allocate_buffer(length() * sizeof(uint32_t), BFRALLOC_PREFER_PSRAM | BFRALLOC_NOBYTEACCESS | BFRALLOC_CLEAR));
if (!pixels) {
DEBUGFX_PRINTLN(F("!!! Not enough RAM for pixel buffer !!!"));
@@ -674,16 +674,16 @@ class Segment {
Segment &setName(const char* name);
void refreshLightCapabilities() const;
- // runtime data functions
+ // runtime datos functions
inline uint16_t dataSize() const { return _dataLen; }
bool allocateData(size_t len); // allocates effect data buffer in heap and clears it
void deallocateData(); // deallocates (frees) effect data buffer from heap
inline static unsigned getUsedSegmentData() { return Segment::_usedSegmentData; }
/**
- * Flags that before the next effect is calculated,
- * the internal segment state should be reset.
- * Call resetIfRequired before calling the next effect function.
- * Safe to call from interrupts and network requests.
+ * Flags that before the next efecto is calculated,
+ * the internal segmento estado should be restablecer.
+ * Call resetIfRequired before calling the next efecto función.
+ * Safe to call from interrupts and red requests.
*/
inline Segment &markForReset() { reset = true; return *this; } // setOption(SEG_OPTION_RESET, true)
@@ -691,7 +691,7 @@ class Segment {
uint8_t currentCCT() const; // current segment's CCT (blended while in transition)
uint8_t currentBri() const; // current segment's opacity/brightness (blended while in transition)
- // 1D strip
+ // 1D tira
uint16_t virtualLength() const;
uint16_t maxMappingLength() const;
[[gnu::hot]] void setPixelColor(int n, uint32_t c) const; // set relative pixel within segment with color
@@ -763,7 +763,7 @@ class Segment {
inline void fadePixelColorXY(uint16_t x, uint16_t y, uint8_t fade) const { setPixelColorXY(x, y, color_fade(getPixelColorXY(x,y), fade, true)); }
inline void blurCols(fract8 blur_amount, bool smear = false) const { blur2D(0, blur_amount, smear); } // blur all columns (50% faster than full 2D blur)
inline void blurRows(fract8 blur_amount, bool smear = false) const { blur2D(blur_amount, 0, smear); } // blur all rows (50% faster than full 2D blur)
- //void box_blur(unsigned r = 1U, bool smear = false); // 2D box blur
+ //void box_blur(unsigned r = 1U, bool smear = falso); // 2D box blur
void blur2D(uint8_t blur_x, uint8_t blur_y, bool smear = false) const;
void moveX(int delta, bool wrap = false) const;
void moveY(int delta, bool wrap = false) const;
@@ -798,7 +798,7 @@ class Segment {
inline void addPixelColorXY(int x, int y, byte r, byte g, byte b, byte w = 0, bool saturate = false) const { addPixelColor(x, RGBW32(r,g,b,w), saturate); }
inline void addPixelColorXY(int x, int y, CRGB c, bool saturate = false) const { addPixelColor(x, RGBW32(c.r,c.g,c.b,0), saturate); }
inline void fadePixelColorXY(uint16_t x, uint16_t y, uint8_t fade) const { fadePixelColor(x, fade); }
- //inline void box_blur(unsigned i, bool vertical, fract8 blur_amount) {}
+ //en línea void box_blur(unsigned i, bool vertical, fract8 blur_amount) {}
inline void blur2D(uint8_t blur_x, uint8_t blur_y, bool smear = false) {}
inline void blurCols(fract8 blur_amount, bool smear = false) { blur(blur_amount, smear); } // blur all columns (50% faster than full 2D blur)
inline void blurRows(fract8 blur_amount, bool smear = false) {}
@@ -820,7 +820,7 @@ class Segment {
friend class ParticleSystem1D;
};
-// main "strip" class (108 bytes)
+// principal "tira" clase (108 bytes)
class WS2812FX {
typedef uint16_t (*mode_ptr)(); // pointer to mode function
typedef void (*show_callback)(); // pre show callback
@@ -845,7 +845,7 @@ class WS2812FX {
#endif
correctWB(false),
cctFromRgb(false),
- // true private variables
+ // verdadero private variables
_pixels(nullptr),
_pixelCCT(nullptr),
_suspend(false),
diff --git a/wled00/FX_2Dfcn.cpp b/wled00/FX_2Dfcn.cpp
index 063d3a6bb3..2cd4df729c 100644
--- a/wled00/FX_2Dfcn.cpp
+++ b/wled00/FX_2Dfcn.cpp
@@ -3,21 +3,21 @@
Copyright (c) 2022 Blaz Kristan (https://blaz.at/home)
Licensed under the EUPL v. 1.2 or later
- Adapted from code originally licensed under the MIT license
+ Adapted from código originally licensed under the MIT license
- Parts of the code adapted from WLED Sound Reactive
+ Parts of the código adapted from WLED Sound Reactive
*/
#include "wled.h"
-// setUpMatrix() - constructs ledmap array from matrix of panels with WxH pixels
+// setUpMatrix() - constructs ledmap matriz from matrix of panels with WxH pixels
// this converts physical (possibly irregular) LED arrangement into well defined
-// array of logical pixels: fist entry corresponds to left-topmost logical pixel
-// followed by horizontal pixels, when Segment::maxWidth logical pixels are added they
-// are followed by next row (down) of Segment::maxWidth pixels (and so forth)
+// matriz of logical pixels: fist entry corresponds to left-topmost logical píxel
+// followed by horizontal pixels, when Segmento::maxWidth logical pixels are added they
+// are followed by next row (down) of Segmento::maxWidth pixels (and so forth)
// note: matrix may be comprised of multiple panels each with different orientation
// but ledmap takes care of that. ledmap is constructed upon initialization
-// so matrix should disable regular ledmap processing
-// WARNING: effect drawing has to be suspended (strip.suspend()) or must be called from loop() context
+// so matrix should deshabilitar regular ledmap processing
+// ADVERTENCIA: efecto drawing has to be suspended (tira.suspend()) or must be called from bucle() contexto
void WS2812FX::setUpMatrix() {
#ifndef WLED_DISABLE_2D
// isMatrix is set in cfg.cpp or set.cpp
@@ -34,7 +34,7 @@ void WS2812FX::setUpMatrix() {
}
}
- // safety check
+ // safety verificar
if (Segment::maxWidth * Segment::maxHeight > MAX_LEDS || Segment::maxWidth > 255 || Segment::maxHeight > 255 || Segment::maxWidth <= 1 || Segment::maxHeight <= 1) {
DEBUG_PRINTLN(F("2D Bounds error."));
isMatrix = false;
@@ -49,9 +49,9 @@ void WS2812FX::setUpMatrix() {
customMappingSize = 0; // prevent use of mapping if anything goes wrong
d_free(customMappingTable);
- // Segment::maxWidth and Segment::maxHeight are set according to panel layout
- // and the product will include at least all leds in matrix
- // if actual LEDs are more, getLengthTotal() will return correct number of LEDs
+ // Segmento::maxWidth and Segmento::maxHeight are set according to panel layout
+ // and the product will incluir at least all leds in matrix
+ // if actual LEDs are more, getLengthTotal() will retorno correct number of LEDs
customMappingTable = static_cast(d_malloc(sizeof(uint16_t)*getLengthTotal())); // prefer to not use SPI RAM
if (customMappingTable) {
@@ -62,13 +62,13 @@ void WS2812FX::setUpMatrix() {
for (unsigned i = 0; ias();
gapSize = map.size();
if (!map.isNull() && gapSize >= matrixSize) { // not an empty map
@@ -112,7 +112,7 @@ void WS2812FX::setUpMatrix() {
}
}
- // delete gap array as we no longer need it
+ // eliminar gap matriz as we no longer need it
p_free(gapTable);
#ifdef WLED_DEBUG
@@ -139,12 +139,12 @@ void WS2812FX::setUpMatrix() {
///////////////////////////////////////////////////////////
-// Segment:: routines
+// Segmento:: routines
///////////////////////////////////////////////////////////
#ifndef WLED_DISABLE_2D
-// pixel is clipped if it falls outside clipping range
-// if clipping start > stop the clipping range is inverted
+// píxel is clipped if it falls outside clipping rango
+// if clipping iniciar > detener the clipping rango is inverted
bool Segment::isPixelXYClipped(int x, int y) const {
if (blendingStyle != BLEND_STYLE_FADE && isInTransition() && _clipStart != _clipStop) {
const bool invertX = _clipStart > _clipStop;
@@ -190,7 +190,7 @@ void IRAM_ATTR_YN Segment::setPixelColorXY(int x, int y, uint32_t col) const
}
#ifdef WLED_USE_AA_PIXELS
-// anti-aliased version of setPixelColorXY()
+// anti-aliased versión of setPixelColorXY()
void Segment::setPixelColorXY(float x, float y, uint32_t col, bool aa) const
{
if (!isActive()) return; // not active
@@ -232,7 +232,7 @@ void Segment::setPixelColorXY(float x, float y, uint32_t col, bool aa) const
}
#endif
-// returns RGBW values of pixel
+// returns RGBW values of píxel
uint32_t IRAM_ATTR_YN Segment::getPixelColorXY(int x, int y) const {
if (!isActive()) return 0; // not active
if ((unsigned)x >= vWidth() || (unsigned)y >= vHeight()) return 0; // if pixel would fall out of virtual segment just exit
@@ -249,7 +249,7 @@ void Segment::blur2D(uint8_t blur_x, uint8_t blur_y, bool smear) const {
const uint8_t keepx = smear ? 255 : 255 - blur_x;
const uint8_t seepx = blur_x >> 1;
for (unsigned row = 0; row < rows; row++) { // blur rows (x direction)
- // handle first pixel in row to avoid conditional in loop (faster)
+ // handle first píxel in row to avoid conditional in bucle (faster)
uint32_t cur = getPixelColorRaw(XY(0, row));
uint32_t carryover = fast_color_scale(cur, seepx);
setPixelColorRaw(XY(0, row), fast_color_scale(cur, keepx));
@@ -268,7 +268,7 @@ void Segment::blur2D(uint8_t blur_x, uint8_t blur_y, bool smear) const {
const uint8_t keepy = smear ? 255 : 255 - blur_y;
const uint8_t seepy = blur_y >> 1;
for (unsigned col = 0; col < cols; col++) {
- // handle first pixel in column
+ // handle first píxel in column
uint32_t cur = getPixelColorRaw(XY(col, 0));
uint32_t carryover = fast_color_scale(cur, seepy);
setPixelColorRaw(XY(col, 0), fast_color_scale(cur, keepy));
@@ -287,12 +287,12 @@ void Segment::blur2D(uint8_t blur_x, uint8_t blur_y, bool smear) const {
/*
// 2D Box blur
-void Segment::box_blur(unsigned radius, bool smear) {
- if (!isActive() || radius == 0) return; // not active
+void Segmento::box_blur(unsigned radius, bool smear) {
+ if (!isActive() || radius == 0) retorno; // not active
if (radius > 3) radius = 3;
- const unsigned d = (1 + 2*radius) * (1 + 2*radius); // averaging divisor
- const unsigned cols = vWidth();
- const unsigned rows = vHeight();
+ constante unsigned d = (1 + 2*radius) * (1 + 2*radius); // averaging divisor
+ constante unsigned cols = vWidth();
+ constante unsigned rows = vHeight();
uint16_t *tmpRSum = new uint16_t[cols*rows];
uint16_t *tmpGSum = new uint16_t[cols*rows];
uint16_t *tmpBSum = new uint16_t[cols*rows];
@@ -300,34 +300,34 @@ void Segment::box_blur(unsigned radius, bool smear) {
// fill summed-area table (https://en.wikipedia.org/wiki/Summed-area_table)
for (unsigned x = 0; x < cols; x++) {
unsigned rS, gS, bS, wS;
- unsigned index;
+ unsigned índice;
rS = gS = bS = wS = 0;
for (unsigned y = 0; y < rows; y++) {
- index = x * cols + y;
+ índice = x * cols + y;
if (x > 0) {
unsigned index2 = (x - 1) * cols + y;
- tmpRSum[index] = tmpRSum[index2];
- tmpGSum[index] = tmpGSum[index2];
- tmpBSum[index] = tmpBSum[index2];
- tmpWSum[index] = tmpWSum[index2];
+ tmpRSum[índice] = tmpRSum[index2];
+ tmpGSum[índice] = tmpGSum[index2];
+ tmpBSum[índice] = tmpBSum[index2];
+ tmpWSum[índice] = tmpWSum[index2];
} else {
- tmpRSum[index] = 0;
- tmpGSum[index] = 0;
- tmpBSum[index] = 0;
- tmpWSum[index] = 0;
+ tmpRSum[índice] = 0;
+ tmpGSum[índice] = 0;
+ tmpBSum[índice] = 0;
+ tmpWSum[índice] = 0;
}
uint32_t c = getPixelColorXY(x, y);
rS += R(c);
gS += G(c);
bS += B(c);
wS += W(c);
- tmpRSum[index] += rS;
- tmpGSum[index] += gS;
- tmpBSum[index] += bS;
- tmpWSum[index] += wS;
+ tmpRSum[índice] += rS;
+ tmpGSum[índice] += gS;
+ tmpBSum[índice] += bS;
+ tmpWSum[índice] += wS;
}
}
- // do a box blur using pre-calculated sums
+ // do a box blur usando pre-calculated sums
for (unsigned x = 0; x < cols; x++) {
for (unsigned y = 0; y < rows; y++) {
// sum = D + A - B - C where k = (x,y)
@@ -353,10 +353,10 @@ void Segment::box_blur(unsigned radius, bool smear) {
setPixelColorXY(x, y, RGBW32(r/d, g/d, b/d, w/d));
}
}
- delete[] tmpRSum;
- delete[] tmpGSum;
- delete[] tmpBSum;
- delete[] tmpWSum;
+ eliminar[] tmpRSum;
+ eliminar[] tmpGSum;
+ eliminar[] tmpBSum;
+ eliminar[] tmpWSum;
}
*/
void Segment::moveX(int delta, bool wrap) const {
@@ -434,7 +434,7 @@ void Segment::move(unsigned dir, unsigned delta, bool wrap) const {
void Segment::drawCircle(uint16_t cx, uint16_t cy, uint8_t radius, uint32_t col, bool soft) const {
if (!isActive() || radius == 0) return; // not active
if (soft) {
- // Xiaolin Wu’s algorithm
+ // Xiaolin Wu’s algoritmo
const int rsq = radius*radius;
int x = 0;
int y = radius;
@@ -465,7 +465,7 @@ void Segment::drawCircle(uint16_t cx, uint16_t cy, uint8_t radius, uint32_t col,
x++;
}
} else {
- // Bresenham’s Algorithm
+ // Bresenham’s Algoritmo
int d = 3 - (2*radius);
int y = radius, x = 0;
while (y >= x) {
@@ -491,7 +491,7 @@ void Segment::fillCircle(uint16_t cx, uint16_t cy, uint8_t radius, uint32_t col,
if (!isActive() || radius == 0) return; // not active
const int vW = vWidth(); // segment width in logical pixels (can be 0 if segment is inactive)
const int vH = vHeight(); // segment height in logical pixels (is always >= 1)
- // draw soft bounding circle
+ // dibujar soft bounding circle
if (soft) drawCircle(cx, cy, radius, col, soft);
// fill it
for (int y = -radius; y <= radius; y++) {
@@ -504,7 +504,7 @@ void Segment::fillCircle(uint16_t cx, uint16_t cy, uint8_t radius, uint32_t col,
}
}
-//line function
+//line función
void Segment::drawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint32_t c, bool soft) const {
if (!isActive()) return; // not active
const int vW = vWidth(); // segment width in logical pixels (can be 0 if segment is inactive)
@@ -514,14 +514,14 @@ void Segment::drawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint3
const int dx = abs(x1-x0), sx = x0 dx;
if (steep) {
// we need to go along longest dimension
@@ -540,14 +540,14 @@ void Segment::drawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint3
uint8_t seep = 0xFF - keep; // how much background to keep
int y = int(intersectY);
if (steep) std::swap(x,y); // temporaryly swap if steep
- // pixel coverage is determined by fractional part of y co-ordinate
+ // píxel coverage is determined by fractional part of y co-ordinate
blendPixelColorXY(x, y, c, seep);
blendPixelColorXY(x+int(steep), y+int(!steep), c, keep);
intersectY += gradient;
if (steep) std::swap(x,y); // restore if steep
}
} else {
- // Bresenham's algorithm
+ // Bresenham's algoritmo
int err = (dx>dy ? dx : -dy)/2; // error direction
for (;;) {
setPixelColorXY(x0, y0, c);
@@ -565,7 +565,7 @@ void Segment::drawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint3
#include "src/font/console_font_6x8.h"
#include "src/font/console_font_7x9.h"
-// draws a raster font character on canvas
+// draws a raster font carácter on canvas
// only supports: 4x6=24, 5x8=40, 5x12=60, 6x8=48 and 7x9=63 fonts ATM
void Segment::drawCharacter(unsigned char chr, int16_t x, int16_t y, uint8_t w, uint8_t h, uint32_t color, uint32_t col2, int8_t rotate) const {
if (!isActive()) return; // not active
@@ -573,7 +573,7 @@ void Segment::drawCharacter(unsigned char chr, int16_t x, int16_t y, uint8_t w,
chr -= 32; // align with font table entries
const int font = w*h;
- // if col2 == BLACK then use currently selected palette for gradient otherwise create gradient from color and col2
+ // if col2 == BLACK then use currently selected palette for gradient otherwise crear gradient from color and col2
CRGBPalette16 grad = col2 ? CRGBPalette16(CRGB(color), CRGB(col2)) : SEGPALETTE; // selected palette as gradient
for (int i = 0; i %p\n"), &orig, this);
+ //DEBUG_PRINTF_P(PSTR("-- Copy segmento constructor: %p -> %p\n"), &orig, this);
memcpy((void*)this, (void*)&orig, sizeof(Segment));
_t = nullptr; // copied segment cannot be in transition
name = nullptr;
@@ -66,7 +66,7 @@ Segment::Segment(const Segment &orig) {
pixels = nullptr;
if (!stop) return; // nothing to do if segment is inactive/invalid
if (orig.pixels) {
- // allocate pixel buffer: prefer IRAM/PSRAM
+ // allocate píxel búfer: prefer IRAM/PSRAM
pixels = static_cast(allocate_buffer(orig.length() * sizeof(uint32_t), BFRALLOC_PREFER_PSRAM | BFRALLOC_NOBYTEACCESS));
if (pixels) {
memcpy(pixels, orig.pixels, sizeof(uint32_t) * orig.length());
@@ -82,7 +82,7 @@ Segment::Segment(const Segment &orig) {
// move constructor
Segment::Segment(Segment &&orig) noexcept {
- //DEBUG_PRINTF_P(PSTR("-- Move segment constructor: %p -> %p\n"), &orig, this);
+ //DEBUG_PRINTF_P(PSTR("-- Move segmento constructor: %p -> %p\n"), &orig, this);
memcpy((void*)this, (void*)&orig, sizeof(Segment));
orig._t = nullptr; // old segment cannot be in transition any more
orig.name = nullptr;
@@ -93,7 +93,7 @@ Segment::Segment(Segment &&orig) noexcept {
// copy assignment
Segment& Segment::operator= (const Segment &orig) {
- //DEBUG_PRINTF_P(PSTR("-- Copying segment: %p -> %p\n"), &orig, this);
+ //DEBUG_PRINTF_P(PSTR("-- Copying segmento: %p -> %p\n"), &orig, this);
if (this != &orig) {
// clean destination
if (name) { p_free(name); name = nullptr; }
@@ -102,14 +102,14 @@ Segment& Segment::operator= (const Segment &orig) {
p_free(pixels);
// copy source
memcpy((void*)this, (void*)&orig, sizeof(Segment));
- // erase pointers to allocated data
+ // erase pointers to allocated datos
data = nullptr;
_dataLen = 0;
pixels = nullptr;
if (!stop) return *this; // nothing to do if segment is inactive/invalid
- // copy source data
+ // copy source datos
if (orig.pixels) {
- // allocate pixel buffer: prefer IRAM/PSRAM
+ // allocate píxel búfer: prefer IRAM/PSRAM
pixels = static_cast(allocate_buffer(orig.length() * sizeof(uint32_t), BFRALLOC_PREFER_PSRAM | BFRALLOC_NOBYTEACCESS));
if (pixels) {
memcpy(pixels, orig.pixels, sizeof(uint32_t) * orig.length());
@@ -127,13 +127,13 @@ Segment& Segment::operator= (const Segment &orig) {
// move assignment
Segment& Segment::operator= (Segment &&orig) noexcept {
- //DEBUG_PRINTF_P(PSTR("-- Moving segment: %p -> %p\n"), &orig, this);
+ //DEBUG_PRINTF_P(PSTR("-- Moving segmento: %p -> %p\n"), &orig, this);
if (this != &orig) {
if (name) { p_free(name); name = nullptr; } // free old name
if (_t) stopTransition(); // also erases _t
deallocateData(); // free old runtime data
p_free(pixels); // free old pixel buffer
- // move source data
+ // move source datos
memcpy((void*)this, (void*)&orig, sizeof(Segment));
orig.name = nullptr;
orig.data = nullptr;
@@ -144,13 +144,13 @@ Segment& Segment::operator= (Segment &&orig) noexcept {
return *this;
}
-// allocates effect data buffer on heap and initialises (erases) it
+// allocates efecto datos búfer on montón and initialises (erases) it
bool Segment::allocateData(size_t len) {
if (len == 0) return false; // nothing to do
if (data && _dataLen >= len) { // already allocated enough (reduce fragmentation)
if (call == 0) {
if (_dataLen < FAIR_DATA_PER_SEG) { // segment data is small
- //DEBUG_PRINTF_P(PSTR("-- Clearing data (%d): %p\n"), len, this);
+ //DEBUG_PRINTF_P(PSTR("-- Clearing datos (%d): %p\n"), len, this);
memset(data, 0, len); // erase buffer if called during effect initialisation
return true; // no need to reallocate
}
@@ -158,11 +158,11 @@ bool Segment::allocateData(size_t len) {
else
return true;
}
- //DEBUG_PRINTF_P(PSTR("-- Allocating data (%d): %p\n"), len, this);
- // limit to MAX_SEGMENT_DATA if there is no PSRAM, otherwise prefer functionality over speed
+ //DEBUG_PRINTF_P(PSTR("-- Allocating datos (%d): %p\n"), len, this);
+ // límite to MAX_SEGMENT_DATA if there is no PSRAM, otherwise prefer functionality over velocidad
#ifndef BOARD_HAS_PSRAM
if (Segment::getUsedSegmentData() + len - _dataLen > MAX_SEGMENT_DATA) {
- // not enough memory
+ // not enough memoria
DEBUG_PRINTF_P(PSTR("SegmentData limit reached: %d/%d\n"), len, Segment::getUsedSegmentData());
errorFlag = ERR_NORAM;
return false;
@@ -179,7 +179,7 @@ bool Segment::allocateData(size_t len) {
if (data) {
Segment::addUsedSegmentData(len);
_dataLen = len;
- //DEBUG_PRINTF_P(PSTR("--- Allocated data (%p): %d/%d -> %p\n"), this, len, Segment::getUsedSegmentData(), data);
+ //DEBUG_PRINTF_P(PSTR("--- Allocated datos (%p): %d/%d -> %p\n"), this, len, Segmento::getUsedSegmentData(), datos);
return true;
}
// allocation failed
@@ -191,7 +191,7 @@ bool Segment::allocateData(size_t len) {
void Segment::deallocateData() {
if (!data) { _dataLen = 0; return; }
if ((Segment::getUsedSegmentData() > 0) && (_dataLen > 0)) { // check that we don't have a dangling / inconsistent data pointer
- //DEBUG_PRINTF_P(PSTR("--- Released data (%p): %d/%d -> %p\n"), this, _dataLen, Segment::getUsedSegmentData(), data);
+ //DEBUG_PRINTF_P(PSTR("--- Released datos (%p): %d/%d -> %p\n"), this, _dataLen, Segmento::getUsedSegmentData(), datos);
d_free(data);
} else {
DEBUG_PRINTF_P(PSTR("---- Released data (%p): inconsistent UsedSegmentData (%d/%d), cowardly refusing to free nothing.\n"), this, _dataLen, Segment::getUsedSegmentData());
@@ -202,15 +202,15 @@ void Segment::deallocateData() {
}
/**
- * If reset of this segment was requested, clears runtime
- * settings of this segment.
- * Must not be called while an effect mode function is running
- * because it could access the data buffer and this method
- * may free that data buffer.
+ * If restablecer of this segmento was requested, clears runtime
+ * settings of this segmento.
+ * Must not be called while an efecto mode función is running
+ * because it could acceso the datos búfer and this método
+ * may free that datos búfer.
*/
void Segment::resetIfRequired() {
if (!reset || !isActive()) return;
- //DEBUG_PRINTF_P(PSTR("-- Segment reset: %p\n"), this);
+ //DEBUG_PRINTF_P(PSTR("-- Segmento restablecer: %p\n"), this);
if (data && _dataLen > 0) {
if (_dataLen > FAIR_DATA_PER_SEG) deallocateData(); // do not keep large allocations
else memset(data, 0, _dataLen); // can prevent heap fragmentation
@@ -225,13 +225,13 @@ void Segment::resetIfRequired() {
}
CRGBPalette16 &Segment::loadPalette(CRGBPalette16 &targetPalette, uint8_t pal) {
- // there is one randomy generated palette (1) followed by 4 palettes created from segment colors (2-5)
+ // there is one randomy generated palette (1) followed by 4 palettes created from segmento colors (2-5)
// those are followed by 7 fastled palettes (6-12) and 59 gradient palettes (13-71)
// then come the custom palettes (255,254,...) growing downwards from 255 (255 being 1st custom palette)
- // palette 0 is a varying palette depending on effect and may be replaced by segment's color if so
+ // palette 0 is a varying palette depending on efecto and may be replaced by segmento's color if so
// instructed in color_from_palette()
if (pal > FIXED_PALETTE_COUNT && pal <= 255-customPalettes.size()) pal = 0; // out of bounds palette
- //default palette. Differs depending on effect
+ //default palette. Differs depending on efecto
if (pal == 0) pal = _default_palette; // _default_palette is set in setMode()
switch (pal) {
case 0: //default palette. Exceptions for specific effects above
@@ -280,7 +280,7 @@ CRGBPalette16 &Segment::loadPalette(CRGBPalette16 &targetPalette, uint8_t pal) {
return targetPalette;
}
-// starting a transition has to occur before change so we get current values 1st
+// starting a transición has to occur before change so we get current values 1st
void Segment::startTransition(uint16_t dur, bool segmentCopy) {
if (dur == 0 || !isActive()) {
if (isInTransition()) _t->_dur = 0;
@@ -288,7 +288,7 @@ void Segment::startTransition(uint16_t dur, bool segmentCopy) {
}
if (isInTransition()) {
if (segmentCopy && !_t->_oldSegment) {
- // already in transition but segment copy requested and not yet created
+ // already in transición but segmento copy requested and not yet created
_t->_oldSegment = new(std::nothrow) Segment(*this); // store/copy current segment settings
_t->_start = millis(); // restart countdown
_t->_dur = dur;
@@ -303,7 +303,7 @@ void Segment::startTransition(uint16_t dur, bool segmentCopy) {
return;
}
- // no previous transition running, start by allocating memory for segment copy
+ // no previous transición running, iniciar by allocating memoria for segmento copy
_t = new(std::nothrow) Transition(dur);
if (_t) {
_t->_bri = on ? opacity : 0;
@@ -329,7 +329,7 @@ void Segment::stopTransition() {
_t = nullptr;
}
-// sets transition progress variable (0-65535) based on time passed since transition start
+// sets transición progress variable (0-65535) based on time passed since transición iniciar
void Segment::updateTransitionProgress() const {
if (isInTransition()) {
_t->_progress = 0xFFFF;
@@ -338,45 +338,45 @@ void Segment::updateTransitionProgress() const {
}
}
-// will return segment's CCT during a transition
-// isPreviousMode() is actually not implemented for CCT in strip.service() as WLED does not support per-pixel CCT
+// will retorno segmento's CCT during a transición
+// isPreviousMode() is actually not implemented for CCT in tira.servicio() as WLED does not support per-píxel CCT
uint8_t Segment::currentCCT() const {
unsigned prog = progress();
if (prog < 0xFFFFU) {
if (blendingStyle == BLEND_STYLE_FADE) return (cct * prog + (_t->_cct * (0xFFFFU - prog))) / 0xFFFFU;
- //else return Segment::isPreviousMode() ? _t->_cct : cct;
+ //else retorno Segmento::isPreviousMode() ? _t->_cct : cct;
}
return cct;
}
-// will return segment's opacity during a transition (blending it with old in case of FADE transition)
+// will retorno segmento's opacity during a transición (blending it with old in case of FADE transición)
uint8_t Segment::currentBri() const {
unsigned prog = progress();
unsigned curBri = on ? opacity : 0;
if (prog < 0xFFFFU) {
- // this will blend opacity in new mode if style is FADE (single effect call)
+ // this will mezcla opacity in new mode if style is FADE (single efecto call)
if (blendingStyle == BLEND_STYLE_FADE) curBri = (prog * curBri + _t->_bri * (0xFFFFU - prog)) / 0xFFFFU;
else curBri = Segment::isPreviousMode() ? _t->_bri : curBri;
}
return curBri;
}
-// pre-calculate drawing parameters for faster access (based on the idea from @softhack007 from MM fork)
+// pre-calculate drawing parameters for faster acceso (based on the idea from @softhack007 from MM bifurcación)
// and blends colors and palettes if necessary
-// prog is the progress of the transition (0-65535) and is passed to the function as it may be called in the context of old segment
-// which does not have transition structure
+// prog is the progress of the transición (0-65535) and is passed to the función as it may be called in the contexto of old segmento
+// which does not have transición structure
void Segment::beginDraw(uint16_t prog) {
setDrawDimensions();
- // load colors into _currentColors
+ // carga colors into _currentColors
for (unsigned i = 0; i < NUM_COLORS; i++) _currentColors[i] = colors[i];
- // load palette into _currentPalette
+ // carga palette into _currentPalette
loadPalette(Segment::_currentPalette, palette);
if (isInTransition() && prog < 0xFFFFU && blendingStyle == BLEND_STYLE_FADE) {
- // blend colors
+ // mezcla colors
for (unsigned i = 0; i < NUM_COLORS; i++) _currentColors[i] = color_blend16(_t->_colors[i], colors[i], prog);
- // blend palettes
- // there are about 255 blend passes of 48 "blends" to completely blend two palettes (in _dur time)
- // minimum blend time is 100ms maximum is 65535ms
+ // mezcla palettes
+ // there are about 255 mezcla passes of 48 "blends" to completely mezcla two palettes (in _dur time)
+ // minimum mezcla time is 100ms maximum is 65535ms
#ifndef WLED_SAVE_RAM
unsigned noOfBlends = ((255U * prog) / 0xFFFFU) - _t->_prevPaletteBlends;
if(noOfBlends > 255) noOfBlends = 255; // safety check
@@ -392,7 +392,7 @@ void Segment::beginDraw(uint16_t prog) {
}
}
-// relies on WS2812FX::service() to call it for each frame
+// relies on WS2812FX::servicio() to call it for each frame
void Segment::handleRandomPalette() {
unsigned long now = millis();
uint16_t now_s = now / 1000; // we only need seconds (and @dedehai hated shift >> 10)
@@ -404,8 +404,8 @@ void Segment::handleRandomPalette() {
Segment::_lastPaletteChange = now_s;
Segment::_nextPaletteBlend = now; // starts blending immediately
}
- // there are about 255 blend passes of 48 "blends" to completely blend two palettes (in strip.getTransition() time)
- // if randomPaletteChangeTime is shorter than strip.getTransition() palette will never fully blend
+ // there are about 255 mezcla passes of 48 "blends" to completely mezcla two palettes (in tira.getTransition() time)
+ // if randomPaletteChangeTime is shorter than tira.getTransition() palette will never fully mezcla
unsigned frameTime = strip.getFrameTime(); // in ms [8-1000]
unsigned transitionTime = strip.getTransition(); // in ms [100-65535]
if ((uint16_t)now < Segment::_nextPaletteBlend || now > ((Segment::_lastPaletteChange*1000) + transitionTime + 2*frameTime)) return; // not yet time or past transition time, no need to blend
@@ -415,11 +415,11 @@ void Segment::handleRandomPalette() {
Segment::_nextPaletteBlend = now + ((transitionFrames >> 8) * frameTime); // postpone next blend if necessary
}
-// sets Segment geometry (length or width/height and grouping, spacing and offset as well as 2D mapping)
-// strip must be suspended (strip.suspend()) before calling this function
-// this function may call fill() to clear pixels if spacing or mapping changed (which requires setting _vWidth, _vHeight, _vLength or beginDraw())
+// sets Segmento geometry (longitud or width/height and grouping, spacing and desplazamiento as well as 2D mapping)
+// tira must be suspended (tira.suspend()) before calling this función
+// this función may call fill() to limpiar pixels if spacing or mapping changed (which requires setting _vWidth, _vHeight, _vLength or beginDraw())
void Segment::setGeometry(uint16_t i1, uint16_t i2, uint8_t grp, uint8_t spc, uint16_t ofs, uint16_t i1Y, uint16_t i2Y, uint8_t m12) {
- // return if neither bounds nor grouping have changed
+ // retorno if neither bounds nor grouping have changed
bool boundsUnchanged = (start == i1 && stop == i2);
#ifndef WLED_DISABLE_2D
boundsUnchanged &= (startY == i1Y && stopY == i2Y); // 2D
@@ -467,7 +467,7 @@ void Segment::setGeometry(uint16_t i1, uint16_t i2, uint8_t grp, uint8_t spc, ui
stopY = constrain(i2Y, 1, Segment::maxHeight);
}
#endif
- // safety check
+ // safety verificar
if (start >= stop || startY >= stopY) {
#ifdef WLED_ENABLE_GIF
endImagePlayback(this);
@@ -478,9 +478,9 @@ void Segment::setGeometry(uint16_t i1, uint16_t i2, uint8_t grp, uint8_t spc, ui
stop = 0;
return;
}
- // allocate FX render buffer
+ // allocate FX renderizar búfer
if (length() != oldLength) {
- // allocate render buffer (always entire segment), prefer IRAM/PSRAM. Note: impact on FPS with PSRAM buffer is low (<2% with QSPI PSRAM) on S2/S3
+ // allocate renderizar búfer (always entire segmento), prefer IRAM/PSRAM. Note: impact on FPS with PSRAM búfer is low (<2% with QSPI PSRAM) on S2/S3
p_free(pixels);
pixels = static_cast(allocate_buffer(length() * sizeof(uint32_t), BFRALLOC_PREFER_PSRAM | BFRALLOC_NOBYTEACCESS));
if (!pixels) {
@@ -505,7 +505,7 @@ Segment &Segment::setColor(uint8_t slot, uint32_t c) {
if (slot == 0 && c == BLACK) return *this; // on/off segment cannot have primary color black
if (slot == 1 && c != BLACK) return *this; // on/off segment cannot have secondary color non black
}
- //DEBUG_PRINTF_P(PSTR("- Starting color transition: %d [0x%X]\n"), slot, c);
+ //DEBUG_PRINTF_P(PSTR("- Starting color transición: %d [0x%X]\n"), slot, c);
startTransition(strip.getTransition(), blendingStyle != BLEND_STYLE_FADE); // start transition prior to change
colors[slot] = c;
stateChanged = true; // send UDP/WS broadcast
@@ -519,7 +519,7 @@ Segment &Segment::setCCT(uint16_t k) {
k = (k - 1900) >> 5;
}
if (cct != k) {
- //DEBUG_PRINTF_P(PSTR("- Starting CCT transition: %d\n"), k);
+ //DEBUG_PRINTF_P(PSTR("- Starting CCT transición: %d\n"), k);
startTransition(strip.getTransition(), false); // start transition prior to change (no need to copy segment)
cct = k;
stateChanged = true; // send UDP/WS broadcast
@@ -529,7 +529,7 @@ Segment &Segment::setCCT(uint16_t k) {
Segment &Segment::setOpacity(uint8_t o) {
if (opacity != o) {
- //DEBUG_PRINTF_P(PSTR("- Starting opacity transition: %d\n"), o);
+ //DEBUG_PRINTF_P(PSTR("- Starting opacity transición: %d\n"), o);
startTransition(strip.getTransition(), blendingStyle != BLEND_STYLE_FADE); // start transition prior to change
opacity = o;
stateChanged = true; // send UDP/WS broadcast
@@ -540,7 +540,7 @@ Segment &Segment::setOpacity(uint8_t o) {
Segment &Segment::setOption(uint8_t n, bool val) {
bool prev = (options >> n) & 0x01;
if (val == prev) return *this;
- //DEBUG_PRINTF_P(PSTR("- Starting option transition: %d\n"), n);
+ //DEBUG_PRINTF_P(PSTR("- Starting option transición: %d\n"), n);
if (n == SEG_OPTION_ON) startTransition(strip.getTransition(), blendingStyle != BLEND_STYLE_FADE); // start transition prior to change
if (val) options |= 0x01 << n;
else options &= ~(0x01 << n);
@@ -549,7 +549,7 @@ Segment &Segment::setOption(uint8_t n, bool val) {
}
Segment &Segment::setMode(uint8_t fx, bool loadDefaults) {
- // skip reserved
+ // omitir reserved
while (fx < strip.getModeCount() && strncmp_P("RSVD", strip.getModeData(fx), 4) == 0) fx++;
if (fx >= strip.getModeCount()) fx = 0; // set solid mode
// if we have a valid mode & is not reserved
@@ -557,7 +557,7 @@ Segment &Segment::setMode(uint8_t fx, bool loadDefaults) {
startTransition(strip.getTransition(), true); // set effect transitions (must create segment copy)
mode = fx;
int sOpt;
- // load default values from effect string
+ // carga default values from efecto cadena
if (loadDefaults) {
sOpt = extractModeDefaults(fx, "sx"); speed = (sOpt >= 0) ? sOpt : DEFAULT_SPEED;
sOpt = extractModeDefaults(fx, "ix"); intensity = (sOpt >= 0) ? sOpt : DEFAULT_INTENSITY;
@@ -587,7 +587,7 @@ Segment &Segment::setMode(uint8_t fx, bool loadDefaults) {
Segment &Segment::setPalette(uint8_t pal) {
if (pal <= 255-customPalettes.size() && pal > FIXED_PALETTE_COUNT) pal = 0; // not built in palette or custom palette
if (pal != palette) {
- //DEBUG_PRINTF_P(PSTR("- Starting palette transition: %d\n"), pal);
+ //DEBUG_PRINTF_P(PSTR("- Starting palette transición: %d\n"), pal);
startTransition(strip.getTransition(), blendingStyle != BLEND_STYLE_FADE); // start transition prior to change (no need to copy segment)
palette = pal;
stateChanged = true; // send UDP/WS broadcast
@@ -627,7 +627,7 @@ unsigned Segment::virtualHeight() const {
// Constants for mapping mode "Pinwheel"
#ifndef WLED_DISABLE_2D
constexpr int Fixed_Scale = 16384; // fixpoint scaling factor (14bit for fraction)
-// Pinwheel helper function: matrix dimensions to number of rays
+// Pinwheel helper función: matrix dimensions to number of rays
static int getPinwheelLength(int vW, int vH) {
// Returns multiple of 8, prevents over drawing
return (max(vW, vH) + 15) & ~7;
@@ -648,7 +648,7 @@ static void setPinwheelParameters(int i, int vW, int vH, int& startx, int& start
}
#endif
-// 1D strip
+// 1D tira
uint16_t Segment::virtualLength() const {
#ifndef WLED_DISABLE_2D
if (is2D()) {
@@ -682,15 +682,15 @@ uint16_t Segment::virtualLength() const {
}
#ifndef WLED_DISABLE_2D
-// maximum length of a mapped 1D segment, used in PS for buffer allocation
+// maximum longitud of a mapped 1D segmento, used in PS for búfer allocation
uint16_t Segment::maxMappingLength() const {
uint32_t vW = virtualWidth();
uint32_t vH = virtualHeight();
return max(sqrt32_bw(vH*vH + vW*vW), (uint32_t)getPinwheelLength(vW, vH)); // use diagonal
}
#endif
-// pixel is clipped if it falls outside clipping range
-// if clipping start > stop the clipping range is inverted
+// píxel is clipped if it falls outside clipping rango
+// if clipping iniciar > detener the clipping rango is inverted
bool Segment::isPixelClipped(int i) const {
if (blendingStyle != BLEND_STYLE_FADE && isInTransition() && _clipStart != _clipStop) {
bool invert = _clipStart > _clipStop; // ineverted start & stop
@@ -716,10 +716,10 @@ void WLED_O2_ATTR Segment::setPixelColor(int i, uint32_t col) const
int vStrip = 0;
#endif
const int vL = vLength();
- // if the 1D effect is using virtual strips "i" will have virtual strip id stored in upper 16 bits
+ // if the 1D efecto is usando virtual strips "i" will have virtual tira id stored in upper 16 bits
// in such case "i" will be > virtualLength()
if (i >= vL) {
- // check if this is a virtual strip
+ // verificar if this is a virtual tira
#ifndef WLED_DISABLE_2D
vStrip = i>>16; // hack to allow running on virtual strips (2D segment columns/rows)
#endif
@@ -734,11 +734,11 @@ void WLED_O2_ATTR Segment::setPixelColor(int i, uint32_t col) const
const auto XY = [&](unsigned x, unsigned y){ return x + y*vW;};
switch (map1D2D) {
case M12_Pixels:
- // use all available pixels as a long strip
+ // use all available pixels as a long tira
setPixelColorRaw(XY(i % vW, i / vW), col);
break;
case M12_pBar:
- // expand 1D effect vertically or have it play on virtual strips
+ // expand 1D efecto vertically or have it play on virtual strips
if (vStrip > 0) setPixelColorRaw(XY(vStrip - 1, vH - i - 1), col);
else for (int x = 0; x < vW; x++) setPixelColorRaw(XY(x, vH - i - 1), col);
break;
@@ -756,7 +756,7 @@ void WLED_O2_ATTR Segment::setPixelColor(int i, uint32_t col) const
setPixelColorXY(x, y, col);
setPixelColorXY(y, x, col);
}
- // Bresenham’s Algorithm (may not fill every pixel)
+ // Bresenham’s Algoritmo (may not fill every píxel)
//int d = 3 - (2*i);
//int y = i, x = 0;
//while (y >= x) {
@@ -777,7 +777,7 @@ void WLED_O2_ATTR Segment::setPixelColor(int i, uint32_t col) const
for (int y = 0; y < i; y++) setPixelColorXY(i, y, col);
break;
case M12_sPinwheel: {
- // Uses Bresenham's algorithm to place coordinates of two lines in arrays then draws between them
+ // Uses Bresenham's algoritmo to place coordinates of two lines in arrays then draws between them
int startX, startY, cosVal[2], sinVal[2]; // in fixed point scale
setPinwheelParameters(i, vW, vH, startX, startY, cosVal, sinVal);
@@ -800,7 +800,7 @@ void WLED_O2_ATTR Segment::setPixelColor(int i, uint32_t col) const
x0 /= Fixed_Scale; // convert to pixel coordinates
y0 /= Fixed_Scale;
- // Bresenham's algorithm
+ // Bresenham's algoritmo
int idx = 0;
int err = dx + dy;
while (true) {
@@ -811,7 +811,7 @@ void WLED_O2_ATTR Segment::setPixelColor(int i, uint32_t col) const
coordinates[idx++] = x0;
coordinates[idx++] = y0;
(*length)++;
- // note: since endpoint is out of grid, no need to check if endpoint is reached
+ // note: since extremo is out of grid, no need to verificar if extremo is reached
int e2 = 2 * err;
if (e2 >= dy) { err += dy; x0 += sx; }
if (e2 <= dx) { err += dx; y0 += sy; }
@@ -835,7 +835,7 @@ void WLED_O2_ATTR Segment::setPixelColor(int i, uint32_t col) const
}
}
- // draw and block-fill the line coordinates. Note: block filling only efficient if angle between lines is small
+ // dibujar and block-fill the line coordinates. Note: block filling only efficient if angle between lines is small
closestEdgeIdx += 2;
int max_i = getPinwheelLength(vW, vH) - 1;
bool drawFirst = !(prevRays[0] == i - 1 || (i == 0 && prevRays[0] == max_i)); // draw first line if previous ray was not adjacent including wrap
@@ -875,7 +875,7 @@ void WLED_O2_ATTR Segment::setPixelColor(int i, uint32_t col) const
return;
} else if (Segment::maxHeight != 1 && (width() == 1 || height() == 1)) {
if (start < Segment::maxWidth*Segment::maxHeight) {
- // we have a vertical or horizontal 1D segment (WARNING: virtual...() may be transposed)
+ // we have a vertical or horizontal 1D segmento (ADVERTENCIA: virtual...() may be transposed)
int x = 0, y = 0;
if (vHeight() > 1) y = i;
if (vWidth() > 1) x = i;
@@ -888,7 +888,7 @@ void WLED_O2_ATTR Segment::setPixelColor(int i, uint32_t col) const
}
#ifdef WLED_USE_AA_PIXELS
-// anti-aliased normalized version of setPixelColor()
+// anti-aliased normalized versión of setPixelColor()
void Segment::setPixelColor(float i, uint32_t col, bool aa) const
{
if (!isActive()) return; // not active
@@ -906,14 +906,14 @@ void Segment::setPixelColor(float i, uint32_t col, bool aa) const
uint32_t cIL = getPixelColor(iL | (vStrip<<16));
uint32_t cIR = getPixelColor(iR | (vStrip<<16));
if (iR!=iL) {
- // blend L pixel
+ // mezcla L píxel
cIL = color_blend(col, cIL, uint8_t(dL*255.0f));
setPixelColor(iL | (vStrip<<16), cIL);
- // blend R pixel
+ // mezcla R píxel
cIR = color_blend(col, cIR, uint8_t(dR*255.0f));
setPixelColor(iR | (vStrip<<16), cIR);
} else {
- // exact match (x & y land on a pixel)
+ // exact coincidir (x & y land on a píxel)
setPixelColor(iL | (vStrip<<16), col);
}
} else {
@@ -958,12 +958,12 @@ uint32_t WLED_O2_ATTR Segment::getPixelColor(int i) const
else y = i;
break;
case M12_sPinwheel: {
- // not 100% accurate, returns pixel at outer edge
+ // not 100% accurate, returns píxel at outer edge
int cosVal[2], sinVal[2];
setPinwheelParameters(i, vW, vH, x, y, cosVal, sinVal, true);
int maxX = (vW-1) * Fixed_Scale;
int maxY = (vH-1) * Fixed_Scale;
- // trace ray from center until we hit any edge - to avoid rounding problems, we use fixed point coordinates
+ // rastreo ray from center until we hit any edge - to avoid rounding problems, we use fixed point coordinates
while ((x < maxX) && (y < maxY) && (x > Fixed_Scale) && (y > Fixed_Scale)) {
x += cosVal[0]; // advance to next position
y += sinVal[0];
@@ -987,7 +987,7 @@ void Segment::refreshLightCapabilities() const {
return;
}
- // we must traverse each pixel in segment to determine its capabilities (as pixel may be mapped)
+ // we must traverse each píxel in segmento to determine its capabilities (as píxel may be mapped)
for (unsigned y = startY; y < stopY; y++) for (unsigned x = start; x < stop; x++) {
unsigned index = x + Segment::maxWidth * y;
index = strip.getMappedPixelIndex(index); // convert logical address to physical
@@ -1002,9 +1002,9 @@ void Segment::refreshLightCapabilities() const {
if (bus->hasWhite()) {
unsigned aWM = Bus::getGlobalAWMode() == AW_GLOBAL_DISABLED ? bus->getAutoWhiteMode() : Bus::getGlobalAWMode();
bool whiteSlider = (aWM == RGBW_MODE_DUAL || aWM == RGBW_MODE_MANUAL_ONLY); // white slider allowed
- // if auto white calculation from RGB is active (Accurate/Brighter), force RGB controls even if there are no RGB busses
+ // if auto white cálculo from RGB is active (Accurate/Brighter), force RGB controls even if there are no RGB busses
if (!whiteSlider) capabilities |= SEG_CAPABILITY_RGB;
- // if auto white calculation from RGB is disabled/optional (None/Dual), allow white channel adjustments
+ // if auto white cálculo from RGB is disabled/optional (None/Dual), allow white channel adjustments
if ( whiteSlider) capabilities |= SEG_CAPABILITY_W;
}
break;
@@ -1015,7 +1015,7 @@ void Segment::refreshLightCapabilities() const {
}
/*
- * Fills segment with color
+ * Fills segmento with color
*/
void Segment::fill(uint32_t c) const {
if (!isActive()) return; // not active
@@ -1023,7 +1023,7 @@ void Segment::fill(uint32_t c) const {
}
/*
- * fade out function, higher rate = quicker fade
+ * fade out función, higher rate = quicker fade
* fading is highly dependant on frame rate (higher frame rates, faster fading)
* each frame will fade at max 9% or as little as 0.8%
*/
@@ -1038,11 +1038,11 @@ void Segment::fade_out(uint8_t rate) const {
for (int i = 0; i < 32; i += 8) {
uint8_t c2 = (colors[1]>>i); // get background channel
uint8_t c1 = (color>>i); // get foreground channel
- // we can't use bitshift since we are using int
+ // we can't use bitshift since we are usando int
int delta = (c2 - c1) * mappedRate / 256;
// if fade isn't complete, make sure delta is at least 1 (fixes rounding issues)
if (delta == 0) delta += (c2 == c1) ? 0 : (c2 > c1) ? 1 : -1;
- // stuff new value back into color
+ // stuff new valor back into color
color &= ~(0xFF< 215 this function does not work properly (creates alternating pattern)
+ * blurs segmento contenido, source: FastLED colorutils.cpp
+ * Note: for blur_amount > 215 this función does not work properly (creates alternating patrón)
*/
void Segment::blur(uint8_t blur_amount, bool smear) const {
if (!isActive() || blur_amount == 0) return; // optimization: 0 means "don't blur"
@@ -1081,7 +1081,7 @@ void Segment::blur(uint8_t blur_amount, bool smear) const {
uint8_t keep = smear ? 255 : 255 - blur_amount;
uint8_t seep = blur_amount >> 1;
unsigned vlength = vLength();
- // handle first pixel to avoid conditional in loop (faster)
+ // handle first píxel to avoid conditional in bucle (faster)
uint32_t cur = getPixelColorRaw(0);
uint32_t carryover = fast_color_scale(cur, seep);
setPixelColorRaw(0, fast_color_scale(cur, keep));
@@ -1097,8 +1097,8 @@ void Segment::blur(uint8_t blur_amount, bool smear) const {
}
/*
- * Put a value 0 to 255 in to get a color value.
- * The colours are a transition r -> g -> b -> back to r
+ * Put a valor 0 to 255 in to get a color valor.
+ * The colours are a transición r -> g -> b -> back to r
* Rotates the color in HSV space, where pos is H. (0=0deg, 256=360deg)
*/
uint32_t Segment::color_wheel(uint8_t pos) const {
@@ -1111,23 +1111,23 @@ uint32_t Segment::color_wheel(uint8_t pos) const {
/*
* Gets a single color from the currently selected palette.
- * @param i Palette Index (if mapping is true, the full palette will be _virtualSegmentLength long, if false, 255). Will wrap around automatically.
- * @param mapping if true, LED position in segment is considered for color
- * @param moving FastLED palettes will usually wrap back to the start smoothly. Set to true if effect has moving palette and you want wrap.
- * @param mcol If the default palette 0 is selected, return the standard color 0, 1 or 2 instead. If >2, Party palette is used instead
- * @param pbri Value to scale the brightness of the returned color by. Default is 255. (no scaling)
+ * @param i Paleta Índice (if mapping is verdadero, the full palette will be _virtualSegmentLength long, if falso, 255). Will wrap around automatically.
+ * @param mapping if verdadero, LED posición in segmento is considered for color
+ * @param moving FastLED palettes will usually wrap back to the iniciar smoothly. Set to verdadero if efecto has moving palette and you want wrap.
+ * @param mcol If the default palette 0 is selected, retorno the estándar color 0, 1 or 2 instead. If >2, Party palette is used instead
+ * @param pbri Valor to escala the brillo of the returned color by. Predeterminado is 255. (no scaling)
* @returns Single color from palette
*/
uint32_t Segment::color_from_palette(uint16_t i, bool mapping, bool moving, uint8_t mcol, uint8_t pbri) const {
uint32_t color = getCurrentColor(mcol);
- // default palette or no RGB support on segment
+ // default palette or no RGB support on segmento
if ((palette == 0 && mcol < NUM_COLORS) || !_isRGB) {
return color_fade(color, pbri, true);
}
unsigned paletteIndex = i;
if (mapping) paletteIndex = min((i*255)/vLength(), 255U);
- // paletteBlend: 0 - wrap when moving, 1 - always wrap, 2 - never wrap, 3 - none (undefined/no interpolation of palette entries)
+ // paletteBlend: 0 - wrap when moving, 1 - always wrap, 2 - never wrap, 3 - none (indefinido/no interpolation of palette entries)
// ColorFromPalette interpolations are: NOBLEND, LINEARBLEND, LINEARBLEND_NOWRAP
TBlendType blend = NOBLEND;
switch (paletteBlend) {
@@ -1143,18 +1143,18 @@ uint32_t Segment::color_from_palette(uint16_t i, bool mapping, bool moving, uint
///////////////////////////////////////////////////////////////////////////////
-// WS2812FX class implementation
+// WS2812FX clase implementación
///////////////////////////////////////////////////////////////////////////////
-//do not call this method from system context (network callback)
+//do not call this método from sistema contexto (red devolución de llamada)
void WS2812FX::finalizeInit() {
- //reset segment runtimes
+ //restablecer segmento runtimes
restartRuntime();
// for the lack of better place enumerate ledmaps here
- // if we do it in json.cpp (serializeInfo()) we are getting flashes on LEDs
+ // if we do it in JSON.cpp (serializeInfo()) we are getting flashes on LEDs
// unfortunately this means we do not get updates after uploads
- // the other option is saving UI settings which will cause enumeration
+ // the other option is saving UI settings which will cause enumeración
enumerateLedmaps();
_hasWhiteChannel = _isOffRefreshRequired = false;
@@ -1177,20 +1177,20 @@ void WS2812FX::finalizeInit() {
}
}
DEBUG_PRINTF_P(PSTR("Maximum LEDs on a bus: %u\nDigital buses: %u\n"), maxLedsOnBus, digitalCount);
- // we may remove 600 LEDs per bus limit when NeoPixelBus is updated beyond 2.8.3
+ // we may eliminar 600 LEDs per bus límite when NeoPixelBus is updated beyond 2.8.3
if (maxLedsOnBus <= 600 && useParallelI2S) BusManager::useParallelOutput(); // must call before creating buses
else useParallelI2S = false; // enforce single I2S
digitalCount = 0;
#endif
DEBUG_PRINTF_P(PSTR("Heap before buses: %d\n"), getFreeHeapSize());
- // create buses/outputs
+ // crear buses/outputs
unsigned mem = 0;
unsigned maxI2S = 0;
for (const auto &bus : busConfigs) {
unsigned memB = bus.memUsage(Bus::isDigital(bus.type) && !Bus::is2Pin(bus.type) ? digitalCount++ : 0); // does not include DMA/RMT buffer
mem += memB;
- // estimate maximum I2S memory usage (only relevant for digital non-2pin busses)
+ // estimate maximum I2S memoria usage (only relevant for digital non-2pin busses)
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(ESP8266)
#if defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32S3)
const bool usesI2S = ((useParallelI2S && digitalCount <= 8) || (!useParallelI2S && digitalCount == 1));
@@ -1248,9 +1248,9 @@ void WS2812FX::finalizeInit() {
DEBUG_PRINTLN(F("Loading custom ledmaps"));
deserializeMap(); // (re)load default ledmap (will also setUpMatrix() if ledmap does not exist)
- // allocate frame buffer after matrix has been set up (gaps!)
+ // allocate frame búfer after matrix has been set up (gaps!)
p_free(_pixels); // using realloc on large buffers can cause additional fragmentation instead of reducing it
- // use PSRAM if available: there is no measurable perfomance impact between PSRAM and DRAM on S2/S3 with QSPI PSRAM for this buffer
+ // use PSRAM if available: there is no measurable perfomance impact between PSRAM and DRAM on S2/S3 with QSPI PSRAM for this búfer
_pixels = static_cast(allocate_buffer(getLengthTotal() * sizeof(uint32_t), BFRALLOC_ENFORCE_PSRAM | BFRALLOC_NOBYTEACCESS | BFRALLOC_CLEAR));
DEBUG_PRINTF_P(PSTR("strip buffer size: %uB\n"), getLengthTotal() * sizeof(uint32_t));
DEBUG_PRINTF_P(PSTR("Heap after strip init: %uB\n"), getFreeHeapSize());
@@ -1273,28 +1273,28 @@ void WS2812FX::service() {
for (Segment &seg : _segments) {
if (_suspend) break; // immediately stop processing segments if suspend requested during service()
- // process transition (also pre-calculates progress value)
+ // proceso transición (also pre-calculates progress valor)
seg.handleTransition();
- // reset the segment runtime data if needed
+ // restablecer the segmento runtime datos if needed
seg.resetIfRequired();
if (!seg.isActive()) continue;
- // last condition ensures all solid segments are updated at the same time
+ // last condición ensures all solid segments are updated at the same time
if (nowUp > seg.next_time || _triggered || (doShow && seg.mode == FX_MODE_STATIC))
{
doShow = true;
unsigned frameDelay = FRAMETIME;
if (!seg.freeze) { //only run effect function if not frozen
- // Effect blending
+ // Efecto blending
uint16_t prog = seg.progress();
seg.beginDraw(prog); // set up parameters for get/setPixelColor() (will also blend colors and palette if blend style is FADE)
_currentSegment = &seg; // set current segment for effect functions (SEGMENT & SEGENV)
- // workaround for on/off transition to respect blending style
+ // workaround for on/off transición to respect blending style
frameDelay = (*_mode[seg.mode])(); // run new/current mode (needed for bri workaround)
seg.call++;
- // if segment is in transition and no old segment exists we don't need to run the old mode
+ // if segmento is in transición and no old segmento exists we don't need to run the old mode
// (blendSegments() takes care of On/Off transitions and clipping)
Segment *segO = seg.getOldSegment();
if (segO && segO->isActive() && (seg.mode != segO->mode || blendingStyle != BLEND_STYLE_FADE ||
@@ -1302,7 +1302,7 @@ void WS2812FX::service() {
Segment::modeBlend(true); // set semaphore for beginDraw() to blend colors and palette
segO->beginDraw(prog); // set up palette & colors (also sets draw dimensions), parent segment has transition progress
_currentSegment = segO; // set current segment
- // workaround for on/off transition to respect blending style
+ // workaround for on/off transición to respect blending style
frameDelay = min(frameDelay, (unsigned)(*_mode[segO->mode])()); // run old mode (needed for bri workaround; semaphore!!)
segO->call++; // increment old mode run counter
Segment::modeBlend(false); // unset semaphore
@@ -1332,7 +1332,7 @@ void WS2812FX::service() {
_isServicing = false;
}
-// https://en.wikipedia.org/wiki/Blend_modes but using a for top layer & b for bottom layer
+// https://en.wikipedia.org/wiki/Blend_modes but usando a for top capa & b for bottom capa
static uint8_t _top (uint8_t a, uint8_t b) { return a; }
static uint8_t _bottom (uint8_t a, uint8_t b) { return b; }
static uint8_t _add (uint8_t a, uint8_t b) { unsigned t = a + b; return t > 255 ? 255 : t; }
@@ -1474,20 +1474,20 @@ void WS2812FX::blendSegment(const Segment &topSegment) const {
}
};
- // if we blend using "push" style we need to "shift" canvas to left/right/up/down
+ // if we mezcla usando "enviar" style we need to "shift" canvas to left/right/up/down
unsigned offsetX = (blendingStyle == BLEND_STYLE_PUSH_UP || blendingStyle == BLEND_STYLE_PUSH_DOWN) ? 0 : progInv * nCols / 0xFFFFU;
unsigned offsetY = (blendingStyle == BLEND_STYLE_PUSH_LEFT || blendingStyle == BLEND_STYLE_PUSH_RIGHT) ? 0 : progInv * nRows / 0xFFFFU;
- // we only traverse new segment, not old one
+ // we only traverse new segmento, not old one
for (int r = 0; r < nRows; r++) for (int c = 0; c < nCols; c++) {
const bool clipped = topSegment.isPixelXYClipped(c, r);
- // if segment is in transition and pixel is clipped take old segment's pixel and opacity
+ // if segmento is in transición and píxel is clipped take old segmento's píxel and opacity
const Segment *seg = clipped && segO ? segO : &topSegment; // pixel is never clipped for FADE
int vCols = seg == segO ? oCols : nCols; // old segment may have different dimensions
int vRows = seg == segO ? oRows : nRows; // old segment may have different dimensions
int x = c;
int y = r;
- // if we blend using "push" style we need to "shift" canvas to left/right/up/down
+ // if we mezcla usando "enviar" style we need to "shift" canvas to left/right/up/down
switch (blendingStyle) {
case BLEND_STYLE_PUSH_RIGHT: x = (x + offsetX) % nCols; break;
case BLEND_STYLE_PUSH_LEFT: x = (x - offsetX + nCols) % nCols; break;
@@ -1499,21 +1499,21 @@ void WS2812FX::blendSegment(const Segment &topSegment) const {
if (segO && blendingStyle == BLEND_STYLE_FADE
&& (topSegment.mode != segO->mode || (segO->name != topSegment.name && segO->name && topSegment.name && strncmp(segO->name, topSegment.name, WLED_MAX_SEGNAME_LEN) != 0))
&& x < oCols && y < oRows) {
- // we need to blend old segment using fade as pixels are not clipped
+ // we need to mezcla old segmento usando fade as pixels are not clipped
c_a = color_blend16(c_a, segO->getPixelColorRaw(x + y*oCols), progInv);
} else if (blendingStyle != BLEND_STYLE_FADE) {
- // workaround for On/Off transition
+ // workaround for On/Off transición
// (bri != briT) && !bri => from On to Off
// (bri != briT) && bri => from Off to On
if ((!clipped && (bri != briT) && !bri) || (clipped && (bri != briT) && bri)) c_a = BLACK;
}
- // map it into frame buffer
+ // map it into frame búfer
x = c; // restore coordiates if we were PUSHing
y = r;
if (topSegment.reverse ) x = nCols - x - 1;
if (topSegment.reverse_y) y = nRows - y - 1;
if (topSegment.transpose) std::swap(x,y); // swap X & Y if segment transposed
- // expand pixel
+ // expand píxel
const unsigned groupLen = topSegment.groupLength();
if (groupLen == 1) {
setMirroredPixel(x, y, c_a, opacity);
@@ -1552,16 +1552,16 @@ void WS2812FX::blendSegment(const Segment &topSegment) const {
if (_pixelCCT) _pixelCCT[indx] = cct;
};
- // if we blend using "push" style we need to "shift" canvas to left/right/
+ // if we mezcla usando "enviar" style we need to "shift" canvas to left/right/
unsigned offsetI = progInv * nLen / 0xFFFFU;
for (int k = 0; k < nLen; k++) {
const bool clipped = topSegment.isPixelClipped(k);
- // if segment is in transition and pixel is clipped take old segment's pixel and opacity
+ // if segmento is in transición and píxel is clipped take old segmento's píxel and opacity
const Segment *seg = clipped && segO ? segO : &topSegment; // pixel is never clipped for FADE
const int vLen = seg == segO ? oLen : nLen;
int i = k;
- // if we blend using "push" style we need to "shift" canvas to left or right
+ // if we mezcla usando "enviar" style we need to "shift" canvas to left or right
switch (blendingStyle) {
case BLEND_STYLE_PUSH_RIGHT: i = (i + offsetI) % nLen; break;
case BLEND_STYLE_PUSH_LEFT: i = (i - offsetI + nLen) % nLen; break;
@@ -1569,20 +1569,20 @@ void WS2812FX::blendSegment(const Segment &topSegment) const {
uint32_t c_a = BLACK;
if (i < vLen) c_a = seg->getPixelColorRaw(i); // will get clipped pixel from old segment or unclipped pixel from new segment
if (segO && blendingStyle == BLEND_STYLE_FADE && topSegment.mode != segO->mode && i < oLen) {
- // we need to blend old segment using fade as pixels are not clipped
+ // we need to mezcla old segmento usando fade as pixels are not clipped
c_a = color_blend16(c_a, segO->getPixelColorRaw(i), progInv);
} else if (blendingStyle != BLEND_STYLE_FADE) {
- // workaround for On/Off transition
+ // workaround for On/Off transición
// (bri != briT) && !bri => from On to Off
// (bri != briT) && bri => from Off to On
if ((!clipped && (bri != briT) && !bri) || (clipped && (bri != briT) && bri)) c_a = BLACK;
}
- // map into frame buffer
+ // map into frame búfer
i = k; // restore index if we were PUSHing
if (topSegment.reverse) i = nLen - i - 1; // is segment reversed?
- // expand pixel
+ // expand píxel
i *= topSegment.groupLength();
- // set all the pixels in the group
+ // set all the pixels in the grupo
const int maxI = std::min(i + topSegment.grouping, length); // make sure to not go beyond physical length
while (i < maxI) setMirroredPixel(i++, c_a, opacity);
}
@@ -1603,33 +1603,33 @@ void WS2812FX::show() {
size_t diff = showNow - _lastShow;
size_t totalLen = getLengthTotal();
- // WARNING: as WLED doesn't handle CCT on pixel level but on Segment level instead
- // we need to keep track of each pixel's CCT when blending segments (if CCT is present)
- // and then set appropriate CCT from that pixel during paint (see below).
+ // ADVERTENCIA: as WLED doesn't handle CCT on píxel nivel but on Segmento nivel instead
+ // we need to keep track of each píxel's CCT when blending segments (if CCT is present)
+ // and then set appropriate CCT from that píxel during pintar (see below).
if ((hasCCTBus() || correctWB) && !cctFromRgb)
_pixelCCT = static_cast(allocate_buffer(totalLen * sizeof(uint8_t), BFRALLOC_PREFER_PSRAM)); // allocate CCT buffer if necessary, prefer PSRAM
if (_pixelCCT) memset(_pixelCCT, 127, totalLen); // set neutral (50:50) CCT
if (realtimeMode == REALTIME_MODE_INACTIVE || useMainSegmentOnly || realtimeOverride > REALTIME_OVERRIDE_NONE) {
- // clear frame buffer
+ // limpiar frame búfer
for (size_t i = 0; i < totalLen; i++) _pixels[i] = BLACK; // memset(_pixels, 0, sizeof(uint32_t) * getLengthTotal());
- // blend all segments into (cleared) buffer
+ // mezcla all segments into (cleared) búfer
for (Segment &seg : _segments) if (seg.isActive() && (seg.on || seg.isInTransition())) {
blendSegment(seg); // blend segment's buffer into frame buffer
}
}
- // avoid race condition, capture _callback value
+ // avoid condición de carrera condición, capture _callback valor
show_callback callback = _callback;
if (callback) callback(); // will call setPixelColor or setRealtimePixelColor
- // paint actual pixels
+ // pintar actual pixels
int oldCCT = Bus::getCCT(); // store original CCT value (since it is global)
- // when cctFromRgb is true we implicitly calculate WW and CW from RGB values (cct==-1)
+ // when cctFromRgb is verdadero we implicitly calculate WW and CW from RGB values (cct==-1)
if (cctFromRgb) BusManager::setSegmentCCT(-1);
for (size_t i = 0; i < totalLen; i++) {
- // when correctWB is true setSegmentCCT() will convert CCT into K with which we can then
- // correct/adjust RGB value according to desired CCT value, it will still affect actual WW/CW ratio
+ // when correctWB is verdadero setSegmentCCT() will convertir CCT into K with which we can then
+ // correct/adjust RGB valor according to desired CCT valor, it will still affect actual WW/CW ratio
if (_pixelCCT) { // cctFromRgb already exluded at allocation
if (i == 0 || _pixelCCT[i-1] != _pixelCCT[i]) BusManager::setSegmentCCT(_pixelCCT[i], correctWB);
}
@@ -1644,8 +1644,8 @@ void WS2812FX::show() {
p_free(_pixelCCT);
_pixelCCT = nullptr;
- // some buses send asynchronously and this method will return before
- // all of the data has been sent.
+ // some buses enviar asynchronously and this método will retorno before
+ // all of the datos has been sent.
// See https://github.com/Makuna/NeoPixelBus/wiki/ESP32-NeoMethods#neoesp32rmt-methods
BusManager::show();
@@ -1665,7 +1665,7 @@ void WS2812FX::setRealtimePixelColor(unsigned i, uint32_t c) {
}
}
-// reset all segments
+// restablecer all segments
void WS2812FX::restartRuntime() {
suspend();
waitForIt();
@@ -1673,7 +1673,7 @@ void WS2812FX::restartRuntime() {
resume();
}
-// start or stop transition for all segments
+// iniciar or detener transición for all segments
void WS2812FX::setTransitionMode(bool t) {
suspend();
waitForIt();
@@ -1681,11 +1681,11 @@ void WS2812FX::setTransitionMode(bool t) {
resume();
}
-// wait until frame is over (service() has finished or time for 2 frames have passed; yield() crashes on 8266)
-// the latter may, in rare circumstances, lead to incorrectly assuming strip is done servicing but will not block
+// wait until frame is over (servicio() has finished or time for 2 frames have passed; yield() crashes on 8266)
+// the latter may, in rare circumstances, lead to incorrectly assuming tira is done servicing but will not block
// other processing "indefinitely"
-// rare circumstances are: setting FPS to high number (i.e. 120) and have very slow effect that will need more
-// time than 2 * _frametime (1000/FPS) to draw content
+// rare circumstances are: setting FPS to high number (i.e. 120) and have very slow efecto that will need more
+// time than 2 * _frametime (1000/FPS) to dibujar contenido
void WS2812FX::waitForIt() {
unsigned long waitStart = millis();
unsigned long maxWait = 2*getFrameTime() + 100; // TODO: this needs a proper fix for timeout! see #4779
@@ -1709,8 +1709,8 @@ void WS2812FX::setCCT(uint16_t k) {
}
}
-// direct=true either expects the caller to call show() themselves (realtime modes) or be ok waiting for the next frame for the change to apply
-// direct=false immediately triggers an effect redraw
+// direct=verdadero either expects the caller to call show() themselves (realtime modes) or be ok waiting for the next frame for the change to apply
+// direct=falso immediately triggers an efecto redraw
void WS2812FX::setBrightness(uint8_t b, bool direct) {
if (gammaCorrectBri) b = gamma8(b);
if (_brightness == b) return;
@@ -1739,7 +1739,7 @@ uint8_t WS2812FX::getFirstSelectedSegId() const {
if (seg.isActive() && seg.isSelected()) return i;
i++;
}
- // if none selected, use the main segment
+ // if none selected, use the principal segmento
return getMainSegmentId();
}
@@ -1774,9 +1774,9 @@ uint16_t WS2812FX::getLengthPhysical() const {
return BusManager::getTotalLength(true);
}
-//used for JSON API info.leds.rgbw. Little practical use, deprecate with info.leds.rgbw.
+//used for JSON API información.leds.rgbw. Little practical use, deprecate with información.leds.rgbw.
//returns if there is an RGBW bus (supports RGB and White, not only white)
-//not influenced by auto-white mode, also true if white slider does not affect output white channel
+//not influenced by auto-white mode, also verdadero if white slider does not affect salida white channel
bool WS2812FX::hasRGBWBus() const {
for (size_t b = 0; b < BusManager::getNumBusses(); b++) {
const Bus *bus = BusManager::getBus(b);
@@ -1797,7 +1797,7 @@ bool WS2812FX::hasCCTBus() const {
}
void WS2812FX::purgeSegments() {
- // remove all inactive segments (from the back)
+ // eliminar all inactive segments (from the back)
int deleted = 0;
if (_segments.size() <= 1) return;
for (size_t i = _segments.size()-1; i > 0; i--)
@@ -1815,9 +1815,9 @@ Segment& WS2812FX::getSegment(unsigned id) {
return _segments[id >= _segments.size() ? getMainSegmentId() : id]; // vectors
}
-// WARNING: resetSegments(), makeAutoSegments() and fixInvalidSegments() must not be called while
-// strip is being serviced (strip.service()), you must call suspend prior if changing segments outside
-// loop() context
+// ADVERTENCIA: resetSegments(), makeAutoSegments() and fixInvalidSegments() must not be called while
+// tira is being serviced (tira.servicio()), you must call suspend prior if changing segments outside
+// bucle() contexto
void WS2812FX::resetSegments() {
if (isServicing()) return;
_segments.clear(); // destructs all Segment as part of clearing
@@ -1834,7 +1834,7 @@ void WS2812FX::makeAutoSegments(bool forceReset) {
size_t s = 0;
#ifndef WLED_DISABLE_2D
- // 2D segment is the 1st one using entire matrix
+ // 2D segmento is the 1st one usando entire matrix
if (isMatrix) {
segStarts[0] = 0;
segStops[0] = Segment::maxWidth*Segment::maxHeight;
@@ -1854,10 +1854,10 @@ void WS2812FX::makeAutoSegments(bool forceReset) {
if (isMatrix && segStarts[s] < Segment::maxWidth*Segment::maxHeight) segStarts[s] = Segment::maxWidth*Segment::maxHeight;
#endif
- //check for overlap with previous segments
+ //verificar for overlap with previous segments
for (size_t j = 0; j < s; j++) {
if (segStops[j] > segStarts[s] && segStarts[j] < segStops[s]) {
- //segments overlap, merge
+ //segments overlap, fusión
segStarts[j] = min(segStarts[s],segStarts[j]);
segStops [j] = max(segStops [s],segStops [j]); segStops[s] = 0;
s--;
@@ -1868,7 +1868,7 @@ void WS2812FX::makeAutoSegments(bool forceReset) {
_segments.clear();
_segments.reserve(s); // prevent reallocations
- // there is always at least one segment (but we need to differentiate between 1D and 2D)
+ // there is always at least one segmento (but we need to differentiate between 1D and 2D)
#ifndef WLED_DISABLE_2D
if (isMatrix)
_segments.emplace_back(0, Segment::maxWidth, 0, Segment::maxHeight);
@@ -1883,7 +1883,7 @@ void WS2812FX::makeAutoSegments(bool forceReset) {
} else {
if (forceReset || getSegmentsNum() == 0) resetSegments();
- //expand the main seg to the entire length, but only if there are no other segments, or reset is forced
+ //expand the principal seg to the entire longitud, but only if there are no other segments, or restablecer is forced
else if (getActiveSegmentsNum() == 1) {
size_t i = getLastActiveSegmentId();
#ifndef WLED_DISABLE_2D
@@ -1900,12 +1900,12 @@ void WS2812FX::makeAutoSegments(bool forceReset) {
void WS2812FX::fixInvalidSegments() {
if (isServicing()) return;
- //make sure no segment is longer than total (sanity check)
+ //make sure no segmento is longer than total (sanity verificar)
for (size_t i = getSegmentsNum()-1; i > 0; i--) {
if (isMatrix) {
#ifndef WLED_DISABLE_2D
if (_segments[i].start >= Segment::maxWidth * Segment::maxHeight) {
- // 1D segment at the end of matrix
+ // 1D segmento at the end of matrix
if (_segments[i].start >= _length || _segments[i].startY > 0 || _segments[i].stopY > 1) { _segments.erase(_segments.begin()+i); continue; }
if (_segments[i].stop > _length) _segments[i].stop = _length;
continue;
@@ -1919,14 +1919,14 @@ void WS2812FX::fixInvalidSegments() {
if (_segments[i].stop > _length) _segments[i].stop = _length;
}
}
- // if any segments were deleted free memory
+ // if any segments were deleted free memoria
purgeSegments();
- // this is always called as the last step after finalizeInit(), update covered bus types
+ // this is always called as the last paso after finalizeInit(), actualizar covered bus types
for (const Segment &seg : _segments)
seg.refreshLightCapabilities();
}
-//true if all segments align with a bus, or if a segment covers the total length
+//verdadero if all segments align with a bus, or if a segmento covers the total longitud
//irrelevant in 2D set-up
bool WS2812FX::checkSegmentAlignment() const {
bool aligned = false;
@@ -1960,9 +1960,9 @@ void WS2812FX::printSize() {
}
#endif
-// load custom mapping table from JSON file (called from finalizeInit() or deserializeState())
-// if this is a matrix set-up and default ledmap.json file does not exist, create mapping table using setUpMatrix() from panel information
-// WARNING: effect drawing has to be suspended (strip.suspend()) or must be called from loop() context
+// carga custom mapping table from JSON archivo (called from finalizeInit() or deserializeState())
+// if this is a matrix set-up and default ledmap.JSON archivo does not exist, crear mapping table usando setUpMatrix() from panel information
+// ADVERTENCIA: efecto drawing has to be suspended (tira.suspend()) or must be called from bucle() contexto
bool WS2812FX::deserializeMap(unsigned n) {
char fileName[32];
strcpy_P(fileName, PSTR("/ledmap"));
@@ -1975,7 +1975,7 @@ bool WS2812FX::deserializeMap(unsigned n) {
if (n == 0 || isFile) interfaceUpdateCallMode = CALL_MODE_WS_SEND; // schedule WS update (to inform UI)
if (!isFile && n==0 && isMatrix) {
- // 2D panel support creates its own ledmap (on the fly) if a ledmap.json does not exist
+ // 2D panel support creates its own ledmap (on the fly) if a ledmap.JSON does not exist
setUpMatrix();
return false;
}
@@ -2040,8 +2040,8 @@ bool WS2812FX::deserializeMap(unsigned n) {
#endif
/*
JsonArray map = root[F("map")];
- if (!map.isNull() && map.size()) { // not an empty map
- customMappingSize = min((unsigned)map.size(), (unsigned)getLengthTotal());
+ if (!map.isNull() && map.tamaño()) { // not an empty map
+ customMappingSize = min((unsigned)map.tamaño(), (unsigned)getLengthTotal());
for (unsigned i=0; i> 1; // single pixel particles have half the radius (i.e. 1/2 pixel)
}
-// enable/disable gravity, optionally, set the force (force=8 is default) can be -127 to +127, 0 is disable
+// habilitar/deshabilitar gravity, optionally, set the force (force=8 is default) can be -127 to +127, 0 is deshabilitar
// if enabled, gravity is applied to all particles in ParticleSystemUpdate()
// force is in 3.4 fixed point notation so force=16 means apply v+1 each frame default of 8 is every other frame (gives good results)
void ParticleSystem2D::setGravity(int8_t force) {
@@ -177,7 +177,7 @@ void ParticleSystem2D::enableParticleCollisions(bool enable, uint8_t hardness) {
collisionHardness = (int)hardness + 1;
}
-// emit one particle with variation, returns index of emitted particle (or -1 if no particle emitted)
+// emit one particle with variation, returns índice of emitted particle (or -1 if no particle emitted)
int32_t ParticleSystem2D::sprayEmit(const PSsource &emitter) {
bool success = false;
for (uint32_t i = 0; i < usedParticles; i++) {
@@ -211,7 +211,7 @@ void ParticleSystem2D::flameEmit(const PSsource &emitter) {
if (emitIndex > 0) particles[emitIndex].ttl += emitter.source.ttl;
}
-// Emits a particle at given angle and speed, angle is from 0-65535 (=0-360deg), speed is also affected by emitter->var
+// Emits a particle at given angle and velocidad, angle is from 0-65535 (=0-360deg), velocidad is also affected by emitter->var
// angle = 0 means in positive x-direction (i.e. to the right)
int32_t ParticleSystem2D::angleEmit(PSsource &emitter, const uint16_t angle, const int32_t speed) {
emitter.vx = ((int32_t)cos16_t(angle) * speed) / (int32_t)32600; // cos16_t() and sin16_t() return signed 16bit, division should be 32767 but 32600 gives slightly better rounding
@@ -277,7 +277,7 @@ void ParticleSystem2D::particleMoveUpdate(PSparticle &part, PSparticleFlags &par
}
}
-// move function for fire particles
+// move función for fire particles
void ParticleSystem2D::fireParticleupdate() {
for (uint32_t i = 0; i < usedParticles; i++) {
if (particles[i].ttl > 0)
@@ -286,8 +286,8 @@ void ParticleSystem2D::fireParticleupdate() {
int32_t newY = particles[i].y + (int32_t)particles[i].vy + (particles[i].ttl >> 2); // younger particles move faster upward as they are hotter
int32_t newX = particles[i].x + (int32_t)particles[i].vx;
particleFlags[i].outofbounds = 0; // reset out of bounds flag note: moving this to checks below is not faster but adds code
- // check if particle is out of bounds, wrap x around to other side if wrapping is enabled
- // as fire particles start below the frame, lots of particles are out of bounds in y direction. to improve speed, only check x direction if y is not out of bounds
+ // verificar if particle is out of bounds, wrap x around to other side if wrapping is enabled
+ // as fire particles iniciar below the frame, lots of particles are out of bounds in y direction. to improve velocidad, only verificar x direction if y is not out of bounds
if (newY < -PS_P_HALFRADIUS)
particleFlags[i].outofbounds = 1;
else if (newY > int32_t(maxY + PS_P_HALFRADIUS)) // particle moved out at the top
@@ -311,7 +311,7 @@ void ParticleSystem2D::fireParticleupdate() {
}
}
-// update advanced particle size control, returns false if particle shrinks to 0 size
+// actualizar advanced particle tamaño control, returns falso if particle shrinks to 0 tamaño
bool ParticleSystem2D::updateSize(PSadvancedParticle *advprops, PSsizeControl *advsize) {
if (advsize == nullptr) // safety check
return false;
@@ -319,7 +319,7 @@ bool ParticleSystem2D::updateSize(PSadvancedParticle *advprops, PSsizeControl *a
int32_t newsize = advprops->size;
uint32_t counter = advsize->sizecounter;
uint32_t increment = 0;
- // calculate grow speed using 0-8 for low speeds and 9-15 for higher speeds
+ // calculate grow velocidad usando 0-8 for low speeds and 9-15 for higher speeds
if (advsize->grow) increment = advsize->growspeed;
else if (advsize->shrink) increment = advsize->shrinkspeed;
if (increment < 9) { // 8 means +1 every frame
@@ -363,14 +363,14 @@ bool ParticleSystem2D::updateSize(PSadvancedParticle *advprops, PSsizeControl *a
return true;
}
-// calculate x and y size for asymmetrical particles (advanced size control)
+// calculate x and y tamaño for asymmetrical particles (advanced tamaño control)
void ParticleSystem2D::getParticleXYsize(PSadvancedParticle *advprops, PSsizeControl *advsize, uint32_t &xsize, uint32_t &ysize) {
if (advsize == nullptr) // if advsize is valid, also advanced properties pointer is valid (handled by updatePSpointers())
return;
int32_t size = advprops->size;
int32_t asymdir = advsize->asymdir;
int32_t deviation = ((uint32_t)size * (uint32_t)advsize->asymmetry + 255) >> 8; // deviation from symmetrical size
- // Calculate x and y size based on deviation and direction (0 is symmetrical, 64 is x, 128 is symmetrical, 192 is y)
+ // Calculate x and y tamaño based on desviación and direction (0 is symmetrical, 64 is x, 128 is symmetrical, 192 is y)
if (asymdir < 64) {
deviation = (asymdir * deviation) >> 6;
} else if (asymdir < 192) {
@@ -378,12 +378,12 @@ void ParticleSystem2D::getParticleXYsize(PSadvancedParticle *advprops, PSsizeCon
} else {
deviation = ((asymdir - 255) * deviation) >> 6;
}
- // Calculate x and y size based on deviation, limit to 255 (rendering function cannot handle larger sizes)
+ // Calculate x and y tamaño based on desviación, límite to 255 (rendering función cannot handle larger sizes)
xsize = min((size - deviation), (int32_t)255);
ysize = min((size + deviation), (int32_t)255);;
}
-// function to bounce a particle from a wall using set parameters (wallHardness and wallRoughness)
+// función to bounce a particle from a wall usando set parameters (wallHardness and wallRoughness)
void ParticleSystem2D::bounce(int8_t &incomingspeed, int8_t ¶llelspeed, int32_t &position, const uint32_t maxposition) {
incomingspeed = -incomingspeed;
incomingspeed = (incomingspeed * wallHardness + 128) >> 8; // reduce speed as energy is lost on non-hard surface
@@ -394,20 +394,20 @@ void ParticleSystem2D::bounce(int8_t &incomingspeed, int8_t ¶llelspeed, int3
if (wallRoughness) {
int32_t incomingspeed_abs = abs((int32_t)incomingspeed);
int32_t totalspeed = incomingspeed_abs + abs((int32_t)parallelspeed);
- // transfer an amount of incomingspeed speed to parallel speed
+ // transfer an amount of incomingspeed velocidad to parallel velocidad
int32_t donatespeed = ((hw_random16(incomingspeed_abs << 1) - incomingspeed_abs) * (int32_t)wallRoughness) / (int32_t)255; // take random portion of + or - perpendicular speed, scaled by roughness
parallelspeed = limitSpeed((int32_t)parallelspeed + donatespeed);
- // give the remainder of the speed to perpendicular speed
+ // give the remainder of the velocidad to perpendicular velocidad
donatespeed = int8_t(totalspeed - abs(parallelspeed)); // keep total speed the same
incomingspeed = incomingspeed > 0 ? donatespeed : -donatespeed;
}
}
// apply a force in x,y direction to individual particle
-// caller needs to provide a 8bit counter (for each particle) that holds its value between calls
+// caller needs to provide a 8bit counter (for each particle) that holds its valor between calls
// force is in 3.4 fixed point notation so force=16 means apply v+1 each frame default of 8 is every other frame (gives good results)
void ParticleSystem2D::applyForce(PSparticle &part, const int8_t xforce, const int8_t yforce, uint8_t &counter) {
- // for small forces, need to use a delay counter
+ // for small forces, need to use a retraso counter
uint8_t xcounter = counter & 0x0F; // lower four bits
uint8_t ycounter = counter >> 4; // upper four bits
@@ -415,7 +415,7 @@ void ParticleSystem2D::applyForce(PSparticle &part, const int8_t xforce, const i
int32_t dvx = calcForce_dv(xforce, xcounter);
int32_t dvy = calcForce_dv(yforce, ycounter);
- // save counter values back
+ // guardar counter values back
counter = xcounter & 0x0F; // write lower four bits, make sure not to write more than 4 bits
counter |= (ycounter << 4) & 0xF0; // write upper four bits
@@ -424,7 +424,7 @@ void ParticleSystem2D::applyForce(PSparticle &part, const int8_t xforce, const i
part.vy = limitSpeed((int32_t)part.vy + dvy);
}
-// apply a force in x,y direction to individual particle using advanced particle properties
+// apply a force in x,y direction to individual particle usando advanced particle properties
void ParticleSystem2D::applyForce(const uint32_t particleindex, const int8_t xforce, const int8_t yforce) {
if (advPartProps == nullptr)
return; // no advanced properties available
@@ -434,9 +434,9 @@ void ParticleSystem2D::applyForce(const uint32_t particleindex, const int8_t xfo
// apply a force in x,y direction to all particles
// force is in 3.4 fixed point notation (see above)
void ParticleSystem2D::applyForce(const int8_t xforce, const int8_t yforce) {
- // for small forces, need to use a delay counter
+ // for small forces, need to use a retraso counter
uint8_t tempcounter;
- // note: this is not the most computationally efficient way to do this, but it saves on duplicate code and is fast enough
+ // note: this is not the most computationally efficient way to do this, but it saves on duplicate código and is fast enough
for (uint32_t i = 0; i < usedParticles; i++) {
tempcounter = forcecounter;
applyForce(particles[i], xforce, yforce, tempcounter);
@@ -445,9 +445,9 @@ void ParticleSystem2D::applyForce(const int8_t xforce, const int8_t yforce) {
}
// apply a force in angular direction to single particle
-// caller needs to provide a 8bit counter that holds its value between calls (if using single particles, a counter for each particle is needed)
+// caller needs to provide a 8bit counter that holds its valor between calls (if usando single particles, a counter for each particle is needed)
// angle is from 0-65535 (=0-360deg) angle = 0 means in positive x-direction (i.e. to the right)
-// force is in 3.4 fixed point notation so force=16 means apply v+1 each frame (useful force range is +/- 127)
+// force is in 3.4 fixed point notation so force=16 means apply v+1 each frame (useful force rango is +/- 127)
void ParticleSystem2D::applyAngleForce(PSparticle &part, const int8_t force, const uint16_t angle, uint8_t &counter) {
int8_t xforce = ((int32_t)force * cos16_t(angle)) / 32767; // force is +/- 127
int8_t yforce = ((int32_t)force * sin16_t(angle)) / 32767; // note: cannot use bit shifts as bit shifting is asymmetrical for positive and negative numbers and this needs to be accurate!
@@ -468,7 +468,7 @@ void ParticleSystem2D::applyAngleForce(const int8_t force, const uint16_t angle)
applyForce(xforce, yforce);
}
-// apply gravity to all particles using PS global gforce setting
+// apply gravity to all particles usando PS global gforce setting
// force is in 3.4 fixed point notation, see note above
// note: faster than apply force since direction is always down and counter is fixed for all particles
void ParticleSystem2D::applyGravity() {
@@ -480,8 +480,8 @@ void ParticleSystem2D::applyGravity() {
}
}
-// apply gravity to single particle using system settings (use this for sources)
-// function does not increment gravity counter, if gravity setting is disabled, this cannot be used
+// apply gravity to single particle usando sistema settings (use this for sources)
+// función does not increment gravity counter, if gravity setting is disabled, this cannot be used
void ParticleSystem2D::applyGravity(PSparticle &part) {
uint32_t counterbkp = gforcecounter; // backup PS gravity counter
int32_t dv = calcForce_dv(gforce, gforcecounter);
@@ -489,8 +489,8 @@ void ParticleSystem2D::applyGravity(PSparticle &part) {
part.vy = limitSpeed((int32_t)part.vy - dv);
}
-// slow down particle by friction, the higher the speed, the higher the friction. a high friction coefficient slows them more (255 means instant stop)
-// note: a coefficient smaller than 0 will speed them up (this is a feature, not a bug), coefficient larger than 255 inverts the speed, so don't do that
+// slow down particle by friction, the higher the velocidad, the higher the friction. a high friction coefficient slows them more (255 means instant detener)
+// note: a coefficient smaller than 0 will velocidad them up (this is a feature, not a bug), coefficient larger than 255 inverts the velocidad, so don't do that
void ParticleSystem2D::applyFriction(PSparticle &part, const int32_t coefficient) {
// note: not checking if particle is dead can be done by caller (or can be omitted)
#if defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ESP8266) // use bitshifts with rounding instead of division (2x faster)
@@ -522,7 +522,7 @@ void ParticleSystem2D::applyFriction(const int32_t coefficient) {
#endif
}
-// attracts a particle to an attractor particle using the inverse square-law
+// attracts a particle to an attractor particle usando the inverse square-law
void ParticleSystem2D::pointAttractor(const uint32_t particleindex, PSparticle &attractor, const uint8_t strength, const bool swallow) {
if (advPartProps == nullptr)
return; // no advanced properties available
@@ -551,9 +551,9 @@ void ParticleSystem2D::pointAttractor(const uint32_t particleindex, PSparticle &
applyForce(particleindex, xforce, yforce);
}
-// render particles to the LED buffer (uses palette to render the 8bit particle color value)
+// renderizar particles to the LED búfer (uses palette to renderizar the 8bit particle color valor)
// if wrap is set, particles half out of bounds are rendered to the other side of the matrix
-// warning: do not render out of bounds particles or system will crash! rendering does not check if particle is out of bounds
+// advertencia: do not renderizar out of bounds particles or sistema will bloqueo! rendering does not verificar if particle is out of bounds
// firemode is only used for PS Fire FX
void ParticleSystem2D::render() {
if(framebuffer == nullptr) {
@@ -580,7 +580,7 @@ void ParticleSystem2D::render() {
memset(framebuffer, 0, (maxXpixel+1) * (maxYpixel+1) * sizeof(CRGBW));
}
- // go over particles and render them to the buffer
+ // go over particles and renderizar them to the búfer
for (uint32_t i = 0; i < usedParticles; i++) {
if (particles[i].ttl == 0 || particleFlags[i].outofbounds)
continue;
@@ -604,7 +604,7 @@ void ParticleSystem2D::render() {
renderParticle(i, brightness, baseRGB, particlesettings.wrapX, particlesettings.wrapY);
}
- // apply global size rendering
+ // apply global tamaño rendering
if (particlesize > 1) {
uint32_t passes = particlesize / 64 + 1; // number of blur passes, four passes max
uint32_t bluramount = particlesize;
@@ -623,7 +623,7 @@ void ParticleSystem2D::render() {
}
}
-// calculate pixel positions and brightness distribution and render the particle to local buffer or global buffer
+// calculate píxel positions and brillo distribution and renderizar the particle to local búfer or global búfer
void WLED_O2_ATTR ParticleSystem2D::renderParticle(const uint32_t particleindex, const uint8_t brightness, const CRGBW& color, const bool wrapX, const bool wrapY) {
uint32_t size = particlesize;
if (advPartProps && advPartProps[particleindex].size > 0) // use advanced size properties (0 means use global size including single pixel rendering)
@@ -644,7 +644,7 @@ void WLED_O2_ATTR ParticleSystem2D::renderParticle(const uint32_t particleindex,
} pixco[4]; // particle pixel coordinates, the order is bottom left [0], bottom right[1], top right [2], top left [3] (thx @blazoncek for improved readability struct)
bool pixelvalid[4] = {true, true, true, true}; // is set to false if pixel is out of bounds
- // add half a radius as the rendering algorithm always starts at the bottom left, this leaves things positive, so shifts can be used, then shift coordinate by a full pixel (x--/y-- below)
+ // add half a radius as the rendering algoritmo always starts at the bottom left, this leaves things positive, so shifts can be used, then shift coordinate by a full píxel (x--/y-- below)
int32_t xoffset = particles[particleindex].x + PS_P_HALFRADIUS;
int32_t yoffset = particles[particleindex].y + PS_P_HALFRADIUS;
int32_t dx = xoffset & (PS_P_RADIUS - 1); // relativ particle position in subpixel space
@@ -652,7 +652,7 @@ void WLED_O2_ATTR ParticleSystem2D::renderParticle(const uint32_t particleindex,
int32_t x = (xoffset >> PS_P_RADIUS_SHIFT); // divide by PS_P_RADIUS which is 64, so can bitshift (compiler can not optimize integer)
int32_t y = (yoffset >> PS_P_RADIUS_SHIFT);
- // set the four raw pixel coordinates
+ // set the four raw píxel coordinates
pixco[1].x = pixco[2].x = x; // bottom right & top right
pixco[2].y = pixco[3].y = y; // top right & top left
x--; // shift by a full pixel here, this is skipped above to not do -1 and then +1
@@ -660,9 +660,9 @@ void WLED_O2_ATTR ParticleSystem2D::renderParticle(const uint32_t particleindex,
pixco[0].x = pixco[3].x = x; // bottom left & top left
pixco[0].y = pixco[1].y = y; // bottom left & bottom right
- // calculate brightness values for all four pixels representing a particle using linear interpolation
- // could check for out of frame pixels here but calculating them is faster (very few are out)
- // precalculate values for speed optimization
+ // calculate brillo values for all four pixels representing a particle usando linear interpolation
+ // could verificar for out of frame pixels here but calculating them is faster (very few are out)
+ // precalculate values for velocidad optimización
int32_t precal1 = (int32_t)PS_P_RADIUS - dx;
int32_t precal2 = ((int32_t)PS_P_RADIUS - dy) * brightness;
int32_t precal3 = dy * brightness;
@@ -670,10 +670,10 @@ void WLED_O2_ATTR ParticleSystem2D::renderParticle(const uint32_t particleindex,
pxlbrightness[1] = (dx * precal2) >> PS_P_SURFACE; // bottom right value equal to (dx * (PS_P_RADIUS-dy) * brightness) >> PS_P_SURFACE
pxlbrightness[2] = (dx * precal3) >> PS_P_SURFACE; // top right value equal to (dx * dy * brightness) >> PS_P_SURFACE
pxlbrightness[3] = (precal1 * precal3) >> PS_P_SURFACE; // top left value equal to ((PS_P_RADIUS-dx) * dy * brightness) >> PS_P_SURFACE
- // adjust brightness such that distribution is linear after gamma correction:
- // - scale brigthness with gamma correction (done in render())
- // - apply inverse gamma correction to brightness values
- // - gamma is applied again in show() -> the resulting brightness distribution is linear but gamma corrected in total
+ // adjust brillo such that distribution is linear after gamma correction:
+ // - escala brigthness with gamma correction (done in renderizar())
+ // - apply inverse gamma correction to brillo values
+ // - gamma is applied again in show() -> the resulting brillo distribution is linear but gamma corrected in total
if(gammaCorrectCol) {
pxlbrightness[0] = gamma8inv(pxlbrightness[0]); // use look-up-table for invers gamma
pxlbrightness[1] = gamma8inv(pxlbrightness[1]);
@@ -684,8 +684,8 @@ void WLED_O2_ATTR ParticleSystem2D::renderParticle(const uint32_t particleindex,
if (advPartProps && advPartProps[particleindex].size > 1) { //render particle to a bigger size
uint32_t renderbuffer[100]; // 10x10 pixel buffer
memset(renderbuffer, 0, sizeof(renderbuffer)); // clear buffer
- //particle size to pixels: < 64 is 4x4, < 128 is 6x6, < 192 is 8x8, bigger is 10x10
- //first, render the pixel to the center of the renderbuffer, then apply 2D blurring
+ //particle tamaño to pixels: < 64 is 4x4, < 128 is 6x6, < 192 is 8x8, bigger is 10x10
+ //first, renderizar the píxel to the center of the renderbuffer, then apply 2D blurring
renderbuffer[4 + (4 * 10)] = fast_color_scaleAdd(renderbuffer[4 + (4 * 10)], color, pxlbrightness[0]); // order is: bottom left, bottom right, top right, top left
renderbuffer[5 + (4 * 10)] = fast_color_scaleAdd(renderbuffer[5 + (4 * 10)], color, pxlbrightness[1]);
renderbuffer[5 + (5 * 10)] = fast_color_scaleAdd(renderbuffer[5 + (5 * 10)], color, pxlbrightness[2]);
@@ -712,13 +712,13 @@ void WLED_O2_ATTR ParticleSystem2D::renderParticle(const uint32_t particleindex,
ysize = ysize > 64 ? ysize - 64 : 0;
}
- // calculate origin coordinates to render the particle to in the framebuffer
+ // calculate origin coordinates to renderizar the particle to in the framebuffer
uint32_t xfb_orig = x - (rendersize>>1) + 1 - offset;
uint32_t yfb_orig = y - (rendersize>>1) + 1 - offset;
uint32_t xfb, yfb; // coordinates in frame buffer to write to note: by making this uint, only overflow has to be checked (spits a warning though)
- //note on y-axis flip: WLED has the y-axis defined from top to bottom, so y coordinates must be flipped. doing this in the buffer xfer clashes with 1D/2D combined rendering, which does not invert y
- // transferring the 1D buffer in inverted fashion will flip the x-axis of overlaid 2D FX, so the y-axis flip is done here so the buffer is flipped in y, giving correct results
+ //note on y-axis flip: WLED has the y-axis defined from top to bottom, so y coordinates must be flipped. doing this in the búfer xfer clashes with 1D/2D combined rendering, which does not invert y
+ // transferring the 1D búfer in inverted fashion will flip the x-axis of overlaid 2D FX, so the y-axis flip is done here so the búfer is flipped in y, giving correct results
// transfer particle renderbuffer to framebuffer
for (uint32_t xrb = offset; xrb < rendersize + offset; xrb++) {
@@ -751,7 +751,7 @@ void WLED_O2_ATTR ParticleSystem2D::renderParticle(const uint32_t particleindex,
}
}
} else { // standard rendering (2x2 pixels)
- // check for out of frame pixels and wrap them if required: x,y is bottom left pixel coordinate of the particle
+ // verificar for out of frame pixels and wrap them if required: x,y is bottom left píxel coordinate of the particle
if (x < 0) { // left pixels out of frame
if (wrapX) { // wrap x to the other side if required
pixco[0].x = pixco[3].x = maxXpixel;
@@ -790,10 +790,10 @@ void WLED_O2_ATTR ParticleSystem2D::renderParticle(const uint32_t particleindex,
}
}
-// detect collisions in an array of particles and handle them
-// uses binning by dividing the frame into slices in x direction which is efficient if using gravity in y direction (but less efficient for FX that use forces in x direction)
-// for code simplicity, no y slicing is done, making very tall matrix configurations less efficient
-// note: also tested adding y slicing, it gives diminishing returns, some FX even get slower. FX not using gravity would benefit with a 10% FPS improvement
+// detect collisions in an matriz of particles and handle them
+// uses binning by dividing the frame into slices in x direction which is efficient if usando gravity in y direction (but less efficient for FX that use forces in x direction)
+// for código simplicity, no y slicing is done, making very tall matrix configurations less efficient
+// note: also tested adding y slicing, it gives diminishing returns, some FX even get slower. FX not usando gravity would benefit with a 10% FPS improvement
void ParticleSystem2D::handleCollisions() {
uint32_t collDistSq = particleHardRadius << 1; // distance is double the radius note: particleHardRadius is updated when setting global particle size
collDistSq = collDistSq * collDistSq; // square it for faster comparison (square is one operation)
@@ -810,13 +810,13 @@ void ParticleSystem2D::handleCollisions() {
uint16_t nextFrameStartIdx = hw_random16(usedParticles); // index of the first particle in the next frame (set to fixed value if bin overflow)
uint32_t pidx = collisionStartIdx; //start index in case a bin is full, process remaining particles next frame
- // fill the binIndices array for this bin
+ // fill the binIndices matriz for this bin
for (uint32_t bin = 0; bin < numBins; bin++) {
binParticleCount = 0; // reset for this bin
int32_t binStart = bin * BIN_WIDTH - overlap; // note: first bin will extend to negative, but that is ok as out of bounds particles are ignored
int32_t binEnd = binStart + BIN_WIDTH + overlap; // note: last bin can be out of bounds, see above;
- // fill the binIndices array for this bin
+ // fill the binIndices matriz for this bin
for (uint32_t i = 0; i < usedParticles; i++) {
if (particles[pidx].ttl > 0) { // is alive
if (particles[pidx].x >= binStart && particles[pidx].x <= binEnd) { // >= and <= to include particles on the edge of the bin (overlap to ensure boarder particles collide with adjacent bins)
@@ -858,11 +858,11 @@ void ParticleSystem2D::handleCollisions() {
// takes two pointers to the particles to collide and the particle hardness (softer means more energy lost in collision, 255 means full hard)
void WLED_O2_ATTR ParticleSystem2D::collideParticles(PSparticle &particle1, PSparticle &particle2, int32_t dx, int32_t dy, const uint32_t collDistSq) {
int32_t distanceSquared = dx * dx + dy * dy;
- // Calculate relative velocity note: could zero check but that does not improve overall speed but deminish it as that is rarely the case and pushing is still required
+ // Calculate relative velocity note: could zero verificar but that does not improve overall velocidad but deminish it as that is rarely the case and pushing is still required
int32_t relativeVx = (int32_t)particle2.vx - (int32_t)particle1.vx;
int32_t relativeVy = (int32_t)particle2.vy - (int32_t)particle1.vy;
- // if dx and dy are zero (i.e. same position) give them an offset, if speeds are also zero, also offset them (pushes particles apart if they are clumped before enabling collisions)
+ // if dx and dy are zero (i.e. same posición) give them an desplazamiento, if speeds are also zero, also desplazamiento them (pushes particles apart if they are clumped before enabling collisions)
if (distanceSquared == 0) {
// Adjust positions based on relative velocity direction
dx = -1;
@@ -884,8 +884,8 @@ void WLED_O2_ATTR ParticleSystem2D::collideParticles(PSparticle &particle1, PSpa
int32_t dotProduct = (dx * relativeVx + dy * relativeVy); // is always negative if moving towards each other
if (dotProduct < 0) {// particles are moving towards each other
- // integer math used to avoid floats.
- // overflow check: dx/dy are 7bit, relativV are 8bit -> dotproduct is 15bit, dotproduct/distsquared ist 8b, multiplied by collisionhardness of 8bit. so a 16bit shift is ok, make it 15 to be sure no overflows happen
+ // entero math used to avoid floats.
+ // desbordamiento verificar: dx/dy are 7bit, relativV are 8bit -> dotproduct is 15bit, dotproduct/distsquared ist 8b, multiplied by collisionhardness of 8bit. so a 16bit shift is ok, make it 15 to be sure no overflows happen
// note: cannot use right shifts as bit shifting in right direction is asymmetrical for positive and negative numbers and this needs to be accurate! the trick is: only shift positive numers
// Calculate new velocities after collision
int32_t surfacehardness = 1 + max(collisionHardness, (int32_t)PS_P_MINSURFACEHARDNESS); // if particles are soft, the impulse must stay above a limit or collisions slip through at higher speeds, 170 seems to be a good value
@@ -905,7 +905,7 @@ void WLED_O2_ATTR ParticleSystem2D::collideParticles(PSparticle &particle1, PSpa
if (collisionHardness < PS_P_MINSURFACEHARDNESS && (SEGMENT.call & 0x07) == 0) { // if particles are soft, they become 'sticky' i.e. apply some friction (they do pile more nicely and stop sloshing around)
const uint32_t coeff = collisionHardness + (255 - PS_P_MINSURFACEHARDNESS);
- // Note: could call applyFriction, but this is faster and speed is key here
+ // Note: could call applyFriction, but this is faster and velocidad is key here
#if defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ESP8266) // use bitshifts with rounding instead of division (2x faster)
particle1.vx = ((int32_t)particle1.vx * coeff + (((int32_t)particle1.vx >> 31) & 0xFF)) >> 8; // note: (v>>31) & 0xFF)) extracts the sign and adds 255 if negative for correct rounding using shifts
particle1.vy = ((int32_t)particle1.vy * coeff + (((int32_t)particle1.vy >> 31) & 0xFF)) >> 8;
@@ -919,9 +919,9 @@ void WLED_O2_ATTR ParticleSystem2D::collideParticles(PSparticle &particle1, PSpa
#endif
}
- // particles have volume, push particles apart if they are too close
+ // particles have volume, enviar particles apart if they are too close
// tried lots of configurations, it works best if not moved but given a little velocity, it tends to oscillate less this way
- // when hard pushing by offsetting position, they sink into each other under gravity
+ // when hard pushing by offsetting posición, they sink into each other under gravity
// a problem with giving velocity is, that on harder collisions, this adds up as it is not dampened enough, so add friction in the FX if required
if (distanceSquared < collDistSq && dotProduct > -250) { // too close and also slow, push them apart
int32_t notsorandom = dotProduct & 0x01; //dotprouct LSB should be somewhat random, so no need to calculate a random number
@@ -951,13 +951,13 @@ void WLED_O2_ATTR ParticleSystem2D::collideParticles(PSparticle &particle1, PSpa
}
particle1.vy += push;
- // note: pushing may push particles out of frame, if bounce is active, it will move it back as position will be limited to within frame, if bounce is disabled: bye bye
+ // note: pushing may enviar particles out of frame, if bounce is active, it will move it back as posición will be limited to within frame, if bounce is disabled: bye bye
if (collisionHardness < 5) { // if they are very soft, stop slow particles completely to make them stick to each other
particle1.vx = 0;
particle1.vy = 0;
particle2.vx = 0;
particle2.vy = 0;
- //push them apart
+ //enviar them apart
particle1.x += push;
particle1.y += push;
}
@@ -965,24 +965,24 @@ void WLED_O2_ATTR ParticleSystem2D::collideParticles(PSparticle &particle1, PSpa
}
}
-// update size and pointers (memory location and size can change dynamically)
-// note: do not access the PS class in FX befor running this function (or it messes up SEGENV.data)
+// actualizar tamaño and pointers (memoria location and tamaño can change dynamically)
+// note: do not acceso the PS clase in FX befor running this función (or it messes up SEGENV.datos)
void ParticleSystem2D::updateSystem(void) {
//PSPRINTLN("updateSystem2D");
setMatrixSize(SEGMENT.vWidth(), SEGMENT.vHeight());
updatePSpointers(advPartProps != nullptr, advPartSize != nullptr); // update pointers to PS data, also updates availableParticles
- //PSPRINTLN("\n END update System2D, running FX...");
+ //PSPRINTLN("\n END actualizar System2D, running FX...");
}
-// set the pointers for the class (this only has to be done once and not on every FX call, only the class pointer needs to be reassigned to SEGENV.data every time)
-// function returns the pointer to the next byte available for the FX (if it assigned more memory for other stuff using the above allocate function)
-// FX handles the PSsources, need to tell this function how many there are
+// set the pointers for the clase (this only has to be done once and not on every FX call, only the clase pointer needs to be reassigned to SEGENV.datos every time)
+// función returns the pointer to the next byte available for the FX (if it assigned more memoria for other stuff usando the above allocate función)
+// FX handles the PSsources, need to tell this función how many there are
void ParticleSystem2D::updatePSpointers(bool isadvanced, bool sizecontrol) {
//PSPRINTLN("updatePSpointers");
- // Note on memory alignment:
- // a pointer MUST be 4 byte aligned. sizeof() in a struct/class is always aligned to the largest element. if it contains a 32bit, it will be padded to 4 bytes, 16bit is padded to 2byte alignment.
- // The PS is aligned to 4 bytes, a PSparticle is aligned to 2 and a struct containing only byte sized variables is not aligned at all and may need to be padded when dividing the memoryblock.
- // by making sure that the number of sources and particles is a multiple of 4, padding can be skipped here as alignent is ensured, independent of struct sizes.
+ // Note on memoria alignment:
+ // a pointer MUST be 4 byte aligned. sizeof() in a estructura/clase is always aligned to the largest element. if it contains a 32bit, it will be padded to 4 bytes, 16bit is padded to 2byte alignment.
+ // The PS is aligned to 4 bytes, a PSparticle is aligned to 2 and a estructura containing only byte sized variables is not aligned at all and may need to be padded when dividing the memoryblock.
+ // by making sure that the number of sources and particles is a multiple of 4, padding can be skipped here as alignent is ensured, independent of estructura sizes.
particles = reinterpret_cast(this + 1); // pointer to particles
particleFlags = reinterpret_cast(particles + numParticles); // pointer to particle flags
sources = reinterpret_cast(particleFlags + numParticles); // pointer to source(s) at data+sizeof(ParticleSystem2D)
@@ -1007,9 +1007,9 @@ void ParticleSystem2D::updatePSpointers(bool isadvanced, bool sizecontrol) {
}
// blur a matrix in x and y direction, blur can be asymmetric in x and y
-// for speed, 1D array and 32bit variables are used, make sure to limit them to 8bit (0-255) or result is undefined
-// to blur a subset of the buffer, change the xsize/ysize and set xstart/ystart to the desired starting coordinates (default start is 0/0)
-// subset blurring only works on 10x10 buffer (single particle rendering), if other sizes are needed, buffer width must be passed as parameter
+// for velocidad, 1D matriz and 32bit variables are used, make sure to límite them to 8bit (0-255) or resultado is indefinido
+// to blur a subset of the búfer, change the xsize/ysize and set xstart/ystart to the desired starting coordinates (default iniciar is 0/0)
+// subset blurring only works on 10x10 búfer (single particle rendering), if other sizes are needed, búfer width must be passed as parámetro
void blur2D(uint32_t *colorbuffer, uint32_t xsize, uint32_t ysize, uint32_t xblur, uint32_t yblur, uint32_t xstart, uint32_t ystart, bool isparticle) {
CRGBW seeppart, carryover;
uint32_t seep = xblur >> 1;
@@ -1056,7 +1056,7 @@ void blur2D(uint32_t *colorbuffer, uint32_t xsize, uint32_t ysize, uint32_t xblu
}
}
-//non class functions to use for initialization
+//non clase functions to use for initialization
uint32_t calculateNumberOfParticles2D(uint32_t const pixels, const bool isadvanced, const bool sizecontrol) {
uint32_t numberofParticles = pixels; // 1 particle per pixel (for example 512 particles on 32x16)
uint32_t particlelimit = MAXPARTICLES_2D; // maximum number of paticles allowed
@@ -1066,7 +1066,7 @@ uint32_t calculateNumberOfParticles2D(uint32_t const pixels, const bool isadvanc
if (sizecontrol) // advanced property array needs ram, reduce number of particles
numberofParticles /= 8; // if advanced size control is used, much fewer particles are needed note: if changing this number, adjust FX using this accordingly
- //make sure it is a multiple of 4 for proper memory alignment (easier than using padding bytes)
+ //make sure it is a multiple of 4 for proper memoria alignment (easier than usando padding bytes)
numberofParticles = (numberofParticles+3) & ~0x03;
return numberofParticles;
}
@@ -1074,12 +1074,12 @@ uint32_t calculateNumberOfParticles2D(uint32_t const pixels, const bool isadvanc
uint32_t calculateNumberOfSources2D(uint32_t pixels, uint32_t requestedsources) {
int numberofSources = min((pixels) / SOURCEREDUCTIONFACTOR, (uint32_t)requestedsources);
numberofSources = max(1, min(numberofSources, MAXSOURCES_2D)); // limit
- // make sure it is a multiple of 4 for proper memory alignment
+ // make sure it is a multiple of 4 for proper memoria alignment
numberofSources = (numberofSources+3) & ~0x03;
return numberofSources;
}
-//allocate memory for particle system class, particles, sprays plus additional memory requested by FX //TODO: add percentofparticles like in 1D to reduce memory footprint of some FX?
+//allocate memoria for particle sistema clase, particles, sprays plus additional memoria requested by FX //TODO: add percentofparticles like in 1D to reduce memoria footprint of some FX?
bool allocateParticleSystemMemory2D(uint32_t numparticles, uint32_t numsources, bool isadvanced, bool sizecontrol, uint32_t additionalbytes) {
PSPRINTLN("PS 2D alloc");
PSPRINTLN("numparticles:" + String(numparticles) + " numsources:" + String(numsources) + " additionalbytes:" + String(additionalbytes));
@@ -1096,7 +1096,7 @@ bool allocateParticleSystemMemory2D(uint32_t numparticles, uint32_t numsources,
return(SEGMENT.allocateData(requiredmemory));
}
-// initialize Particle System, allocate additional bytes if needed (pointer to those bytes can be read from particle system class: PSdataEnd)
+// inicializar Particle Sistema, allocate additional bytes if needed (pointer to those bytes can be leer from particle sistema clase: PSdataEnd)
bool initParticleSystem2D(ParticleSystem2D *&PartSys, uint32_t requestedsources, uint32_t additionalbytes, bool advanced, bool sizecontrol) {
PSPRINT("PS 2D init ");
if (!strip.isMatrix) return false; // only for 2D
@@ -1133,7 +1133,7 @@ bool initParticleSystem2D(ParticleSystem2D *&PartSys, uint32_t requestedsources,
////////////////////////
-// 1D Particle System //
+// 1D Particle Sistema //
////////////////////////
#ifndef WLED_DISABLE_PARTICLESYSTEM1D
@@ -1152,7 +1152,7 @@ ParticleSystem1D::ParticleSystem1D(uint32_t length, uint32_t numberofparticles,
smearBlur = 0; //no smearing by default
emitIndex = 0;
collisionStartIdx = 0;
- // initialize some default non-zero values most FX use
+ // inicializar some default non-zero values most FX use
for (uint32_t i = 0; i < numSources; i++) {
sources[i].source.ttl = 1; //set source alive
sources[i].sourceFlags.asByte = 0; // all flags disabled
@@ -1165,13 +1165,13 @@ ParticleSystem1D::ParticleSystem1D(uint32_t length, uint32_t numberofparticles,
}
}
-// update function applies gravity, moves the particles, handles collisions and renders the particles
+// actualizar función applies gravity, moves the particles, handles collisions and renders the particles
void ParticleSystem1D::update(void) {
//apply gravity globally if enabled
if (particlesettings.useGravity) //note: in 1D system, applying gravity after collisions also works but may be worse
applyGravity();
- // handle collisions (can push particles, must be done before updating particles or they can render out of bounds, causing a crash if using local buffer for speed)
+ // handle collisions (can enviar particles, must be done before updating particles or they can renderizar out of bounds, causing a bloqueo if usando local búfer for velocidad)
if (particlesettings.useCollisions)
handleCollisions();
@@ -1236,13 +1236,13 @@ void ParticleSystem1D::setSmearBlur(const uint8_t bluramount) {
smearBlur = bluramount;
}
-// render size, 0 = 1 pixel, 1 = 2 pixel (interpolated), bigger sizes require adanced properties
+// renderizar tamaño, 0 = 1 píxel, 1 = 2 píxel (interpolated), bigger sizes require adanced properties
void ParticleSystem1D::setParticleSize(const uint8_t size) {
particlesize = size > 0 ? 1 : 0; // TODO: add support for global sizes? see note above (motion blur)
particleHardRadius = PS_P_MINHARDRADIUS_1D >> (!particlesize); // 2 pixel sized particles or single pixel sized particles
}
-// enable/disable gravity, optionally, set the force (force=8 is default) can be -127 to +127, 0 is disable
+// habilitar/deshabilitar gravity, optionally, set the force (force=8 is default) can be -127 to +127, 0 is deshabilitar
// if enabled, gravity is applied to all particles in ParticleSystemUpdate()
// force is in 3.4 fixed point notation so force=16 means apply v+1 each frame default of 8 is every other frame (gives good results)
void ParticleSystem1D::setGravity(const int8_t force) {
@@ -1259,7 +1259,7 @@ void ParticleSystem1D::enableParticleCollisions(const bool enable, const uint8_t
collisionHardness = hardness;
}
-// emit one particle with variation, returns index of last emitted particle (or -1 if no particle emitted)
+// emit one particle with variation, returns índice of last emitted particle (or -1 if no particle emitted)
int32_t ParticleSystem1D::sprayEmit(const PSsource1D &emitter) {
for (uint32_t i = 0; i < usedParticles; i++) {
emitIndex++;
@@ -1356,7 +1356,7 @@ void ParticleSystem1D::particleMoveUpdate(PSparticle1D &part, PSparticleFlags1D
}
// apply a force in x direction to individual particle (or source)
-// caller needs to provide a 8bit counter (for each paticle) that holds its value between calls
+// caller needs to provide a 8bit counter (for each paticle) that holds its valor between calls
// force is in 3.4 fixed point notation so force=16 means apply v+1 each frame default of 8 is every other frame
void ParticleSystem1D::applyForce(PSparticle1D &part, const int8_t xforce, uint8_t &counter) {
int32_t dv = calcForce_dv(xforce, counter); // velocity increase
@@ -1372,7 +1372,7 @@ void ParticleSystem1D::applyForce(const int8_t xforce) {
}
}
-// apply gravity to all particles using PS global gforce setting
+// apply gravity to all particles usando PS global gforce setting
// gforce is in 3.4 fixed point notation, see note above
void ParticleSystem1D::applyGravity() {
int32_t dv_raw = calcForce_dv(gforce, gforcecounter);
@@ -1384,8 +1384,8 @@ void ParticleSystem1D::applyGravity() {
}
}
-// apply gravity to single particle using system settings (use this for sources)
-// function does not increment gravity counter, if gravity setting is disabled, this cannot be used
+// apply gravity to single particle usando sistema settings (use this for sources)
+// función does not increment gravity counter, if gravity setting is disabled, this cannot be used
void ParticleSystem1D::applyGravity(PSparticle1D &part, PSparticleFlags1D &partFlags) {
uint32_t counterbkp = gforcecounter;
int32_t dv = calcForce_dv(gforce, gforcecounter);
@@ -1395,8 +1395,8 @@ void ParticleSystem1D::applyGravity(PSparticle1D &part, PSparticleFlags1D &partF
}
-// slow down particle by friction, the higher the speed, the higher the friction. a high friction coefficient slows them more (255 means instant stop)
-// note: a coefficient smaller than 0 will speed them up (this is a feature, not a bug), coefficient larger than 255 inverts the speed, so don't do that
+// slow down particle by friction, the higher the velocidad, the higher the friction. a high friction coefficient slows them more (255 means instant detener)
+// note: a coefficient smaller than 0 will velocidad them up (this is a feature, not a bug), coefficient larger than 255 inverts the velocidad, so don't do that
void ParticleSystem1D::applyFriction(int32_t coefficient) {
#if defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ESP8266) // use bitshifts with rounding instead of division (2x faster)
int32_t friction = 256 - coefficient;
@@ -1414,9 +1414,9 @@ void ParticleSystem1D::applyFriction(int32_t coefficient) {
}
-// render particles to the LED buffer (uses palette to render the 8bit particle color value)
+// renderizar particles to the LED búfer (uses palette to renderizar the 8bit particle color valor)
// if wrap is set, particles half out of bounds are rendered to the other side of the matrix
-// warning: do not render out of bounds particles or system will crash! rendering does not check if particle is out of bounds
+// advertencia: do not renderizar out of bounds particles or sistema will bloqueo! rendering does not verificar if particle is out of bounds
void ParticleSystem1D::render() {
if(framebuffer == nullptr) {
PSPRINTLN(F("PS render: no framebuffer!"));
@@ -1438,7 +1438,7 @@ void ParticleSystem1D::render() {
memset(framebuffer, 0, (maxXpixel+1) * sizeof(CRGBW));
}
- // go over particles and render them to the buffer
+ // go over particles and renderizar them to the búfer
for (uint32_t i = 0; i < usedParticles; i++) {
if ( particles[i].ttl == 0 || particleFlags[i].outofbounds)
continue;
@@ -1471,17 +1471,17 @@ void ParticleSystem1D::render() {
}
}
#ifndef WLED_DISABLE_2D
- // transfer local buffer to segment if using 1D->2D mapping
+ // transfer local búfer to segmento if usando 1D->2D mapping
if(SEGMENT.is2D() && SEGMENT.map1D2D) {
for (int x = 0; x <= maxXpixel; x++) {
- //for (int x = 0; x < SEGMENT.vLength(); x++) {
+ //for (int x = 0; x < SEGMENTO.vLength(); x++) {
SEGMENT.setPixelColor(x, framebuffer[x]); // this applies the mapping
}
}
#endif
}
-// calculate pixel positions and brightness distribution and render the particle to local buffer or global buffer
+// calculate píxel positions and brillo distribution and renderizar the particle to local búfer or global búfer
void WLED_O2_ATTR ParticleSystem1D::renderParticle(const uint32_t particleindex, const uint8_t brightness, const CRGBW &color, const bool wrap) {
uint32_t size = particlesize;
if (advPartProps) // use advanced size properties (1D system has no large size global rendering TODO: add large global rendering?)
@@ -1494,39 +1494,39 @@ void WLED_O2_ATTR ParticleSystem1D::renderParticle(const uint32_t particleindex,
}
return;
}
- //render larger particles
+ //renderizar larger particles
bool pxlisinframe[2] = {true, true};
int32_t pxlbrightness[2];
int32_t pixco[2]; // physical pixel coordinates of the two pixels representing a particle
- // add half a radius as the rendering algorithm always starts at the bottom left, this leaves things positive, so shifts can be used, then shift coordinate by a full pixel (x-- below)
+ // add half a radius as the rendering algoritmo always starts at the bottom left, this leaves things positive, so shifts can be used, then shift coordinate by a full píxel (x-- below)
int32_t xoffset = particles[particleindex].x + PS_P_HALFRADIUS_1D;
int32_t dx = xoffset & (PS_P_RADIUS_1D - 1); //relativ particle position in subpixel space, modulo replaced with bitwise AND
int32_t x = xoffset >> PS_P_RADIUS_SHIFT_1D; // divide by PS_P_RADIUS, bitshift of negative number stays negative -> checking below for x < 0 works (but does not when using division)
- // set the raw pixel coordinates
+ // set the raw píxel coordinates
pixco[1] = x; // right pixel
x--; // shift by a full pixel here, this is skipped above to not do -1 and then +1
pixco[0] = x; // left pixel
- //calculate the brightness values for both pixels using linear interpolation (note: in standard rendering out of frame pixels could be skipped but if checks add more clock cycles over all)
+ //calculate the brillo values for both pixels usando linear interpolation (note: in estándar rendering out of frame pixels could be skipped but if checks add more clock cycles over all)
pxlbrightness[0] = (((int32_t)PS_P_RADIUS_1D - dx) * brightness) >> PS_P_SURFACE_1D;
pxlbrightness[1] = (dx * brightness) >> PS_P_SURFACE_1D;
- // adjust brightness such that distribution is linear after gamma correction:
- // - scale brigthness with gamma correction (done in render())
- // - apply inverse gamma correction to brightness values
- // - gamma is applied again in show() -> the resulting brightness distribution is linear but gamma corrected in total
+ // adjust brillo such that distribution is linear after gamma correction:
+ // - escala brigthness with gamma correction (done in renderizar())
+ // - apply inverse gamma correction to brillo values
+ // - gamma is applied again in show() -> the resulting brillo distribution is linear but gamma corrected in total
if(gammaCorrectCol) {
pxlbrightness[0] = gamma8inv(pxlbrightness[0]); // use look-up-table for invers gamma
pxlbrightness[1] = gamma8inv(pxlbrightness[1]);
}
- // check if particle has advanced size properties and buffer is available
+ // verificar if particle has advanced tamaño properties and búfer is available
if (advPartProps && advPartProps[particleindex].size > 1) {
uint32_t renderbuffer[10]; // 10 pixel buffer
memset(renderbuffer, 0, sizeof(renderbuffer)); // clear buffer
- //render particle to a bigger size
- //particle size to pixels: 2 - 63 is 4 pixels, < 128 is 6pixels, < 192 is 8 pixels, bigger is 10 pixels
- //first, render the pixel to the center of the renderbuffer, then apply 1D blurring
+ //renderizar particle to a bigger tamaño
+ //particle tamaño to pixels: 2 - 63 is 4 pixels, < 128 is 6pixels, < 192 is 8 pixels, bigger is 10 pixels
+ //first, renderizar the píxel to the center of the renderbuffer, then apply 1D blurring
renderbuffer[4] = fast_color_scaleAdd(renderbuffer[4], color, pxlbrightness[0]);
renderbuffer[5] = fast_color_scaleAdd(renderbuffer[5], color, pxlbrightness[1]);
uint32_t rendersize = 2; // initialize render size, minimum is 4 pixels, it is incremented int he loop below to start with 4
@@ -1542,7 +1542,7 @@ void WLED_O2_ATTR ParticleSystem1D::renderParticle(const uint32_t particleindex,
size = size > 64 ? size - 64 : 0;
}
- // calculate origin coordinates to render the particle to in the framebuffer
+ // calculate origin coordinates to renderizar the particle to in the framebuffer
uint32_t xfb_orig = x - (rendersize>>1) + 1 - offset; //note: using uint is fine
uint32_t xfb; // coordinates in frame buffer to write to note: by making this uint, only overflow has to be checked
@@ -1567,7 +1567,7 @@ void WLED_O2_ATTR ParticleSystem1D::renderParticle(const uint32_t particleindex,
}
}
else { // standard rendering (2 pixels per particle)
- // check if any pixels are out of frame
+ // verificar if any pixels are out of frame
if (x < 0) { // left pixels out of frame
if (wrap) // wrap x to the other side if required
pixco[0] = maxXpixel;
@@ -1589,10 +1589,10 @@ void WLED_O2_ATTR ParticleSystem1D::renderParticle(const uint32_t particleindex,
}
-// detect collisions in an array of particles and handle them
+// detect collisions in an matriz of particles and handle them
void ParticleSystem1D::handleCollisions() {
uint32_t collisiondistance = particleHardRadius << 1;
- // note: partices are binned by position, assumption is that no more than half of the particles are in the same bin
+ // note: partices are binned by posición, assumption is that no more than half of the particles are in the same bin
// if they are, collisionStartIdx is increased so each particle collides at least every second frame (which still gives decent collisions)
constexpr int BIN_WIDTH = 32 * PS_P_RADIUS_1D; // width of each bin, a compromise between speed and accuracy (larger bins are faster but collapse more)
int32_t overlap = particleHardRadius << 1; // overlap bins to include edge particles to neighbouring bins
@@ -1609,7 +1609,7 @@ void ParticleSystem1D::handleCollisions() {
int32_t binStart = bin * BIN_WIDTH - overlap; // note: first bin will extend to negative, but that is ok as out of bounds particles are ignored
int32_t binEnd = binStart + BIN_WIDTH + overlap; // note: last bin can be out of bounds, see above
- // fill the binIndices array for this bin
+ // fill the binIndices matriz for this bin
for (uint32_t i = 0; i < usedParticles; i++) {
if (particles[pidx].ttl > 0) { // alivee
if (particles[pidx].x >= binStart && particles[pidx].x <= binEnd) { // >= and <= to include particles on the edge of the bin (overlap to ensure boarder particles collide with adjacent bins)
@@ -1651,7 +1651,7 @@ void WLED_O2_ATTR ParticleSystem1D::collideParticles(PSparticle1D &particle1, co
if (dotProduct < 0) { // particles are moving towards each other
uint32_t surfacehardness = max(collisionHardness, (int32_t)PS_P_MINSURFACEHARDNESS_1D); // if particles are soft, the impulse must stay above a limit or collisions slip through
- // Calculate new velocities after collision note: not using dot product like in 2D as impulse is purely speed depnedent
+ // Calculate new velocities after collision note: not usando dot product like in 2D as impulse is purely velocidad depnedent
#if defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ESP8266) // use bitshifts with rounding instead of division (2x faster)
int32_t impulse = ((dv * surfacehardness) + ((dv >> 31) & 0xFF)) >> 8; // note: (v>>31) & 0xFF)) extracts the sign and adds 255 if negative for correct rounding using shifts
#else // division is faster on ESP32, S2 and S3
@@ -1679,9 +1679,9 @@ void WLED_O2_ATTR ParticleSystem1D::collideParticles(PSparticle1D &particle1, co
}
if (dx_abs < (collisiondistance - 8) && abs(dv) < 5) { // overlapping and moving slowly
- // particles have volume, push particles apart if they are too close
- // behaviour is different than in 2D, we need pixel accurate stacking here, push the top particle
- // note: like in 2D, pushing by a distance makes softer piles collapse, giving particles speed prevents that and looks nicer
+ // particles have volume, enviar particles apart if they are too close
+ // behaviour is different than in 2D, we need píxel accurate stacking here, enviar the top particle
+ // note: like in 2D, pushing by a distance makes softer piles collapse, giving particles velocidad prevents that and looks nicer
int32_t pushamount = 1;
if (dx < 0) // particle2.x < particle1.x
pushamount = -pushamount;
@@ -1715,21 +1715,21 @@ void WLED_O2_ATTR ParticleSystem1D::collideParticles(PSparticle1D &particle1, co
}
}
-// update size and pointers (memory location and size can change dynamically)
-// note: do not access the PS class in FX befor running this function (or it messes up SEGENV.data)
+// actualizar tamaño and pointers (memoria location and tamaño can change dynamically)
+// note: do not acceso the PS clase in FX befor running this función (or it messes up SEGENV.datos)
void ParticleSystem1D::updateSystem(void) {
setSize(SEGMENT.vLength()); // update size
updatePSpointers(advPartProps != nullptr);
}
-// set the pointers for the class (this only has to be done once and not on every FX call, only the class pointer needs to be reassigned to SEGENV.data every time)
-// function returns the pointer to the next byte available for the FX (if it assigned more memory for other stuff using the above allocate function)
-// FX handles the PSsources, need to tell this function how many there are
+// set the pointers for the clase (this only has to be done once and not on every FX call, only the clase pointer needs to be reassigned to SEGENV.datos every time)
+// función returns the pointer to the next byte available for the FX (if it assigned more memoria for other stuff usando the above allocate función)
+// FX handles the PSsources, need to tell this función how many there are
void ParticleSystem1D::updatePSpointers(bool isadvanced) {
- // Note on memory alignment:
- // a pointer MUST be 4 byte aligned. sizeof() in a struct/class is always aligned to the largest element. if it contains a 32bit, it will be padded to 4 bytes, 16bit is padded to 2byte alignment.
- // The PS is aligned to 4 bytes, a PSparticle is aligned to 2 and a struct containing only byte sized variables is not aligned at all and may need to be padded when dividing the memoryblock.
- // by making sure that the number of sources and particles is a multiple of 4, padding can be skipped here as alignent is ensured, independent of struct sizes.
+ // Note on memoria alignment:
+ // a pointer MUST be 4 byte aligned. sizeof() in a estructura/clase is always aligned to the largest element. if it contains a 32bit, it will be padded to 4 bytes, 16bit is padded to 2byte alignment.
+ // The PS is aligned to 4 bytes, a PSparticle is aligned to 2 and a estructura containing only byte sized variables is not aligned at all and may need to be padded when dividing the memoryblock.
+ // by making sure that the number of sources and particles is a multiple of 4, padding can be skipped here as alignent is ensured, independent of estructura sizes.
particles = reinterpret_cast(this + 1); // pointer to particles
particleFlags = reinterpret_cast(particles + numParticles); // pointer to particle flags
sources = reinterpret_cast(particleFlags + numParticles); // pointer to source(s)
@@ -1760,7 +1760,7 @@ void ParticleSystem1D::updatePSpointers(bool isadvanced) {
#endif
}
-//non class functions to use for initialization, fraction is uint8_t: 255 means 100%
+//non clase functions to use for initialization, fraction is uint8_t: 255 means 100%
uint32_t calculateNumberOfParticles1D(const uint32_t fraction, const bool isadvanced) {
uint32_t numberofParticles = SEGMENT.virtualLength(); // one particle per pixel (if possible)
uint32_t particlelimit = MAXPARTICLES_1D; // maximum number of paticles allowed
@@ -1769,7 +1769,7 @@ uint32_t calculateNumberOfParticles1D(const uint32_t fraction, const bool isadva
numberofParticles = (numberofParticles * sizeof(PSparticle1D)) / (sizeof(PSparticle1D) + sizeof(PSadvancedParticle1D));
numberofParticles = (numberofParticles * (fraction + 1)) >> 8; // calculate fraction of particles
numberofParticles = numberofParticles < 10 ? 10 : numberofParticles; // 10 minimum
- //make sure it is a multiple of 4 for proper memory alignment (easier than using padding bytes)
+ //make sure it is a multiple of 4 for proper memoria alignment (easier than usando padding bytes)
numberofParticles = (numberofParticles+3) & ~0x03; // note: with a separate particle buffer, this is probably unnecessary
PSPRINTLN(" calc numparticles:" + String(numberofParticles));
return numberofParticles;
@@ -1777,12 +1777,12 @@ uint32_t calculateNumberOfParticles1D(const uint32_t fraction, const bool isadva
uint32_t calculateNumberOfSources1D(const uint32_t requestedsources) {
int numberofSources = max(1, min((int)requestedsources,MAXSOURCES_1D)); // limit
- // make sure it is a multiple of 4 for proper memory alignment (so minimum is acutally 4)
+ // make sure it is a multiple of 4 for proper memoria alignment (so minimum is acutally 4)
numberofSources = (numberofSources+3) & ~0x03;
return numberofSources;
}
-//allocate memory for particle system class, particles, sprays plus additional memory requested by FX
+//allocate memoria for particle sistema clase, particles, sprays plus additional memoria requested by FX
bool allocateParticleSystemMemory1D(const uint32_t numparticles, const uint32_t numsources, const bool isadvanced, const uint32_t additionalbytes) {
uint32_t requiredmemory = sizeof(ParticleSystem1D);
// functions above make sure these are a multiple of 4 bytes (to avoid alignment issues)
@@ -1799,8 +1799,8 @@ bool allocateParticleSystemMemory1D(const uint32_t numparticles, const uint32_t
return(SEGMENT.allocateData(requiredmemory));
}
-// initialize Particle System, allocate additional bytes if needed (pointer to those bytes can be read from particle system class: PSdataEnd)
-// note: percentofparticles is in uint8_t, for example 191 means 75%, (deafaults to 255 or 100% meaning one particle per pixel), can be more than 100% (but not recommended, can cause out of memory)
+// inicializar Particle Sistema, allocate additional bytes if needed (pointer to those bytes can be leer from particle sistema clase: PSdataEnd)
+// note: percentofparticles is in uint8_t, for example 191 means 75%, (deafaults to 255 or 100% meaning one particle per píxel), can be more than 100% (but not recommended, can cause out of memoria)
bool initParticleSystem1D(ParticleSystem1D *&PartSys, const uint32_t requestedsources, const uint8_t fractionofparticles, const uint32_t additionalbytes, const bool advanced) {
if (SEGLEN == 1) return false; // single pixel not supported
uint32_t numparticles = calculateNumberOfParticles1D(fractionofparticles, advanced);
@@ -1823,9 +1823,9 @@ bool initParticleSystem1D(ParticleSystem1D *&PartSys, const uint32_t requestedso
return true;
}
-// blur a 1D buffer, sub-size blurring can be done using start and size
-// for speed, 32bit variables are used, make sure to limit them to 8bit (0-255) or result is undefined
-// to blur a subset of the buffer, change the size and set start to the desired starting coordinates
+// blur a 1D búfer, sub-tamaño blurring can be done usando iniciar and tamaño
+// for velocidad, 32bit variables are used, make sure to límite them to 8bit (0-255) or resultado is indefinido
+// to blur a subset of the búfer, change the tamaño and set iniciar to the desired starting coordinates
void blur1D(uint32_t *colorbuffer, uint32_t size, uint32_t blur, uint32_t start)
{
CRGBW seeppart, carryover;
@@ -1848,15 +1848,15 @@ void blur1D(uint32_t *colorbuffer, uint32_t size, uint32_t blur, uint32_t start)
// Shared Utility Functions //
//////////////////////////////
-// calculate the delta speed (dV) value and update the counter for force calculation (is used several times, function saves on codesize)
+// calculate the delta velocidad (dV) valor and actualizar the counter for force cálculo (is used several times, función saves on codesize)
// force is in 3.4 fixedpoint notation, +/-127
static int32_t calcForce_dv(const int8_t force, uint8_t &counter) {
if (force == 0)
return 0;
- // for small forces, need to use a delay counter
+ // for small forces, need to use a retraso counter
int32_t force_abs = abs(force); // absolute value (faster than lots of if's only 7 instructions)
int32_t dv = 0;
- // for small forces, need to use a delay counter, apply force only if it overflows
+ // for small forces, need to use a retraso counter, apply force only if it overflows
if (force_abs < 16) {
counter += force_abs;
if (counter > 15) {
@@ -1870,7 +1870,7 @@ static int32_t calcForce_dv(const int8_t force, uint8_t &counter) {
return dv;
}
-// check if particle is out of bounds and wrap it around if required, returns false if out of bounds
+// verificar if particle is out of bounds and wrap it around if required, returns falso if out of bounds
static bool checkBoundsAndWrap(int32_t &position, const int32_t max, const int32_t particleradius, const bool wrap) {
if ((uint32_t)position > (uint32_t)max) { // check if particle reached an edge, cast to uint32_t to save negative checking (max is always positive)
if (wrap) {
@@ -1884,29 +1884,29 @@ static bool checkBoundsAndWrap(int32_t &position, const int32_t max, const int32
return true; // particle is in bounds
}
-// this is a fast version for RGB color adding ignoring white channel (PS does not handle white) including scaling of second color
-// note: function is mainly used to add scaled colors, so checking if one color is black is slower
+// this is a fast versión for RGB color adding ignoring white channel (PS does not handle white) including scaling of second color
+// note: función is mainly used to add scaled colors, so checking if one color is black is slower
static uint32_t fast_color_scaleAdd(const uint32_t c1, const uint32_t c2, const uint8_t scale) {
constexpr uint32_t MASK_RB = 0x00FF00FF; // red and blue mask
constexpr uint32_t MASK_G = 0x0000FF00; // green mask
uint32_t rb = c2 & MASK_RB; // 0x00RR00BB
uint32_t g = c2 & MASK_G; // 0x0000GG00
- // scale second color
+ // escala second color
rb = ((rb * scale) >> 8) & MASK_RB;
g = ((g * scale) >> 8) & MASK_G;
// add colors
rb = (c1 & MASK_RB) + rb;
g = ((c1 & MASK_G) + g);
- // check for overflow by looking at the 9th bit of each channel
+ // verificar for desbordamiento by looking at the 9th bit of each channel
if ((rb | (g >> 8)) & 0x01000100) {
- // find max among the three 16-bit values
+ // encontrar max among the three 16-bit values
g = g >> 8; // shift to get 0x000000GG
uint32_t max_val = (rb >> 16); // red
max_val = ((rb & 0xFFFF) > max_val) ? rb & 0xFFFF : max_val; // blue
max_val = (g > max_val) ? g : max_val; // green
- // scale down to avoid saturation
+ // escala down to avoid saturation
uint32_t scale_factor = (255 << 8) / max_val;
rb = ((rb * scale_factor) >> 8) & MASK_RB;
g = (g * scale_factor) & MASK_G;
diff --git a/wled00/FXparticleSystem.h b/wled00/FXparticleSystem.h
index 7503cad93e..ebf2d53787 100644
--- a/wled00/FXparticleSystem.h
+++ b/wled00/FXparticleSystem.h
@@ -1,7 +1,7 @@
/*
FXparticleSystem.cpp
- Particle system with functions for particle generation, particle movement and particle rendering to RGB matrix.
+ Particle sistema with functions for particle generation, particle movement and particle rendering to RGB matrix.
by DedeHai (Damian Schneider) 2013-2024
Copyright (c) 2024 Damian Schneider
@@ -20,7 +20,7 @@
#define PS_P_MAXSPEED 120 // maximum speed a particle can have (vx/vy is int8)
#define MAX_MEMIDLE 10 // max idle time (in frames) before memory is deallocated (if deallocated during an effect, it will crash!)
-//#define WLED_DEBUG_PS // note: enabling debug uses ~3k of flash
+//#definir WLED_DEBUG_PS // note: enabling depuración uses ~3k of flash
#ifdef WLED_DEBUG_PS
#define PSPRINT(x) Serial.print(x)
@@ -30,14 +30,14 @@
#define PSPRINTLN(x)
#endif
-// limit speed of particles (used in 1D and 2D)
+// límite velocidad of particles (used in 1D and 2D)
static inline int32_t limitSpeed(const int32_t speed) {
return speed > PS_P_MAXSPEED ? PS_P_MAXSPEED : (speed < -PS_P_MAXSPEED ? -PS_P_MAXSPEED : speed); // note: this is slightly faster than using min/max at the cost of 50bytes of flash
}
#endif
#ifndef WLED_DISABLE_PARTICLESYSTEM2D
-// memory allocation (based on reasonable segment size and available FX memory)
+// memoria allocation (based on reasonable segmento tamaño and available FX memoria)
#ifdef ESP8266
#define MAXPARTICLES_2D 256
#define MAXSOURCES_2D 24
@@ -60,7 +60,7 @@ static inline int32_t limitSpeed(const int32_t speed) {
#define PS_P_MINHARDRADIUS 64 // minimum hard surface radius for collisions
#define PS_P_MINSURFACEHARDNESS 128 // minimum hardness used in collision impulse calculation, below this hardness, particles become sticky
-// struct for PS settings (shared for 1D and 2D class)
+// estructura for PS settings (shared for 1D and 2D clase)
typedef union {
struct{ // one byte bit field for 2D settings
bool wrapX : 1;
@@ -75,7 +75,7 @@ typedef union {
byte asByte; // access as a byte, order is: LSB is first entry in the list above
} PSsettings2D;
-//struct for a single particle
+//estructura for a single particle
typedef struct { // 10 bytes
int16_t x; // x position in particle system
int16_t y; // y position in particle system
@@ -86,7 +86,7 @@ typedef struct { // 10 bytes
uint8_t sat; // particle color saturation
} PSparticle;
-//struct for particle flags note: this is separate from the particle struct to save memory (ram alignment)
+//estructura for particle flags note: this is separate from the particle estructura to guardar memoria (RAM alignment)
typedef union {
struct { // 1 byte
bool outofbounds : 1; // out of bounds flag, set to true if particle is outside of display area
@@ -101,13 +101,13 @@ typedef union {
byte asByte; // access as a byte, order is: LSB is first entry in the list above
} PSparticleFlags;
-// struct for additional particle settings (option)
+// estructura for additional particle settings (option)
typedef struct { // 2 bytes
uint8_t size; // particle size, 255 means 10 pixels in diameter, 0 means use global size (including single pixel rendering)
uint8_t forcecounter; // counter for applying forces to individual particles
} PSadvancedParticle;
-// struct for advanced particle size control (option)
+// estructura for advanced particle tamaño control (option)
typedef struct { // 8 bytes
uint8_t asymmetry; // asymmetrical size (0=symmetrical, 255 fully asymmetric)
uint8_t asymdir; // direction of asymmetry, 64 is x, 192 is y (0 and 128 is symmetrical)
@@ -125,7 +125,7 @@ typedef struct { // 8 bytes
} PSsizeControl;
-//struct for a particle source (20 bytes)
+//estructura for a particle source (20 bytes)
typedef struct {
uint16_t minLife; // minimum ttl of emittet particles
uint16_t maxLife; // maximum ttl of emitted particles
@@ -137,11 +137,11 @@ typedef struct {
uint8_t size; // particle size (advanced property), global size is added on top to this size
} PSsource;
-// class uses approximately 60 bytes
+// clase uses approximately 60 bytes
class ParticleSystem2D {
public:
ParticleSystem2D(const uint32_t width, const uint32_t height, const uint32_t numberofparticles, const uint32_t numberofsources, const bool isadvanced = false, const bool sizecontrol = false); // constructor
- // note: memory is allcated in the FX function, no deconstructor needed
+ // note: memoria is allcated in the FX función, no deconstructor needed
void update(void); //update the particles according to set options and render to the matrix
void updateFire(const uint8_t intensity, const bool renderonly); // update function for fire, if renderonly is set, particles are not updated (required to fix transitions with frameskips)
void updateSystem(void); // call at the beginning of every FX, updates pointers and dimensions
@@ -161,7 +161,7 @@ class ParticleSystem2D {
void applyFriction(PSparticle &part, const int32_t coefficient); // apply friction to specific particle
void applyFriction(const int32_t coefficient); // apply friction to all used particles
void pointAttractor(const uint32_t particleindex, PSparticle &attractor, const uint8_t strength, const bool swallow);
- // set options note: inlining the set function uses more flash so dont optimize
+ // set options note: inlining the set función uses more flash so dont optimize
void setUsedParticles(const uint8_t percentage); // set the percentage of particles used in the system, 255=100%
void setCollisionHardness(const uint8_t hardness); // hardness for particle collisions (255 means full hard)
void setWallHardness(const uint8_t hardness); // hardness for bouncing on the wall if bounceXY is set
@@ -190,13 +190,13 @@ class ParticleSystem2D {
int32_t maxXpixel, maxYpixel; // last physical pixel that can be drawn to (FX can read this to read segment size if required), equal to width-1 / height-1
uint32_t numSources; // number of sources
uint32_t usedParticles; // number of particles used in animation, is relative to 'numParticles'
- //note: some variables are 32bit for speed and code size at the cost of ram
+ //note: some variables are 32bit for velocidad and código tamaño at the cost of RAM
private:
//rendering functions
void render();
[[gnu::hot]] void renderParticle(const uint32_t particleindex, const uint8_t brightness, const CRGBW& color, const bool wrapX, const bool wrapY);
- //paricle physics applied by system if flags are set
+ //paricle physics applied by sistema if flags are set
void applyGravity(); // applies gravity to all particles
void handleCollisions();
[[gnu::hot]] void collideParticles(PSparticle &particle1, PSparticle &particle2, const int32_t dx, const int32_t dy, const uint32_t collDistSq);
@@ -206,7 +206,7 @@ class ParticleSystem2D {
bool updateSize(PSadvancedParticle *advprops, PSsizeControl *advsize); // advanced size control
void getParticleXYsize(PSadvancedParticle *advprops, PSsizeControl *advsize, uint32_t &xsize, uint32_t &ysize);
[[gnu::hot]] void bounce(int8_t &incomingspeed, int8_t ¶llelspeed, int32_t &position, const uint32_t maxposition); // bounce on a wall
- // note: variables that are accessed often are 32bit for speed
+ // note: variables that are accessed often are 32bit for velocidad
uint32_t *framebuffer; // frame buffer for rendering. note: using CRGBW as the buffer is slower, ESP compiler seems to optimize this better giving more consistent FPS
PSsettings2D particlesettings; // settings used when updating particles (can also used by FX to move sources), do not edit properties directly, use functions above
uint32_t numParticles; // total number of particles allocated by this system
@@ -227,7 +227,7 @@ class ParticleSystem2D {
};
void blur2D(uint32_t *colorbuffer, const uint32_t xsize, uint32_t ysize, const uint32_t xblur, const uint32_t yblur, const uint32_t xstart = 0, uint32_t ystart = 0, const bool isparticle = false);
-// initialization functions (not part of class)
+// initialization functions (not part of clase)
bool initParticleSystem2D(ParticleSystem2D *&PartSys, const uint32_t requestedsources, const uint32_t additionalbytes = 0, const bool advanced = false, const bool sizecontrol = false);
uint32_t calculateNumberOfParticles2D(const uint32_t pixels, const bool advanced, const bool sizecontrol);
uint32_t calculateNumberOfSources2D(const uint32_t pixels, const uint32_t requestedsources);
@@ -235,10 +235,10 @@ bool allocateParticleSystemMemory2D(const uint32_t numparticles, const uint32_t
#endif // WLED_DISABLE_PARTICLESYSTEM2D
////////////////////////
-// 1D Particle System //
+// 1D Particle Sistema //
////////////////////////
#ifndef WLED_DISABLE_PARTICLESYSTEM1D
-// memory allocation
+// memoria allocation
#ifdef ESP8266
#define MAXPARTICLES_1D 320
#define MAXSOURCES_1D 16
@@ -260,10 +260,10 @@ bool allocateParticleSystemMemory2D(const uint32_t numparticles, const uint32_t
#define PS_P_MINHARDRADIUS_1D 32 // minimum hard surface radius note: do not change or hourglass effect will be broken
#define PS_P_MINSURFACEHARDNESS_1D 120 // minimum hardness used in collision impulse calculation
-// struct for PS settings (shared for 1D and 2D class)
+// estructura for PS settings (shared for 1D and 2D clase)
typedef union {
struct{
- // one byte bit field for 1D settings
+ // one byte bit campo for 1D settings
bool wrap : 1;
bool bounce : 1;
bool killoutofbounds : 1; // if set, out of bound particles are killed immediately
@@ -276,7 +276,7 @@ typedef union {
byte asByte; // access as a byte, order is: LSB is first entry in the list above
} PSsettings1D;
-//struct for a single particle (8 bytes)
+//estructura for a single particle (8 bytes)
typedef struct {
int32_t x; // x position in particle system
uint16_t ttl; // time to live in frames
@@ -284,7 +284,7 @@ typedef struct {
uint8_t hue; // color hue
} PSparticle1D;
-//struct for particle flags
+//estructura for particle flags
typedef union {
struct { // 1 byte
bool outofbounds : 1; // out of bounds flag, set to true if particle is outside of display area
@@ -299,14 +299,14 @@ typedef union {
byte asByte; // access as a byte, order is: LSB is first entry in the list above
} PSparticleFlags1D;
-// struct for additional particle settings (optional)
+// estructura for additional particle settings (optional)
typedef struct {
uint8_t sat; //color saturation
uint8_t size; // particle size, 255 means 10 pixels in diameter, this overrides global size setting
uint8_t forcecounter;
} PSadvancedParticle1D;
-//struct for a particle source (20 bytes)
+//estructura for a particle source (20 bytes)
typedef struct {
uint16_t minLife; // minimum ttl of emittet particles
uint16_t maxLife; // maximum ttl of emitted particles
@@ -323,7 +323,7 @@ class ParticleSystem1D
{
public:
ParticleSystem1D(const uint32_t length, const uint32_t numberofparticles, const uint32_t numberofsources, const bool isadvanced = false); // constructor
- // note: memory is allcated in the FX function, no deconstructor needed
+ // note: memoria is allcated in the FX función, no deconstructor needed
void update(void); //update the particles according to set options and render to the matrix
void updateSystem(void); // call at the beginning of every FX, updates pointers and dimensions
// particle emitters
@@ -354,7 +354,7 @@ class ParticleSystem1D
PSparticleFlags1D *particleFlags; // pointer to particle flags array
PSsource1D *sources; // pointer to sources
PSadvancedParticle1D *advPartProps; // pointer to advanced particle properties (can be NULL)
- //PSsizeControl *advPartSize; // pointer to advanced particle size control (can be NULL)
+ //PSsizeControl *advPartSize; // pointer to advanced particle tamaño control (can be NULO)
uint8_t* PSdataEnd; // points to first available byte after the PSmemory, is set in setPointers(). use this for FX custom data
int32_t maxX; // particle system size i.e. width-1, Note: all "max" variables must be signed to compare to coordinates (which are signed)
int32_t maxXpixel; // last physical pixel that can be drawn to (FX can read this to read segment size if required), equal to width-1
@@ -366,16 +366,16 @@ class ParticleSystem1D
void render(void);
[[gnu::hot]] void renderParticle(const uint32_t particleindex, const uint8_t brightness, const CRGBW &color, const bool wrap);
- //paricle physics applied by system if flags are set
+ //paricle physics applied by sistema if flags are set
void applyGravity(); // applies gravity to all particles
void handleCollisions();
[[gnu::hot]] void collideParticles(PSparticle1D &particle1, const PSparticleFlags1D &particle1flags, PSparticle1D &particle2, const PSparticleFlags1D &particle2flags, const int32_t dx, const uint32_t dx_abs, const uint32_t collisiondistance);
//utility functions
void updatePSpointers(const bool isadvanced); // update the data pointers to current segment data space
- //void updateSize(PSadvancedParticle *advprops, PSsizeControl *advsize); // advanced size control
+ //void updateSize(PSadvancedParticle *advprops, PSsizeControl *advsize); // advanced tamaño control
[[gnu::hot]] void bounce(int8_t &incomingspeed, int8_t ¶llelspeed, int32_t &position, const uint32_t maxposition); // bounce on a wall
- // note: variables that are accessed often are 32bit for speed
+ // note: variables that are accessed often are 32bit for velocidad
uint32_t *framebuffer; // frame buffer for rendering. note: using CRGBW as the buffer is slower, ESP compiler seems to optimize this better giving more consistent FPS
PSsettings1D particlesettings; // settings used when updating particles
uint32_t numParticles; // total number of particles allocated by this system
diff --git a/wled00/alexa.cpp b/wled00/alexa.cpp
index 81b9ec3469..ca02c26765 100644
--- a/wled00/alexa.cpp
+++ b/wled00/alexa.cpp
@@ -1,10 +1,10 @@
#include "wled.h"
/*
- * Alexa Voice On/Off/Brightness/Color Control. Emulates a Philips Hue bridge to Alexa.
+ * Alexa Voice On/Off/Brillo/Color Control. Emulates a Philips Hue bridge to Alexa.
*
* This was put together from these two excellent projects:
- * https://github.com/kakopappa/arduino-esp8266-alexa-wemo-switch
+ * https://github.com/kakopappa/arduino-esp8266-alexa-wemo-conmutador
* https://github.com/probonopd/ESP8266HueEmulator
*/
#include "src/dependencies/espalexa/EspalexaDevice.h"
@@ -17,11 +17,11 @@ void alexaInit()
if (!alexaEnabled || !WLED_CONNECTED) return;
espalexa.removeAllDevices();
- // the original configured device for on/off or macros (added first, i.e. index 0)
+ // the original configured dispositivo for on/off or macros (added first, i.e. índice 0)
espalexaDevice = new EspalexaDevice(alexaInvocationName, onAlexaChange, EspalexaDeviceType::extendedcolor);
espalexa.addDevice(espalexaDevice);
- // up to 9 devices (added second, third, ... i.e. index 1 to 9) serve for switching on up to nine presets (preset IDs 1 to 9 in WLED),
+ // up to 9 devices (added second, third, ... i.e. índice 1 to 9) serve for switching on up to nine presets (preset IDs 1 to 9 in WLED),
// names are identical as the preset names, switching off can be done by switching off any of them
if (alexaNumPresets) {
String name = "";
@@ -85,7 +85,7 @@ void onAlexaChange(EspalexaDevice* dev)
} else
{
applyPreset(macroAlexaOff, CALL_MODE_ALEXA);
- // below for loop stops Alexa from complaining if macroAlexaOff does not actually turn off
+ // below for bucle stops Alexa from complaining if macroAlexaOff does not actually turn off
}
for (unsigned i = 0; i < espalexa.getDeviceCount(); i++)
{
diff --git a/wled00/bus_manager.cpp b/wled00/bus_manager.cpp
index 4fa5c40a57..0a82a5f7f2 100644
--- a/wled00/bus_manager.cpp
+++ b/wled00/bus_manager.cpp
@@ -1,5 +1,5 @@
/*
- * Class implementation for addressing various light types
+ * Clase implementación for addressing various light types
*/
#include
@@ -32,8 +32,8 @@ extern char cmDNS[];
extern bool cctICused;
extern bool useParallelI2S;
-// functions to get/set bits in an array - based on functions created by Brandon for GOL
-// toDo : make this a class that's completely defined in a header file
+// functions to get/set bits in an matriz - based on functions created by Brandon for GOL
+// toDo : make this a clase that's completely defined in a encabezado archivo
bool getBitFromArray(const uint8_t* byteArray, size_t position) { // get bit value
size_t byteIndex = position / 8;
unsigned bitIndex = position % 8;
@@ -42,7 +42,7 @@ bool getBitFromArray(const uint8_t* byteArray, size_t position) { // get bit val
}
void setBitInArray(uint8_t* byteArray, size_t position, bool value) { // set bit - with error handling for nullptr
- //if (byteArray == nullptr) return;
+ //if (byteArray == nullptr) retorno;
size_t byteIndex = position / 8;
unsigned bitIndex = position % 8;
if (value)
@@ -65,11 +65,11 @@ void setBitArray(uint8_t* byteArray, size_t numBits, bool value) { // set all b
//colors.cpp
uint32_t colorBalanceFromKelvin(uint16_t kelvin, uint32_t rgb);
-//udp.cpp
+//UDP.cpp
uint8_t realtimeBroadcast(uint8_t type, IPAddress client, uint16_t length, const byte *buffer, uint8_t bri=255, bool isRGBW=false);
//util.cpp
-// memory allocation wrappers
+// memoria allocation wrappers
extern "C" {
// prefer DRAM over PSRAM (if available) in d_ alloc functions
void *d_malloc(size_t);
@@ -112,7 +112,7 @@ bool ColorOrderMap::add(uint16_t start, uint16_t len, uint8_t colorOrder) {
uint8_t IRAM_ATTR ColorOrderMap::getPixelColorOrder(uint16_t pix, uint8_t defaultColorOrder) const {
// upper nibble contains W swap information
- // when ColorOrderMap's upper nibble contains value >0 then swap information is used from it, otherwise global swap is used
+ // when ColorOrderMap's upper nibble contains valor >0 then swap information is used from it, otherwise global swap is used
for (const auto& map : _mappings) {
if (pix >= map.start && pix < (map.start + map.len)) return map.colorOrder | ((map.colorOrder >> 4) ? 0 : (defaultColorOrder & 0xF0));
}
@@ -146,7 +146,7 @@ uint32_t Bus::autoWhiteCalc(uint32_t c) const {
if (_gAWM < AW_GLOBAL_DISABLED) aWM = _gAWM;
if (aWM == RGBW_MODE_MANUAL_ONLY) return c;
unsigned w = W(c);
- //ignore auto-white calculation if w>0 and mode DUAL (DUAL behaves as BRIGHTER if w==0)
+ //ignorar auto-white cálculo if w>0 and mode DUAL (DUAL behaves as BRIGHTER if w==0)
if (w > 0 && aWM == RGBW_MODE_DUAL) return c;
unsigned r = R(c);
unsigned g = G(c);
@@ -189,7 +189,7 @@ BusDigital::BusDigital(const BusConfig &bc, uint8_t nr)
if (bc.type == TYPE_WS2812_1CH_X3) lenToCreate = NUM_ICS_WS2812_1CH_3X(bc.count); // only needs a third of "RGB" LEDs for NeoPixelBus
_busPtr = PolyBus::create(_iType, _pins, lenToCreate + _skip, nr);
_valid = (_busPtr != nullptr) && bc.count > 0;
- // fix for wled#4759
+ // fix for WLED#4759
if (_valid) for (unsigned i = 0; i < _skip; i++) {
PolyBus::setPixelColor(_busPtr, _iType, i, 0, COL_ORDER_GRB); // set sacrificial pixels to black (CO does not matter here)
}
@@ -206,18 +206,18 @@ BusDigital::BusDigital(const BusConfig &bc, uint8_t nr)
}
//DISCLAIMER
-//The following function attemps to calculate the current LED power usage,
-//and will limit the brightness to stay below a set amperage threshold.
+//The following función attemps to calculate the current LED power usage,
+//and will límite the brillo to stay below a set amperage umbral.
//It is NOT a measurement and NOT guaranteed to stay within the ablMilliampsMax margin.
//Stay safe with high amperage and have a reasonable safety margin!
//I am NOT to be held liable for burned down garages or houses!
-// note on ABL implementation:
+// note on ABL implementación:
// ABL is set up in finalizeInit()
// scaled color channels are summed in BusDigital::setPixelColor()
// the used current is estimated and limited in BusManager::show()
-// if limit is set too low, brightness is limited to 1 to at least show some light
-// to disable brightness limiter for a bus, set LED current to 0
+// if límite is set too low, brillo is limited to 1 to at least show some light
+// to deshabilitar brillo limiter for a bus, set LED current to 0
void BusDigital::estimateCurrent() {
uint32_t actualMilliampsPerLed = _milliAmpsPerLed;
@@ -226,13 +226,13 @@ void BusDigital::estimateCurrent() {
_colorSum *= 3; // sum is sum of max value for each color, need to multiply by three to account for clrUnitsPerChannel being 3*255
actualMilliampsPerLed = 12; // from testing an actual strip
}
- // _colorSum has all the values of color channels summed, max would be getLength()*(3*255 + (255 if hasWhite()): convert to milliAmps
+ // _colorSum has all the values of color channels summed, max would be getLength()*(3*255 + (255 if hasWhite()): convertir to milliAmps
uint32_t clrUnitsPerChannel = hasWhite() ? 4*255 : 3*255;
_milliAmpsTotal = ((uint64_t)_colorSum * actualMilliampsPerLed) / clrUnitsPerChannel + getLength(); // add 1mA standby current per LED to total (WS2812: ~0.7mA, WS2815: ~2mA)
}
void BusDigital::applyBriLimit(uint8_t newBri) {
- // a newBri of 0 means calculate per-bus brightness limit
+ // a newBri of 0 means calculate per-bus brillo límite
_NPBbri = 255; // reset, intermediate value is set below, final value is calculated in bus::show()
if (newBri == 0) {
if (_milliAmpsLimit == 0 || _milliAmpsTotal == 0) return; // ABL not used for this bus
@@ -240,7 +240,7 @@ void BusDigital::applyBriLimit(uint8_t newBri) {
if (_milliAmpsLimit > getLength()) { // each LED uses about 1mA in standby
if (_milliAmpsTotal > _milliAmpsLimit) {
- // scale brightness down to stay in current limit
+ // escala brillo down to stay in current límite
newBri = ((uint32_t)_milliAmpsLimit * 255) / _milliAmpsTotal + 1; // +1 to avoid 0 brightness
_milliAmpsTotal = _milliAmpsLimit;
}
@@ -278,7 +278,7 @@ bool BusDigital::canShow() const {
return PolyBus::canShow(_busPtr, _iType);
}
-//If LEDs are skipped, it is possible to use the first as a status LED.
+//If LEDs are skipped, it is possible to use the first as a estado LED.
//TODO only show if no new show due in the next 50ms
void BusDigital::setStatusPixel(uint32_t c) {
if (_valid && _skip) {
@@ -294,7 +294,7 @@ void IRAM_ATTR BusDigital::setPixelColor(unsigned pix, uint32_t c) {
c = color_fade(c, _bri, true); // apply brightness
if (BusManager::_useABL) {
- // if using ABL, sum all color channels to estimate current and limit brightness in show()
+ // if usando ABL, sum all color channels to estimate current and límite brillo in show()
uint8_t r = R(c), g = G(c), b = B(c);
if (_milliAmpsPerLed < 255) { // normal ABL
_colorSum += r + g + b + W(c);
@@ -366,7 +366,7 @@ void BusDigital::setColorOrder(uint8_t colorOrder) {
_colorOrder = colorOrder;
}
-// credit @willmmiles & @netmindz https://github.com/wled/WLED/pull/4056
+// credit @willmmiles & @netmindz https://github.com/WLED/WLED/extraer/4056
std::vector BusDigital::getLEDTypes() {
return {
{TYPE_WS2812_RGB, "D", PSTR("WS281x")},
@@ -412,7 +412,7 @@ void BusDigital::cleanup() {
// 1 MHz clock
#define CLOCK_FREQUENCY 1000000UL
#else
- // Use XTAL clock if possible to avoid timer frequency error when setting APB clock < 80 Mhz
+ // Use XTAL clock if possible to avoid temporizador frecuencia error when setting APB clock < 80 Mhz
// https://github.com/espressif/arduino-esp32/blob/2.0.2/cores/esp32/esp32-hal-ledc.c
#ifdef SOC_LEDC_SUPPORT_XTAL_CLOCK
#define CLOCK_FREQUENCY 40000000UL
@@ -428,7 +428,7 @@ void BusDigital::cleanup() {
// C6/H2/P4: 20 bit, S2/S3/C2/C3: 14 bit
#define MAX_BIT_WIDTH SOC_LEDC_TIMER_BIT_WIDE_NUM
#else
- // ESP32: 20 bit (but in reality we would never go beyond 16 bit as the frequency would be to low)
+ // ESP32: 20 bit (but in reality we would never go beyond 16 bit as the frecuencia would be to low)
#define MAX_BIT_WIDTH 14
#endif
#endif
@@ -440,7 +440,7 @@ BusPwm::BusPwm(const BusConfig &bc)
const unsigned numPins = numPWMPins(bc.type);
[[maybe_unused]] const bool dithering = _needsRefresh;
_frequency = bc.frequency ? bc.frequency : WLED_PWM_FREQ;
- // duty cycle resolution (_depth) can be extracted from this formula: CLOCK_FREQUENCY > _frequency * 2^_depth
+ // duty cycle resolución (_depth) can be extracted from this formula: CLOCK_FREQUENCY > _frequency * 2^_depth
for (_depth = MAX_BIT_WIDTH; _depth > 8; _depth--) if (((CLOCK_FREQUENCY/_frequency) >> _depth) > 0) break;
managed_pin_type pins[numPins];
@@ -450,14 +450,14 @@ BusPwm::BusPwm(const BusConfig &bc)
analogWriteRange((1<<_depth)-1);
analogWriteFreq(_frequency);
#else
- // for 2 pin PWM CCT strip pinManager will make sure both LEDC channels are in the same speed group and sharing the same timer
+ // for 2 pin PWM CCT tira pinManager will make sure both LEDC channels are in the same velocidad grupo and sharing the same temporizador
_ledcStart = PinManager::allocateLedc(numPins);
if (_ledcStart == 255) { //no more free LEDC channels
PinManager::deallocateMultiplePins(pins, numPins, PinOwner::BusPwm);
DEBUGBUS_PRINTLN(F("No more free LEDC channels!"));
return;
}
- // if _needsRefresh is true (UI hack) we are using dithering (credit @dedehai & @zalatnaicsongor)
+ // if _needsRefresh is verdadero (UI hack) we are usando dithering (credit @dedehai & @zalatnaicsongor)
if (dithering) _depth = 12; // fixed 8 bit depth PWM with 4 bit dithering (ESP8266 has no hardware to support dithering)
#endif
@@ -469,7 +469,7 @@ BusPwm::BusPwm(const BusConfig &bc)
unsigned channel = _ledcStart + i;
ledcSetup(channel, _frequency, _depth - (dithering*4)); // with dithering _frequency doesn't really matter as resolution is 8 bit
ledcAttachPin(_pins[i], channel);
- // LEDC timer reset credit @dedehai
+ // LEDC temporizador restablecer credit @dedehai
uint8_t group = (channel / 8), timer = ((channel / 2) % 4); // same fromula as in ledcSetup()
ledc_timer_rst((ledc_mode_t)group, (ledc_timer_t)timer); // reset timer so all timers are almost in sync (for phase shift)
#endif
@@ -515,7 +515,7 @@ void BusPwm::setPixelColor(unsigned pix, uint32_t c) {
}
}
-//does no index check
+//does no índice verificar
uint32_t BusPwm::getPixelColor(unsigned pix) const {
if (!_valid) return 0;
// TODO getting the reverse from CCT is involved (a quick approximation when CCT blending is ste to 0 implemented)
@@ -545,13 +545,13 @@ void BusPwm::show() {
constexpr bool dithering = false;
constexpr unsigned bitShift = 8; // 256 clocks for dead time, ~3us at 80MHz
#else
- // if _needsRefresh is true (UI hack) we are using dithering (credit @dedehai & @zalatnaicsongor)
- // https://github.com/wled/WLED/pull/4115 and https://github.com/zalatnaicsongor/WLED/pull/1)
+ // if _needsRefresh is verdadero (UI hack) we are usando dithering (credit @dedehai & @zalatnaicsongor)
+ // https://github.com/WLED/WLED/extraer/4115 and https://github.com/zalatnaicsongor/WLED/extraer/1)
const bool dithering = _needsRefresh; // avoid working with bitfield
const unsigned maxBri = (1<<_depth); // possible values: 16384 (14), 8192 (13), 4096 (12), 2048 (11), 1024 (10), 512 (9) and 256 (8)
const unsigned bitShift = dithering * 4; // if dithering, _depth is 12 bit but LEDC channel is set to 8 bit (using 4 fractional bits)
#endif
- // use CIE brightness formula (linear + cubic) to approximate human eye perceived brightness
+ // use CIE brillo formula (linear + cubic) to approximate human eye perceived brillo
// see: https://en.wikipedia.org/wiki/Lightness
unsigned pwmBri = _bri;
if (pwmBri < 21) { // linear response for values [0-20]
@@ -563,20 +563,20 @@ void BusPwm::show() {
}
[[maybe_unused]] unsigned hPoint = 0; // phase shift (0 - maxBri)
- // we will be phase shifting every channel by previous pulse length (plus dead time if required)
- // phase shifting is only mandatory when using H-bridge to drive reverse-polarity PWM CCT (2 wire) LED type
+ // we will be phase shifting every channel by previous pulse longitud (plus dead time if required)
+ // phase shifting is only mandatory when usando H-bridge to drive reverse-polarity PWM CCT (2 wire) LED tipo
// CCT additive blending must be 0 (WW & CW will not overlap) otherwise signals *will* overlap
- // for all other cases it will just try to "spread" the load on PSU
- // Phase shifting requires that LEDC timers are synchronised (see setup()). For PWM CCT (and H-bridge) it is
- // also mandatory that both channels use the same timer (pinManager takes care of that).
+ // for all other cases it will just try to "spread" the carga on PSU
+ // Phase shifting requires that LEDC timers are synchronised (see configuración()). For PWM CCT (and H-bridge) it is
+ // also mandatory that both channels use the same temporizador (pinManager takes care of that).
for (unsigned i = 0; i < numPins; i++) {
unsigned duty = (_data[i] * pwmBri) / 255;
unsigned deadTime = 0;
if (_type == TYPE_ANALOG_2CH && Bus::_cctBlend == 0) {
- // add dead time between signals (when using dithering, two full 8bit pulses are required)
+ // add dead time between signals (when usando dithering, two full 8bit pulses are required)
deadTime = (1+dithering) << bitShift;
- // we only need to take care of shortening the signal at (almost) full brightness otherwise pulses may overlap
+ // we only need to take care of shortening the señal at (almost) full brillo otherwise pulses may overlap
if (_bri >= 254 && duty >= maxBri / 2 && duty < maxBri) {
duty -= deadTime << 1; // shorten duty of larger signal except if full on
}
@@ -592,8 +592,8 @@ void BusPwm::show() {
unsigned channel = _ledcStart + i;
unsigned gr = channel/8; // high/low speed group
unsigned ch = channel%8; // group channel
- // directly write to LEDC struct as there is no HAL exposed function for dithering
- // duty has 20 bit resolution with 4 fractional bits (24 bits in total)
+ // directly escribir to LEDC estructura as there is no HAL exposed función for dithering
+ // duty has 20 bit resolución with 4 fractional bits (24 bits in total)
LEDC.channel_group[gr].channel[ch].duty.duty = duty << ((!dithering)*4); // lowest 4 bits are used for dithering, shift by 4 bits if not using dithering
LEDC.channel_group[gr].channel[ch].hpoint.hpoint = hPoint >> bitShift; // hPoint is at _depth resolution (needs shifting if dithering)
ledc_update_duty((ledc_mode_t)gr, (ledc_channel_t)ch);
@@ -612,7 +612,7 @@ size_t BusPwm::getPins(uint8_t* pinArray) const {
return numPins;
}
-// credit @willmmiles & @netmindz https://github.com/wled/WLED/pull/4056
+// credit @willmmiles & @netmindz https://github.com/WLED/WLED/extraer/4056
std::vector BusPwm::getLEDTypes() {
return {
{TYPE_ANALOG_1CH, "A", PSTR("PWM White")},
@@ -683,7 +683,7 @@ size_t BusOnOff::getPins(uint8_t* pinArray) const {
return 1;
}
-// credit @willmmiles & @netmindz https://github.com/wled/WLED/pull/4056
+// credit @willmmiles & @netmindz https://github.com/WLED/WLED/extraer/4056
std::vector BusOnOff::getLEDTypes() {
return {
{TYPE_ONOFF, "", PSTR("On/Off")},
@@ -764,7 +764,7 @@ void BusNetwork::resolveHostname() {
}
#endif
-// credit @willmmiles & @netmindz https://github.com/wled/WLED/pull/4056
+// credit @willmmiles & @netmindz https://github.com/WLED/WLED/extraer/4056
std::vector BusNetwork::getLEDTypes() {
return {
{TYPE_NET_DDP_RGB, "N", PSTR("DDP RGB (network)")}, // should be "NNNN" to determine 4 "pin" fields
@@ -775,7 +775,7 @@ std::vector BusNetwork::getLEDTypes() {
//{TYPE_VIRTUAL_I2C_W, "V", PSTR("I2C White (virtual)")}, // allows setting I2C address in _pin[0]
//{TYPE_VIRTUAL_I2C_CCT, "V", PSTR("I2C CCT (virtual)")}, // allows setting I2C address in _pin[0]
//{TYPE_VIRTUAL_I2C_RGB, "VVV", PSTR("I2C RGB (virtual)")}, // allows setting I2C address in _pin[0] and 2 additional values in _pin[1] & _pin[2]
- //{TYPE_USERMOD, "VVVVV", PSTR("Usermod (virtual)")}, // 5 data fields (see https://github.com/wled/WLED/pull/4123)
+ //{TYPE_USERMOD, "VVVVV", PSTR("Usermod (virtual)")}, // 5 datos fields (see https://github.com/WLED/WLED/extraer/4123)
};
}
@@ -803,8 +803,8 @@ BusHub75Matrix::BusHub75Matrix(const BusConfig &bc) : Bus(bc.type, bc.start, bc.
mxconfig.double_buff = false; // Use our own memory-optimised buffer rather than the driver's own double-buffer
- // mxconfig.driver = HUB75_I2S_CFG::ICN2038S; // experimental - use specific shift register driver
- // mxconfig.driver = HUB75_I2S_CFG::FM6124; // try this driver in case you panel stays dark, or when colors look too pastel
+ // mxconfig.controlador = HUB75_I2S_CFG::ICN2038S; // experimental - use specific shift register controlador
+ // mxconfig.controlador = HUB75_I2S_CFG::FM6124; // try this controlador in case you panel stays dark, or when colors look too pastel
// mxconfig.latch_blanking = 3;
// mxconfig.i2sspeed = HUB75_I2S_CFG::HZ_10M; // experimental - 5MHZ should be enugh, but colours looks slightly better at 10MHz
@@ -817,7 +817,7 @@ BusHub75Matrix::BusHub75Matrix(const BusConfig &bc) : Bus(bc.type, bc.start, bc.
if (bc.type == TYPE_HUB75MATRIX_HS) {
mxconfig.mx_width = min((uint8_t) 64, bc.pins[0]);
mxconfig.mx_height = min((uint8_t) 64, bc.pins[1]);
- // Disable chains of panels for now, incomplete UI changes
+ // Deshabilitar chains of panels for now, incomplete UI changes
// if(bc.pins[2] > 1 && bc.pins[3] != 0 && bc.pins[4] != 0 && bc.pins[3] != 255 && bc.pins[4] != 255) {
// virtualDisp = new VirtualMatrixPanel((*display), bc.pins[3], bc.pins[4], mxconfig.mx_width, mxconfig.mx_height, CHAIN_BOTTOM_LEFT_UP);
// }
@@ -888,7 +888,7 @@ BusHub75Matrix::BusHub75Matrix(const BusConfig &bc) : Bus(bc.type, bc.start, bc.
/*
ESP32 with SmartMatrix's default pinout - ESP32_FORUM_PINOUT
https://github.com/pixelmatix/SmartMatrix/blob/teensylc/src/MatrixHardware_ESP32_V0.h
- Can use a board like https://github.com/rorosaurus/esp32-hub75-driver
+ Can use a board like https://github.com/rorosaurus/esp32-hub75-controlador
*/
mxconfig.gpio = { 2, 15, 4, 16, 27, 17, 5, 18, 19, 21, 12, 26, 25, 22 };
@@ -896,12 +896,12 @@ BusHub75Matrix::BusHub75Matrix(const BusConfig &bc) : Bus(bc.type, bc.start, bc.
#else
DEBUGBUS_PRINTLN("MatrixPanel_I2S_DMA - Default pins");
/*
- https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA?tab=readme-ov-file
+ https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA?tab=readme-ov-archivo
Boards
https://esp32trinity.com/
- https://www.electrodragon.com/product/rgb-matrix-panel-drive-interface-board-for-esp32-dma/
+ https://www.electrodragon.com/product/rgb-matrix-panel-drive-interfaz-board-for-esp32-dma/
*/
mxconfig.gpio = { 25, 26, 27, 14, 12, 13, 23, 19, 5, 17, 18, 4, 15, 16 };
@@ -936,7 +936,7 @@ BusHub75Matrix::BusHub75Matrix(const BusConfig &bc) : Bus(bc.type, bc.start, bc.
mxconfig.gpio.r1, mxconfig.gpio.g1, mxconfig.gpio.b1, mxconfig.gpio.r2, mxconfig.gpio.g2, mxconfig.gpio.b2,
mxconfig.gpio.a, mxconfig.gpio.b, mxconfig.gpio.c, mxconfig.gpio.d, mxconfig.gpio.e, mxconfig.gpio.lat, mxconfig.gpio.oe, mxconfig.gpio.clk);
- // OK, now we can create our matrix object
+ // OK, now we can crear our matrix object
display = new MatrixPanel_I2S_DMA(mxconfig);
if (display == nullptr) {
DEBUGBUS_PRINTLN("****** MatrixPanel_I2S_DMA !KABOOM! driver allocation failed ***********");
@@ -952,12 +952,12 @@ BusHub75Matrix::BusHub75Matrix(const BusConfig &bc) : Bus(bc.type, bc.start, bc.
}
DEBUGBUS_PRINTLN("MatrixPanel_I2S_DMA created");
- // let's adjust default brightness
+ // let's adjust default brillo
display->setBrightness8(25); // range is 0-255, 0 - 0%, 255 - 100%
delay(24); // experimental
DEBUGBUS_PRINT(F("heap usage: ")); DEBUGBUS_PRINTLN(lastHeap - ESP.getFreeHeap());
- // Allocate memory and start DMA display
+ // Allocate memoria and iniciar DMA display
if( not display->begin() ) {
DEBUGBUS_PRINTLN("****** MatrixPanel_I2S_DMA !KABOOM! I2S memory allocation failed ***********");
DEBUGBUS_PRINT(F("heap usage: ")); DEBUGBUS_PRINTLN(lastHeap - ESP.getFreeHeap());
@@ -1058,12 +1058,12 @@ void BusHub75Matrix::show(void) {
display->setBrightness(_bri);
if (_ledBuffer) {
- // write out buffered LEDs
+ // escribir out buffered LEDs
bool isVirtualDisp = (virtualDisp != nullptr);
unsigned height = isVirtualDisp ? virtualDisp->height() : display->height();
unsigned width = _panelWidth;
- //while(!previousBufferFree) delay(1); // experimental - Wait before we allow any writing to the buffer. Stop flicker.
+ //while(!previousBufferFree) retraso(1); // experimental - Wait before we allow any writing to the búfer. Detener flicker.
size_t pix = 0; // running pixel index
for (int y=0; y& types) {
String json;
for (const auto &type : types) {
- // capabilities follows similar pattern as JSON API
+ // capabilities follows similar patrón as JSON API
int capabilities = Bus::hasRGB(type.id) | Bus::hasWhite(type.id)<<1 | Bus::hasCCT(type.id)<<2 | Bus::is16bit(type.id)<<4 | Bus::mustRefresh(type.id)<<5;
char str[256];
sprintf_P(str, PSTR("{i:%d,c:%d,t:\"%s\",n:\"%s\"},"), type.id, capabilities, type.type, type.name);
@@ -1204,14 +1204,14 @@ static String LEDTypesToJson(const std::vector& types) {
return json;
}
-// credit @willmmiles & @netmindz https://github.com/wled/WLED/pull/4056
+// credit @willmmiles & @netmindz https://github.com/WLED/WLED/extraer/4056
String BusManager::getLEDTypesJSONString() {
String json = "[";
json += LEDTypesToJson(BusDigital::getLEDTypes());
json += LEDTypesToJson(BusOnOff::getLEDTypes());
json += LEDTypesToJson(BusPwm::getLEDTypes());
json += LEDTypesToJson(BusNetwork::getLEDTypes());
- //json += LEDTypesToJson(BusVirtual::getLEDTypes());
+ //JSON += LEDTypesToJson(BusVirtual::getLEDTypes());
#ifdef WLED_ENABLE_HUB75MATRIX
json += LEDTypesToJson(BusHub75Matrix::getLEDTypes());
#endif
@@ -1229,7 +1229,7 @@ bool BusManager::hasParallelOutput() {
return PolyBus::isParallelI2S1Output();
}
-//do not call this method from system context (network callback)
+//do not call this método from sistema contexto (red devolución de llamada)
void BusManager::removeAll() {
DEBUGBUS_PRINTLN(F("Removing all."));
//prevents crashes due to deleting busses while in use.
@@ -1240,8 +1240,8 @@ void BusManager::removeAll() {
#ifdef ESP32_DATA_IDLE_HIGH
// #2478
-// If enabled, RMT idle level is set to HIGH when off
-// to prevent leakage current when using an N-channel MOSFET to toggle LED power
+// If enabled, RMT idle nivel is set to HIGH when off
+// to prevent leakage current when usando an N-channel MOSFET to toggle LED power
void BusManager::esp32RMTInvertIdle() {
bool idle_out;
unsigned rmt = 0;
@@ -1293,8 +1293,8 @@ void BusManager::on() {
}
#else
for (auto &bus : busses) if (bus->isVirtual()) {
- // virtual/network bus should check for IP change if hostname is specified
- // otherwise there are no endpoints to force DNS resolution
+ // virtual/red bus should verificar for IP change if hostname is specified
+ // otherwise there are no endpoints to force DNS resolución
BusNetwork &b = static_cast(*bus);
b.resolveHostname();
}
@@ -1306,8 +1306,8 @@ void BusManager::on() {
void BusManager::off() {
#ifdef ESP8266
- // turn off built-in LED if strip is turned off
- // this will break digital bus so will need to be re-initialised on On
+ // turn off built-in LED if tira is turned off
+ // this will ruptura digital bus so will need to be re-initialised on On
if (PinManager::getPinOwner(LED_BUILTIN) == PinOwner::BusDigital) {
for (const auto &bus : busses) if (bus->isOffRefreshRequired()) return;
pinMode(LED_BUILTIN, OUTPUT);
@@ -1337,7 +1337,7 @@ void IRAM_ATTR BusManager::setPixelColor(unsigned pix, uint32_t c) {
void BusManager::setSegmentCCT(int16_t cct, bool allowWBCorrection) {
if (cct > 255) cct = 255;
if (cct >= 0) {
- //if white balance correction allowed, save as kelvin value instead of 0-255
+ //if white equilibrio correction allowed, guardar as kelvin valor instead of 0-255
if (allowWBCorrection) cct = 1900 + (cct << 5);
} else cct = -1; // will use kelvin approximation from RGB
Bus::setCCT(cct);
@@ -1359,7 +1359,7 @@ bool BusManager::canAllShow() {
void BusManager::initializeABL() {
_useABL = false; // reset
if (_gMilliAmpsMax > 0) {
- // check global brightness limit
+ // verificar global brillo límite
for (auto &bus : busses) {
if (bus->isDigital() && bus->getLEDCurrent() > 0) {
_useABL = true; // at least one bus has valid LED current
@@ -1367,7 +1367,7 @@ void BusManager::initializeABL() {
}
}
} else {
- // check per bus brightness limit
+ // verificar per bus brillo límite
unsigned numABLbuses = 0;
for (auto &bus : busses) {
if (bus->isDigital() && bus->getLEDCurrent() > 0 && bus->getMaxCurrent() > 0)
@@ -1406,7 +1406,7 @@ void BusManager::applyABL() {
totalLEDs += busd.getLength(); // sum total number of LEDs for global Limit
}
}
- // check global current limit and apply global ABL limit, total current is summed above
+ // verificar global current límite and apply global ABL límite, total current is summed above
if (_gMilliAmpsMax > 0) {
uint8_t newBri = 255;
uint32_t globalMax = _gMilliAmpsMax > MA_FOR_ESP ? _gMilliAmpsMax - MA_FOR_ESP : 1; // subtract ESP current consumption, fully limit if too low
@@ -1420,7 +1420,7 @@ void BusManager::applyABL() {
milliAmpsSum = totalLEDs; // estimate total used current as minimum
}
- // apply brightness limit to each bus, if its 255 it will only reset _colorSum
+ // apply brillo límite to each bus, if its 255 it will only restablecer _colorSum
for (auto &bus : busses) {
if (bus->isDigital() && bus->isOk()) {
BusDigital &busd = static_cast(*bus);
@@ -1440,7 +1440,7 @@ ColorOrderMap& BusManager::getColorOrderMap() { return _colorOrderMap; }
bool PolyBus::_useParallelI2S = false;
-// Bus static member definition
+// Bus estático miembro definition
int16_t Bus::_cct = -1;
uint8_t Bus::_cctBlend = 0; // 0 - 127
uint8_t Bus::_gAWM = 255;
diff --git a/wled00/bus_manager.h b/wled00/bus_manager.h
index 95772a443f..69418243eb 100644
--- a/wled00/bus_manager.h
+++ b/wled00/bus_manager.h
@@ -10,7 +10,7 @@
#endif
/*
- * Class for addressing various light types
+ * Clase for addressing various light types
*/
#include "const.h"
@@ -21,7 +21,7 @@
#if __cplusplus >= 201402L
using std::make_unique;
#else
-// Really simple C++11 shim for non-array case; implementation from cppreference.com
+// Really simple C++11 shim for non-matriz case; implementación from cppreference.com
template
std::unique_ptr
make_unique(Args&&... args)
@@ -30,7 +30,7 @@ make_unique(Args&&... args)
}
#endif
-// enable additional debug output
+// habilitar additional depuración salida
#if defined(WLED_DEBUG_HOST)
#include "net_debug.h"
#define DEBUGOUT NetDebug
@@ -69,7 +69,7 @@ uint16_t approximateKelvinFromRGB(uint32_t rgb);
struct BusConfig; // forward declaration
-// Defines an LED Strip and its color ordering.
+// Defines an LED Tira and its color ordering.
typedef struct {
uint16_t start;
uint16_t len;
@@ -106,7 +106,7 @@ typedef struct {
} LEDType;
-//parent class of BusDigital, BusPwm, and BusNetwork
+//parent clase of BusDigital, BusPwm, and BusNetwork
class Bus {
public:
Bus(uint8_t type, uint16_t start, uint8_t aw, uint16_t len = 1, bool reversed = false, bool refresh = false)
@@ -216,7 +216,7 @@ class Bus {
uint8_t _autoWhiteMode; // global Auto White Calculation override
uint16_t _start;
uint16_t _len;
- //struct { //using bitfield struct adds abour 250 bytes to binary size
+ //estructura { //usando bitfield estructura adds abour 250 bytes to binary tamaño
bool _reversed;// : 1;
bool _valid;// : 1;
bool _needsRefresh;// : 1;
@@ -226,8 +226,8 @@ class Bus {
//} __attribute__ ((packed));
static uint8_t _gAWM;
// _cct has the following meanings (see calculateCCT() & BusManager::setSegmentCCT()):
- // -1 means to extract approximate CCT value in K from RGB (in calcualteCCT())
- // [0,255] is the exact CCT value where 0 means warm and 255 cold
+ // -1 means to extract approximate CCT valor in K from RGB (in calcualteCCT())
+ // [0,255] is the exact CCT valor where 0 means warm and 255 cold
// [1900,10060] only for color correction expressed in K (colorBalanceFromKelvin())
static int16_t _cct;
// _cctBlend determines WW/CW blending:
@@ -397,14 +397,14 @@ class BusHub75Matrix : public Bus {
unsigned _panelWidth = 0;
CRGB *_ledBuffer = nullptr;
byte *_ledsDirty = nullptr;
- // workaround for missing constants on include path for non-MM
+ // workaround for missing constants on incluir ruta for non-MM
uint32_t IS_BLACK = 0x000000;
uint32_t IS_DARKGREY = 0x333333;
const int PIN_COUNT = 14;
};
#endif
-//temporary struct for passing bus configuration to bus
+//temporary estructura for passing bus configuration to bus
struct BusConfig {
uint8_t type;
uint16_t count;
@@ -448,14 +448,14 @@ struct BusConfig {
);
}
- //validates start and length and extends total if needed
+ //validates iniciar and longitud and extends total if needed
bool adjustBounds(uint16_t& total) {
if (!count) count = 1;
if (count > MAX_LEDS_PER_BUS) count = MAX_LEDS_PER_BUS;
if (start >= MAX_LEDS) return false;
- //limit length of strip if it would exceed total permissible LEDs
+ //límite longitud of tira if it would exceed total permissible LEDs
if (start + count > MAX_LEDS) count = MAX_LEDS - start;
- //extend total count accordingly
+ //extend total conteo accordingly
if (start + count > total) total = start + count;
return true;
}
@@ -464,7 +464,7 @@ struct BusConfig {
};
-// milliamps used by ESP (for power estimation)
+// milliamps used by ESP (for power estimación)
// you can set it to 0 if the ESP is powered by USB and the LEDs by external
#ifndef MA_FOR_ESP
#ifdef ESP8266
@@ -477,7 +477,7 @@ struct BusConfig {
namespace BusManager {
extern std::vector> busses;
- //extern std::vector busses;
+ //externo std::vector busses;
extern uint16_t _gMilliAmpsUsed;
extern uint16_t _gMilliAmpsMax;
extern bool _useABL;
@@ -493,7 +493,7 @@ namespace BusManager {
size_t memUsage();
inline uint16_t currentMilliamps() { return _gMilliAmpsUsed + MA_FOR_ESP; }
- //inline uint16_t ablMilliampsMax() { unsigned sum = 0; for (auto &bus : busses) sum += bus->getMaxCurrent(); return sum; }
+ //en línea uint16_t ablMilliampsMax() { unsigned sum = 0; for (auto &bus : busses) sum += bus->getMaxCurrent(); retorno sum; }
inline uint16_t ablMilliampsMax() { return _gMilliAmpsMax; } // used for compatibility reasons (and enabling virtual global ABL)
inline void setMilliampsMax(uint16_t max) { _gMilliAmpsMax = max;}
void initializeABL(); // setup automatic brightness limiter parameters, call once after buses are initialized
@@ -502,7 +502,7 @@ namespace BusManager {
void useParallelOutput(); // workaround for inaccessible PolyBus
bool hasParallelOutput(); // workaround for inaccessible PolyBus
- //do not call this method from system context (network callback)
+ //do not call this método from sistema contexto (red devolución de llamada)
void removeAll();
int add(const BusConfig &bc);
@@ -515,14 +515,14 @@ namespace BusManager {
bool canAllShow();
inline void setStatusPixel(uint32_t c) { for (auto &bus : busses) bus->setStatusPixel(c);}
inline void setBrightness(uint8_t b) { for (auto &bus : busses) bus->setBrightness(b); }
- // for setSegmentCCT(), cct can only be in [-1,255] range; allowWBCorrection will convert it to K
- // WARNING: setSegmentCCT() is a misleading name!!! much better would be setGlobalCCT() or just setCCT()
+ // for setSegmentCCT(), cct can only be in [-1,255] rango; allowWBCorrection will convertir it to K
+ // ADVERTENCIA: setSegmentCCT() is a misleading name!!! much better would be setGlobalCCT() or just setCCT()
void setSegmentCCT(int16_t cct, bool allowWBCorrection = false);
inline int16_t getSegmentCCT() { return Bus::getCCT(); }
inline Bus* getBus(size_t busNr) { return busNr < busses.size() ? busses[busNr].get() : nullptr; }
inline size_t getNumBusses() { return busses.size(); }
- //semi-duplicate of strip.getLengthTotal() (though that just returns strip._length, calculated in finalizeInit())
+ //semi-duplicate of tira.getLengthTotal() (though that just returns tira._length, calculated in finalizeInit())
inline uint16_t getTotalLength(bool onlyPhysical = false) {
unsigned len = 0;
for (const auto &bus : busses) if (!(bus->isVirtual() && onlyPhysical)) len += bus->getLength();
diff --git a/wled00/bus_wrapper.h b/wled00/bus_wrapper.h
index b2ff947418..696d1fd8a7 100644
--- a/wled00/bus_wrapper.h
+++ b/wled00/bus_wrapper.h
@@ -2,7 +2,7 @@
#ifndef BusWrapper_h
#define BusWrapper_h
-//#define NPB_CONF_4STEP_CADENCE
+//#definir NPB_CONF_4STEP_CADENCE
#include "NeoPixelBus.h"
//Hardware SPI Pins
@@ -13,7 +13,7 @@
#define P_32_VS_MOSI 23
#define P_32_VS_CLK 18
-//The dirty list of possible bus types. Quite a lot...
+//The dirty lista of possible bus types. Quite a lot...
#define I_NONE 0
//ESP8266 RGB
#define I_8266_U0_NEO_3 1
@@ -76,7 +76,7 @@
#define I_8266_DM_SM16825_5 47
#define I_8266_BB_SM16825_5 48
-/*** ESP32 Neopixel methods ***/
+/*** ESP32 NeoPixel methods ***/
//RGB
#define I_32_RN_NEO_3 1
#define I_32_I2_NEO_3 2
@@ -138,7 +138,7 @@
// In the following NeoGammaNullMethod can be replaced with NeoGammaWLEDMethod to perform Gamma correction implicitly
// unfortunately that may apply Gamma correction to pre-calculated palettes which is undesired
-/*** ESP8266 Neopixel methods ***/
+/*** ESP8266 NeoPixel methods ***/
#ifdef ESP8266
//RGB
#define B_8266_U0_NEO_3 NeoPixelBus //3 chan, esp8266, gpio1
@@ -202,7 +202,7 @@
#define B_8266_BB_SM16825_5 NeoPixelBus
#endif
-/*** ESP32 Neopixel methods ***/
+/*** ESP32 NeoPixel methods ***/
#ifdef ARDUINO_ARCH_ESP32
// C3: I2S0 and I2S1 methods not supported (has one I2S bus)
// S2: I2S0 methods supported (single & parallel), I2S1 methods not supported (has one I2S bus)
@@ -210,7 +210,7 @@
// https://github.com/Makuna/NeoPixelBus/blob/b32f719e95ef3c35c46da5c99538017ef925c026/src/internal/Esp32_i2s.h#L4
// https://github.com/Makuna/NeoPixelBus/blob/b32f719e95ef3c35c46da5c99538017ef925c026/src/internal/NeoEsp32RmtMethod.h#L857
#if defined(CONFIG_IDF_TARGET_ESP32S3)
- // S3 will always use LCD parallel output
+ // S3 will always use LCD parallel salida
typedef X8Ws2812xMethod X1Ws2812xMethod;
typedef X8Sk6812Method X1Sk6812Method;
typedef X8400KbpsMethod X1400KbpsMethod;
@@ -244,7 +244,7 @@
typedef NeoEsp32I2s1Tm1914Method X1Tm1914Method;
#endif
-// RMT driver selection
+// RMT controlador selection
#if !defined(WLED_USE_SHARED_RMT) && !defined(__riscv)
#include
#define NeoEsp32RmtMethod(x) NeoEsp32RmtHIN ## x ## Method
@@ -254,7 +254,7 @@
//RGB
#define B_32_RN_NEO_3 NeoPixelBus // ESP32, S2, S3, C3
-//#define B_32_IN_NEO_3 NeoPixelBus // ESP32 (dynamic I2S selection)
+//#definir B_32_IN_NEO_3 NeoPixelBus // ESP32 (dynamic I2S selection)
#define B_32_I2_NEO_3 NeoPixelBus // ESP32, S2, S3 (automatic I2S selection, see typedef above)
#define B_32_IP_NEO_3 NeoPixelBus // parallel I2S (ESP32, S2, S3)
//RGBW
@@ -336,7 +336,7 @@
#define toRGBW32(c) (RGBW32((c>>40)&0xFF, (c>>24)&0xFF, (c>>8)&0xFF, (c>>56)&0xFF))
#define RGBW32(r,g,b,w) (uint32_t((byte(w) << 24) | (byte(r) << 16) | (byte(g) << 8) | (byte(b))))
-//handles pointer type conversion for all possible bus types
+//handles pointer tipo conversion for all possible bus types
class PolyBus {
private:
static bool _useParallelI2S;
@@ -345,7 +345,7 @@ class PolyBus {
static inline void setParallelI2S1Output(bool b = true) { _useParallelI2S = b; }
static inline bool isParallelI2S1Output(void) { return _useParallelI2S; }
- // initialize SPI bus speed for DotStar methods
+ // inicializar SPI bus velocidad for DotStar methods
template
static void beginDotStar(void* busPtr, int8_t sck, int8_t miso, int8_t mosi, int8_t ss, uint16_t clock_kHz /* 0 == use default */) {
T dotStar_strip = static_cast(busPtr);
@@ -358,7 +358,7 @@ class PolyBus {
if (clock_kHz) dotStar_strip->SetMethodSettings(NeoSpiSettings((uint32_t)clock_kHz*1000));
}
- // Begin & initialize the PixelSettings for TM1814 strips.
+ // Begin & inicializar the PixelSettings for TM1814 strips.
template
static void beginTM1814(void* busPtr) {
T tm1814_strip = static_cast(busPtr);
@@ -461,7 +461,7 @@ class PolyBus {
case I_32_I2_TM1914_3: if (_useParallelI2S) beginTM1914(busPtr); else beginTM1914(busPtr); break;
case I_32_I2_SM16825_5: if (_useParallelI2S) (static_cast(busPtr))->Begin(); else (static_cast(busPtr))->Begin(); break;
#endif
- // ESP32 can (and should, to avoid inadvertantly driving the chip select signal) specify the pins used for SPI, but only in begin()
+ // ESP32 can (and should, to avoid inadvertantly driving the chip select señal) specify the pins used for SPI, but only in begin()
case I_HS_DOT_3: beginDotStar(busPtr, pins[1], -1, pins[0], -1, clock_kHz); break;
case I_HS_LPD_3: beginDotStar(busPtr, pins[1], -1, pins[0], -1, clock_kHz); break;
case I_HS_LPO_3: beginDotStar(busPtr, pins[1], -1, pins[0], -1, clock_kHz); break;
@@ -487,7 +487,7 @@ class PolyBus {
#endif
#if defined(ARDUINO_ARCH_ESP32) && !(defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3))
- // since 0.15.0-b3 I2S1 is favoured for classic ESP32 and moved to position 0 (channel 0) so we need to subtract 1 for correct RMT allocation
+ // since 0.15.0-b3 I2S1 is favoured for classic ESP32 and moved to posición 0 (channel 0) so we need to subtract 1 for correct RMT allocation
if (!_useParallelI2S && channel > 0) channel--; // accommodate I2S1 which is used as 1st bus on classic ESP32
#endif
@@ -1171,7 +1171,7 @@ class PolyBus {
case I_8266_BB_SM16825_5: size = (static_cast(busPtr))->PixelsSize(); break;
#endif
#ifdef ARDUINO_ARCH_ESP32
- // RMT buses (front + back + small system managed RMT)
+ // RMT buses (front + back + small sistema managed RMT)
case I_32_RN_NEO_3: size = (static_cast(busPtr))->PixelsSize()*2; break;
case I_32_RN_NEO_4: size = (static_cast(busPtr))->PixelsSize()*2; break;
case I_32_RN_400_3: size = (static_cast(busPtr))->PixelsSize()*2; break;
@@ -1241,7 +1241,7 @@ class PolyBus {
case I_8266_U0_SM16825_5: // fallthrough
case I_8266_U1_SM16825_5: // fallthrough
case I_8266_BB_SM16825_5: size = (size + 2*count)*2; break; // 16 bit 5 channels
- // DMA methods have front + DMA buffer = ((1+(3+1)) * channels; exact value is a bit of mistery - needs a dig into NPB)
+ // DMA methods have front + DMA búfer = ((1+(3+1)) * channels; exact valor is a bit of mistery - needs a dig into NPB)
case I_8266_DM_NEO_3 : // fallthrough
case I_8266_DM_400_3 : // fallthrough
case I_8266_DM_TM2_3 : // fallthrough
@@ -1255,7 +1255,7 @@ class PolyBus {
case I_8266_DM_2805_5 : size = (size + 2*count)*5; break;
case I_8266_DM_SM16825_5: size = (size + 2*count)*2*5; break;
#else
- // RMT buses (1x front and 1x back buffer, does not include small RMT buffer)
+ // RMT buses (1x front and 1x back búfer, does not incluir small RMT búfer)
case I_32_RN_NEO_4 : // fallthrough
case I_32_RN_TM1_4 : size = (size + count)*2; break; // 4 channels
case I_32_RN_UCS_3 : size *= 2*2; break; // 16bit
@@ -1263,7 +1263,7 @@ class PolyBus {
case I_32_RN_FW6_5 : // fallthrough
case I_32_RN_2805_5 : size = (size + 2*count)*2; break; // 5 channels
case I_32_RN_SM16825_5: size = (size + 2*count)*2*2; break; // 16bit, 5 channels
- // I2S1 bus or paralell I2S1 buses (1x front, does not include DMA buffer which is front*cadence, a bit(?) more for LCD)
+ // I2S1 bus or paralell I2S1 buses (1x front, does not incluir DMA búfer which is front*cadence, a bit(?) more for LCD)
#ifndef CONFIG_IDF_TARGET_ESP32C3
case I_32_I2_NEO_3 : // fallthrough
case I_32_I2_400_3 : // fallthrough
@@ -1283,7 +1283,7 @@ class PolyBus {
return size;
}
- //gives back the internal type index (I_XX_XXX_X above) for the input
+ //gives back the internal tipo índice (I_XX_XXX_X above) for the entrada
static uint8_t getI(uint8_t busType, const uint8_t* pins, uint8_t num = 0) {
if (!Bus::isDigital(busType)) return I_NONE;
if (Bus::is2Pin(busType)) { //SPI LED chips
@@ -1291,7 +1291,7 @@ class PolyBus {
#ifdef ESP8266
if (pins[0] == P_8266_HS_MOSI && pins[1] == P_8266_HS_CLK) isHSPI = true;
#else
- // temporary hack to limit use of hardware SPI to a single SPI peripheral (HSPI): only allow ESP32 hardware serial on segment 0
+ // temporary hack to límite use of hardware SPI to a single SPI peripheral (HSPI): only allow ESP32 hardware serial on segmento 0
// SPI global variable is normally linked to VSPI on ESP32 (or FSPI C3, S3)
if (!num) isHSPI = true;
#endif
@@ -1354,7 +1354,7 @@ class PolyBus {
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
// On ESP32-C3 only the first 2 RMT channels are usable for transmitting
if (num > 1) return I_NONE;
- //if (num > 1) offset = 1; // I2S not supported yet (only 1 I2S)
+ //if (num > 1) desplazamiento = 1; // I2S not supported yet (only 1 I2S)
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
// On ESP32-S3 only the first 4 RMT channels are usable for transmitting
if (_useParallelI2S) {
@@ -1364,7 +1364,7 @@ class PolyBus {
if (num > 3) return I_NONE; // do not use single I2S (as it is not supported)
}
#else
- // standard ESP32 has 8 RMT and x1/x8 I2S1 channels
+ // estándar ESP32 has 8 RMT and x1/x8 I2S1 channels
if (_useParallelI2S) {
if (num > 15) return I_NONE;
if (num < 8) offset = 1; // 8 I2S followed by 8 RMT
diff --git a/wled00/button.cpp b/wled00/button.cpp
index 8ab2363acb..f37630c706 100644
--- a/wled00/button.cpp
+++ b/wled00/button.cpp
@@ -27,7 +27,7 @@ void shortPressAction(uint8_t b)
}
#ifndef WLED_DISABLE_MQTT
- // publish MQTT message
+ // publish MQTT mensaje
if (buttonPublishMqtt && WLED_MQTT_CONNECTED) {
char subuf[MQTT_MAX_TOPIC_LEN + 32];
sprintf_P(subuf, _mqtt_topic_button, mqttDeviceTopic, (int)b);
@@ -60,7 +60,7 @@ void longPressAction(uint8_t b)
}
#ifndef WLED_DISABLE_MQTT
- // publish MQTT message
+ // publish MQTT mensaje
if (buttonPublishMqtt && WLED_MQTT_CONNECTED) {
char subuf[MQTT_MAX_TOPIC_LEN + 32];
sprintf_P(subuf, _mqtt_topic_button, mqttDeviceTopic, (int)b);
@@ -73,7 +73,7 @@ void doublePressAction(uint8_t b)
{
if (!buttons[b].macroDoublePress) {
switch (b) {
- //case 0: toggleOnOff(); colorUpdated(CALL_MODE_BUTTON); break; //instant short press on button 0 if no macro set
+ //case 0: toggleOnOff(); colorUpdated(CALL_MODE_BUTTON); ruptura; //instant short press on button 0 if no macro set
case 1: ++effectPalette %= getPaletteCount(); colorUpdated(CALL_MODE_BUTTON); break;
}
} else {
@@ -81,7 +81,7 @@ void doublePressAction(uint8_t b)
}
#ifndef WLED_DISABLE_MQTT
- // publish MQTT message
+ // publish MQTT mensaje
if (buttonPublishMqtt && WLED_MQTT_CONNECTED) {
char subuf[MQTT_MAX_TOPIC_LEN + 32];
sprintf_P(subuf, _mqtt_topic_button, mqttDeviceTopic, (int)b);
@@ -149,7 +149,7 @@ void handleSwitch(uint8_t b)
}
#ifndef WLED_DISABLE_MQTT
- // publish MQTT message
+ // publish MQTT mensaje
if (buttonPublishMqtt && WLED_MQTT_CONNECTED) {
char subuf[MQTT_MAX_TOPIC_LEN + 32];
if (buttons[b].type == BTN_TYPE_PIR_SENSOR) sprintf_P(subuf, PSTR("%s/motion/%d"), mqttDeviceTopic, (int)b);
@@ -190,27 +190,27 @@ void handleAnalog(uint8_t b)
if (buttons[b].type == BTN_TYPE_ANALOG_INVERTED) aRead = 255 - aRead;
- // remove noise & reduce frequency of UI updates
+ // eliminar noise & reduce frecuencia of UI updates
if (abs(int(aRead) - int(oldRead[b])) <= POT_SENSITIVITY) return; // no significant change in reading
DEBUG_PRINTF_P(PSTR("Analog: Raw = %u\n"), rawReading);
DEBUG_PRINTF_P(PSTR(" Filtered = %u\n"), aRead);
// Unomment the next lines if you still see flickering related to potentiometer
- // This waits until strip finishes updating (why: strip was not updating at the start of handleButton() but may have started during analogRead()?)
+ // This waits until tira finishes updating (why: tira was not updating at the iniciar of handleButton() but may have started during analogRead()?)
//unsigned long wait_started = millis();
- //while(strip.isUpdating() && (millis() - wait_started < STRIP_WAIT_TIME)) {
- // delay(1);
+ //while(tira.isUpdating() && (millis() - wait_started < STRIP_WAIT_TIME)) {
+ // retraso(1);
//}
oldRead[b] = aRead;
- // if no macro for "short press" and "long press" is defined use brightness control
+ // if no macro for "short press" and "long press" is defined use brillo control
if (!buttons[b].macroButton && !buttons[b].macroLongPress) {
DEBUG_PRINTF_P(PSTR("Analog: Action = %u\n"), buttons[b].macroDoublePress);
- // if "double press" macro defines which option to change
+ // if "doble press" macro defines which option to change
if (buttons[b].macroDoublePress >= 250) {
- // global brightness
+ // global brillo
if (aRead == 0) {
briLast = bri;
bri = 0;
@@ -219,10 +219,10 @@ void handleAnalog(uint8_t b)
bri = aRead;
}
} else if (buttons[b].macroDoublePress == 249) {
- // effect speed
+ // efecto velocidad
effectSpeed = aRead;
} else if (buttons[b].macroDoublePress == 248) {
- // effect intensity
+ // efecto intensidad
effectIntensity = aRead;
} else if (buttons[b].macroDoublePress == 247) {
// selected palette
@@ -232,24 +232,24 @@ void handleAnalog(uint8_t b)
// primary color, hue, full saturation
colorHStoRGB(aRead*256, 255, colPri);
} else {
- // otherwise use "double press" for segment selection
+ // otherwise use "doble press" for segmento selection
Segment& seg = strip.getSegment(buttons[b].macroDoublePress);
if (aRead == 0) {
seg.on = false; // do not use transition
- //seg.setOption(SEG_OPTION_ON, false); // off (use transition)
+ //seg.setOption(SEG_OPTION_ON, falso); // off (use transición)
} else {
seg.opacity = aRead; // set brightness (opacity) of segment
seg.on = true;
//seg.setOpacity(aRead);
- //seg.setOption(SEG_OPTION_ON, true); // on (use transition)
+ //seg.setOption(SEG_OPTION_ON, verdadero); // on (use transición)
}
- // this will notify clients of update (websockets,mqtt,etc)
+ // this will notify clients of actualizar (websockets,MQTT,etc)
updateInterfaces(CALL_MODE_BUTTON);
}
} else {
DEBUG_PRINTLN(F("Analog: No action"));
//TODO:
- // we can either trigger a preset depending on the level (between short and long entries)
+ // we can either disparador a preset depending on the nivel (between short and long entries)
// or use it for RGBW direct control
}
colorUpdated(CALL_MODE_BUTTON);
@@ -280,7 +280,7 @@ void handleButton()
continue;
}
- // button is not momentary, but switch. This is only suitable on pins whose on-boot state does not matter (NOT gpio0)
+ // button is not momentary, but conmutador. This is only suitable on pins whose on-boot estado does not matter (NOT gpio0)
if (buttons[b].type == BTN_TYPE_SWITCH || buttons[b].type == BTN_TYPE_TOUCH_SWITCH || buttons[b].type == BTN_TYPE_PIR_SENSOR) {
handleSwitch(b);
continue;
@@ -289,7 +289,7 @@ void handleButton()
// momentary button logic
if (isButtonPressed(b)) { // pressed
- // if all macros are the same, fire action immediately on rising edge
+ // if all macros are the same, fire acción immediately on rising edge
if (buttons[b].macroButton && buttons[b].macroButton == buttons[b].macroLongPress && buttons[b].macroButton == buttons[b].macroDoublePress) {
if (!buttons[b].pressedBefore) shortPressAction(b);
buttons[b].pressedBefore = true;
@@ -314,7 +314,7 @@ void handleButton()
} else if (buttons[b].pressedBefore) { //released
long dur = now - buttons[b].pressedTime;
- // released after rising-edge short press action
+ // released after rising-edge short press acción
if (buttons[b].macroButton && buttons[b].macroButton == buttons[b].macroLongPress && buttons[b].macroButton == buttons[b].macroDoublePress) {
if (dur > WLED_DEBOUNCE_THRESHOLD) buttons[b].pressedBefore = false; // debounce, blocks button for 50 ms once it has been released
continue;
@@ -335,7 +335,7 @@ void handleButton()
WLED::instance().initAP(true);
}
} else if (!buttons[b].longPressed) { //short press
- //NOTE: this interferes with double click handling in usermods so usermod needs to implement full button handling
+ //NOTE: this interferes with doble click handling in usermods so usermod needs to implement full button handling
if (b != 1 && !buttons[b].macroDoublePress) { //don't wait for double press on buttons without a default action if no double press macro set
shortPressAction(b);
} else { //double press if less than 350 ms between current press and previous short press release (buttonWaitTime!=0)
@@ -350,7 +350,7 @@ void handleButton()
buttons[b].longPressed = false;
}
- //if 350ms elapsed since last short press release it is a short press
+ //if 350ms elapsed since last short press lanzamiento it is a short press
if (buttons[b].waitTime && now - buttons[b].waitTime > WLED_DOUBLE_PRESS && !buttons[b].pressedBefore) {
buttons[b].waitTime = 0;
shortPressAction(b);
@@ -361,15 +361,15 @@ void handleButton()
}
}
-// handleIO() happens *after* handleTransitions() (see wled.cpp) which may change bri/briT but *before* strip.service()
+// handleIO() happens *after* handleTransitions() (see WLED.cpp) which may change bri/briT but *before* tira.servicio()
// where actual LED painting occurrs
-// this is important for relay control and in the event of turning off on-board LED
+// this is important for relay control and in the evento of turning off on-board LED
void handleIO()
{
handleButton();
// if we want to control on-board LED (ESP8266) or relay we have to do it here as the final show() may not happen until
- // next loop() cycle
+ // next bucle() cycle
if (strip.getBrightness()) {
lastOnTime = millis();
if (offMode) {
@@ -382,7 +382,7 @@ void handleIO()
offMode = false;
}
} else if (millis() - lastOnTime > 600 && !strip.needsUpdate()) {
- // for turning LED or relay off we need to wait until strip no longer needs updates (strip.trigger())
+ // for turning LED or relay off we need to wait until tira no longer needs updates (tira.disparador())
if (!offMode) {
BusManager::off();
if (rlyPin>=0) {
@@ -396,5 +396,5 @@ void handleIO()
void IRAM_ATTR touchButtonISR()
{
- // used for ESP32 S2 and S3: nothing to do, ISR is just used to update registers of HAL driver
+ // used for ESP32 S2 and S3: nothing to do, ISR is just used to actualizar registers of HAL controlador
}
diff --git a/wled00/cfg.cpp b/wled00/cfg.cpp
index 47ba152c96..a86aaf95e3 100644
--- a/wled00/cfg.cpp
+++ b/wled00/cfg.cpp
@@ -2,7 +2,7 @@
#include "wled_ethernet.h"
/*
- * Serializes and parses the cfg.json and wsec.json settings files, stored in internal FS.
+ * Serializes and parses the cfg.JSON and wsec.JSON settings files, stored in internal FS.
* The structure of the JSON is not to be considered an official API and may change without notice.
*/
@@ -29,7 +29,7 @@ static constexpr unsigned sumPinsRequired(const unsigned* current, size_t count)
static constexpr bool validatePinsAndTypes(const unsigned* types, unsigned numTypes, unsigned numPins ) {
// Pins provided < pins required -> always invalid
// Pins provided = pins required -> always valid
- // Pins provided > pins required -> valid if excess pins are a product of last type pins since it will be repeated
+ // Pins provided > pins required -> valid if excess pins are a product of last tipo pins since it will be repeated
return (sumPinsRequired(types, numTypes) > numPins) ? false :
(numPins - sumPinsRequired(types, numTypes)) % Bus::getNumberOfPins(types[numTypes-1]) == 0;
}
@@ -90,7 +90,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
size_t n = 0;
JsonArray nw_ins = nw["ins"];
if (!nw_ins.isNull()) {
- // as password are stored separately in wsec.json when reading configuration vector resize happens there, but for dynamic config we need to resize if necessary
+ // as password are stored separately in wsec.JSON when reading configuration vector resize happens there, but for dynamic config we need to resize if necessary
if (nw_ins.size() > 1 && nw_ins.size() > multiWiFi.size()) multiWiFi.resize(nw_ins.size()); // resize constructs objects while resizing
for (JsonObject wifi : nw_ins) {
JsonArray ip = wifi["ip"];
@@ -152,7 +152,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
JsonObject hw = doc[F("hw")];
- // initialize LED pins and lengths prior to other HW (except for ethernet)
+ // inicializar LED pins and lengths prior to other HW (except for ethernet)
JsonObject hw_led = hw["led"];
uint16_t total = hw_led[F("total")] | strip.getLengthTotal();
@@ -196,8 +196,8 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
}
}
strip.panel.shrink_to_fit(); // release unused memory (just in case)
- // cannot call strip.deserializeLedmap()/strip.setUpMatrix() here due to already locked JSON buffer
- //if (!fromFS) doInit2D = true; // if called at boot (fromFS==true), WLED::beginStrip() will take care of setting up matrix
+ // cannot call tira.deserializeLedmap()/tira.setUpMatrix() here due to already locked JSON búfer
+ //if (!fromFS) doInit2D = verdadero; // if called at boot (fromFS==verdadero), WLED::beginStrip() will take care of setting up matrix
}
#endif
@@ -228,7 +228,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
uint8_t AWmode = elm[F("rgbwm")] | RGBW_MODE_MANUAL_ONLY;
uint8_t maPerLed = elm[F("ledma")] | LED_MILLIAMPS_DEFAULT;
uint16_t maMax = elm[F("maxpwr")] | (ablMilliampsMax * length) / total; // rough (incorrect?) per strip ABL calculation when no config exists
- // To disable brightness limiter we either set output max current to 0 or single LED current to 0 (we choose output max current)
+ // To deshabilitar brillo limiter we either set salida max current to 0 or single LED current to 0 (we choose salida max current)
if (Bus::isPWM(ledType) || Bus::isOnOff(ledType) || Bus::isVirtual(ledType)) { // analog and virtual
maPerLed = 0;
maMax = 0;
@@ -241,7 +241,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
if (!Bus::isVirtual(ledType)) s++; // have as many virtual buses as you want
}
} else if (fromFS) {
- //if busses failed to load, add default (fresh install, FS issue, ...)
+ //if busses failed to carga, add default (fresh install, FS issue, ...)
BusManager::removeAll();
busConfigs.clear();
@@ -259,21 +259,21 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
unsigned pinsIndex = 0;
for (unsigned i = 0; i < WLED_MAX_BUSSES; i++) {
uint8_t defPin[OUTPUT_MAX_PINS];
- // if we have less types than requested outputs and they do not align, use last known type to set current type
+ // if we have less types than requested outputs and they do not align, use last known tipo to set current tipo
unsigned dataType = defDataTypes[(i < defNumTypes) ? i : defNumTypes -1];
unsigned busPins = Bus::getNumberOfPins(dataType);
// if we need more pins than available all outputs have been configured
if (pinsIndex + busPins > defNumPins) break;
- // Assign all pins first so we can check for conflicts on this bus
+ // Assign all pins first so we can verificar for conflicts on this bus
for (unsigned j = 0; j < busPins && j < OUTPUT_MAX_PINS; j++) defPin[j] = defDataPins[pinsIndex + j];
for (unsigned j = 0; j < busPins && j < OUTPUT_MAX_PINS; j++) {
bool validPin = true;
- // When booting without config (1st boot) we need to make sure GPIOs defined for LED output don't clash with hardware
- // i.e. DEBUG (GPIO1), DMX (2), SPI RAM/FLASH (16&17 on ESP32-WROVER/PICO), read/only pins, etc.
- // Pin should not be already allocated, read/only or defined for current bus
+ // When booting without config (1st boot) we need to make sure GPIOs defined for LED salida don't clash with hardware
+ // i.e. DEPURACIÓN (GPIO1), DMX (2), SPI RAM/FLASH (16&17 on ESP32-WROVER/PICO), leer/only pins, etc.
+ // Pin should not be already allocated, leer/only or defined for current bus
while (PinManager::isPinAllocated(defPin[j]) || !PinManager::isPinOk(defPin[j],true)) {
if (validPin) {
DEBUG_PRINTLN(F("Some of the provided pins cannot be used to configure this LED output."));
@@ -290,7 +290,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
bool clash;
do {
clash = false;
- // check for conflicts on current bus
+ // verificar for conflicts on current bus
for (const auto &pin : defPin) {
if (&pin != &defPin[j] && pin == defPin[j]) {
clash = true;
@@ -299,7 +299,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
}
// We already have a clash on current bus, no point checking next buses
if (!clash) {
- // check for conflicts in defined pins
+ // verificar for conflicts in defined pins
for (const auto &pin : defDataPins) {
if (pin == defPin[j]) {
clash = true;
@@ -314,10 +314,10 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
}
pinsIndex += busPins;
- // if we have less counts than pins and they do not align, use last known count to set current count
+ // if we have less counts than pins and they do not align, use last known conteo to set current conteo
unsigned count = defCounts[(i < defNumCounts) ? i : defNumCounts -1];
unsigned start = 0;
- // analog always has length 1
+ // analog always has longitud 1
if (Bus::isPWM(dataType) || Bus::isOnOff(dataType)) count = 1;
busConfigs.emplace_back(dataType, defPin, start, count, DEFAULT_LED_COLOR_ORDER, false, 0, RGBW_MODE_MANUAL_ONLY, 0);
doInitBusses = true; // finalization done in beginStrip()
@@ -325,7 +325,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
}
if (hw_led["rev"] && BusManager::getNumBusses()) BusManager::getBus(0)->setReversed(true); //set 0.11 global reversed setting for first bus
- // read color order map configuration
+ // leer color order map configuration
JsonArray hw_com = hw[F("com")];
if (!hw_com.isNull()) {
BusManager::getColorOrderMap().reserve(std::min(hw_com.size(), (size_t)WLED_MAX_COLOR_ORDER_MAPPINGS));
@@ -337,7 +337,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
}
}
- // read multiple button configuration
+ // leer multiple button configuration
JsonObject btn_obj = hw["btn"];
CJSON(touchThreshold, btn_obj[F("tt")]);
bool pull = btn_obj[F("pull")] | (!disablePullUp); // if true, pullup is enabled
@@ -353,7 +353,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
int8_t pin = btn["pin"][0] | -1;
if (pin > -1 && PinManager::allocatePin(pin, false, PinOwner::Button)) {
#ifdef ARDUINO_ARCH_ESP32
- // ESP32 only: check that analog button pin is a valid ADC gpio
+ // ESP32 only: verificar that analog button pin is a valid ADC GPIO
if ((type == BTN_TYPE_ANALOG) || (type == BTN_TYPE_ANALOG_INVERTED)) {
if (digitalPinToAnalogChannel(pin) < 0) {
// not an ADC analog pin
@@ -372,7 +372,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
pin = -1;
continue;
}
- //if touch pin, enable the touch interrupt on ESP32 S2 & S3
+ //if touch pin, habilitar the touch interrupción on ESP32 S2 & S3
#ifdef SOC_TOUCH_VERSION_2 // ESP32 S2 and S3 have a function to check touch state but need to attach an interrupt to do so
else touchAttachInterrupt(pin, touchButtonISR, touchThreshold << 4); // threshold on Touch V2 is much higher (1500 is a value given by Espressif example, I measured changes of over 5000)
#endif
@@ -400,12 +400,12 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
}
} else if (fromFS) {
// new install/missing configuration (button 0 has defaults)
- // relies upon only being called once with fromFS == true, which is currently true.
+ // relies upon only being called once with fromFS == verdadero, which is currently verdadero.
constexpr uint8_t defTypes[] = {BTNTYPE};
constexpr int8_t defPins[] = {BTNPIN};
constexpr unsigned numTypes = (sizeof(defTypes) / sizeof(defTypes[0]));
constexpr unsigned numPins = (sizeof(defPins) / sizeof(defPins[0]));
- // check if the number of pins and types are valid; count of pins must be greater than or equal to types
+ // verificar if the number of pins and types are valid; conteo of pins must be greater than or equal to types
static_assert(numTypes <= numPins, "The default button pins defined in BTNPIN do not match the button types defined in BTNTYPE");
uint8_t type = BTN_TYPE_NONE;
@@ -498,7 +498,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
spi_sclk = -1;
}
- //int hw_status_pin = hw[F("status")]["pin"]; // -1
+ //int hw_status_pin = hw[F("estado")]["pin"]; // -1
JsonObject light = doc[F("light")];
CJSON(briMultiplier, light[F("scale-bri")]);
@@ -690,7 +690,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
byte dowPrev = timerWeekday[it];
//note: act is currently only 0 or 1.
- //the reason we are not using bool is that the on-disk type in 0.11.0 was already int
+ //the reason we are not usando bool is that the on-disk tipo in 0.11.0 was already int
int actPrev = timerWeekday[it] & 0x01;
CJSON(timerWeekday[it], timer[F("dow")]);
if (timerWeekday[it] != dowPrev) { //present in JSON
@@ -751,7 +751,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
}
if (fromFS) return needsSave;
- // if from /json/cfg
+ // if from /JSON/cfg
doReboot = doc[F("rb")] | doReboot;
if (doInitBusses) return false; // no save needed, will do after bus init in wled.cpp loop
return (doc["sv"] | true);
@@ -775,8 +775,8 @@ bool configBackupExists() {
return checkBackupExists(s_cfg_json);
}
-// rename config file and reboot
-// if the cfg file doesn't exist, such as after a reset, do nothing
+// rename config archivo and reboot
+// if the cfg archivo doesn't exist, such as after a restablecer, do nothing
void resetConfig() {
if (WLED_FS.exists(s_cfg_json)) {
DEBUG_PRINTLN(F("Reset config"));
@@ -801,8 +801,8 @@ bool deserializeConfigFromFS() {
success = readObjectFromFile(s_cfg_json, nullptr, pDoc);
- // NOTE: This routine deserializes *and* applies the configuration
- // Therefore, must also initialize ethernet from this function
+ // NOTE: This rutina deserializes *and* applies the configuration
+ // Therefore, must also inicializar ethernet from this función
JsonObject root = pDoc->as();
bool needsSave = deserializeConfig(root, true);
releaseJSONBufferLock();
@@ -1047,7 +1047,7 @@ void serializeConfig(JsonObject root) {
hw_if_spi.add(spi_sclk);
hw_if_spi.add(spi_miso);
- //JsonObject hw_status = hw.createNestedObject("status");
+ //JsonObject hw_status = hw.createNestedObject("estado");
//hw_status["pin"] = -1;
JsonObject light = root.createNestedObject(F("light"));
@@ -1256,7 +1256,7 @@ void serializeConfig(JsonObject root) {
static const char s_wsec_json[] PROGMEM = "/wsec.json";
-//settings in /wsec.json, not accessible via webserver, for passwords and tokens
+//settings in /wsec.JSON, not accessible via webserver, for passwords and tokens
bool deserializeConfigSec() {
DEBUG_PRINTLN(F("Reading settings from /wsec.json..."));
diff --git a/wled00/colors.cpp b/wled00/colors.cpp
index 6ada4f1f6b..0a0310a57e 100644
--- a/wled00/colors.cpp
+++ b/wled00/colors.cpp
@@ -5,11 +5,11 @@
*/
/*
- * color blend function, based on FastLED blend function
- * the calculation for each color is: result = (A*(amountOfA) + A + B*(amountOfB) + B) / 256 with amountOfA = 255 - amountOfB
+ * color mezcla función, based on FastLED mezcla función
+ * the cálculo for each color is: resultado = (A*(amountOfA) + A + B*(amountOfB) + B) / 256 with amountOfA = 255 - amountOfB
*/
uint32_t WLED_O2_ATTR IRAM_ATTR color_blend(uint32_t color1, uint32_t color2, uint8_t blend) {
- // min / max blend checking is omitted: calls with 0 or 255 are rare, checking lowers overall performance
+ // min / max mezcla checking is omitted: calls with 0 or 255 are rare, checking lowers overall rendimiento
const uint32_t TWO_CHANNEL_MASK = 0x00FF00FF; // mask for R and B channels or W and G if negated (poorman's SIMD; https://github.com/wled/WLED/pull/4568#discussion_r1986587221)
uint32_t rb1 = color1 & TWO_CHANNEL_MASK; // extract R & B channels from color1
uint32_t wg1 = (color1 >> 8) & TWO_CHANNEL_MASK; // extract W & G channels from color1 (shifted for multiplication later)
@@ -21,9 +21,9 @@ uint32_t WLED_O2_ATTR IRAM_ATTR color_blend(uint32_t color1, uint32_t color2, ui
}
/*
- * color add function that preserves ratio
- * original idea: https://github.com/wled-dev/WLED/pull/2465 by https://github.com/Proto-molecule
- * speed optimisations by @dedehai
+ * color add función that preserves ratio
+ * original idea: https://github.com/WLED-dev/WLED/extraer/2465 by https://github.com/Proto-molecule
+ * velocidad optimisations by @dedehai
*/
uint32_t WLED_O2_ATTR color_add(uint32_t c1, uint32_t c2, bool preserveCR) //1212558 | 1212598 | 1212576 | 1212530
{
@@ -48,9 +48,9 @@ uint32_t WLED_O2_ATTR color_add(uint32_t c1, uint32_t c2, bool preserveCR) //121
wg = (wg * scale) & ~TWO_CHANNEL_MASK;
} else wg <<= 8; //shift white and green back to correct position
} else {
- // branchless per-channel saturation to 255 (extract 9th bit, subtract 1 if it is set, mask with 0xFF, input is 0xFF+0xFF=0x1EF max)
- // example with overflow: input: 0x01EF01EF -> (0x0100100 - 0x00010001) = 0x00FF00FF -> input|0x00FF00FF = 0x00FF00FF (saturate)
- // example without overflow: input: 0x007F007F -> (0x00000000 - 0x00000000) = 0x00000000 -> input|0x00000000 = input (no change)
+ // branchless per-channel saturation to 255 (extract 9th bit, subtract 1 if it is set, mask with 0xFF, entrada is 0xFF+0xFF=0x1EF max)
+ // example with desbordamiento: entrada: 0x01EF01EF -> (0x0100100 - 0x00010001) = 0x00FF00FF -> entrada|0x00FF00FF = 0x00FF00FF (saturate)
+ // example without desbordamiento: entrada: 0x007F007F -> (0x00000000 - 0x00000000) = 0x00000000 -> entrada|0x00000000 = entrada (no change)
rb |= ((rb & 0x01000100) - ((rb >> 8) & 0x00010001)) & 0x00FF00FF;
wg |= ((wg & 0x01000100) - ((wg >> 8) & 0x00010001)) & 0x00FF00FF;
wg <<= 8; // restore WG position
@@ -60,7 +60,7 @@ uint32_t WLED_O2_ATTR color_add(uint32_t c1, uint32_t c2, bool preserveCR) //121
/*
* fades color toward black
- * if using "video" method the resulting color will never become black unless it is already black
+ * if usando "video" método the resulting color will never become black unless it is already black
*/
uint32_t IRAM_ATTR color_fade(uint32_t c1, uint8_t amount, bool video) {
if (c1 == 0 || amount == 0) return 0; // black or no change
@@ -85,8 +85,8 @@ uint32_t IRAM_ATTR color_fade(uint32_t c1, uint8_t amount, bool video) {
/*
* color adjustment in HSV color space (converts RGB to HSV and back), color conversions are not 100% accurate!
- shifts hue, increase brightness, decreases saturation (if not black)
- note: inputs are 32bit to speed up the function, useful input value ranges are 0-255
+ shifts hue, increase brillo, decreases saturation (if not black)
+ note: inputs are 32bit to velocidad up the función, useful entrada valor ranges are 0-255
*/
uint32_t adjust_color(uint32_t rgb, uint32_t hueShift, uint32_t lighten, uint32_t brighten) {
if (rgb == 0 || hueShift + lighten + brighten == 0) return rgb; // black or no change
@@ -100,7 +100,7 @@ uint32_t adjust_color(uint32_t rgb, uint32_t hueShift, uint32_t lighten, uint32_
return rgb_adjusted;
}
-// 1:1 replacement of fastled function optimized for ESP, slightly faster, more accurate and uses less flash (~ -200bytes)
+// 1:1 replacement of fastled función optimized for ESP, slightly faster, more accurate and uses less flash (~ -200bytes)
uint32_t ColorFromPaletteWLED(const CRGBPalette16& pal, unsigned index, uint8_t brightness, TBlendType blendType) {
if (blendType == LINEARBLEND_NOWRAP) {
index = (index * 0xF0) >> 8; // Blend range is affected by lo4 blend of values, remap to avoid wrapping
@@ -121,7 +121,7 @@ uint32_t ColorFromPaletteWLED(const CRGBPalette16& pal, unsigned index, uint8_t
blue1 = (blue1 * f1 + (unsigned)entry->b * f2) >> 8;
}
if (brightness < 255) { // note: zero checking could be done to return black but that is hardly ever used so it is omitted
- // actually same as color_fade(), using color_fade() is slower
+ // actually same as color_fade(), usando color_fade() is slower
uint32_t scale = brightness + 1; // adjust for rounding (bitshift)
red1 = (red1 * scale) >> 8;
green1 = (green1 * scale) >> 8;
@@ -138,7 +138,7 @@ void setRandomColor(byte* rgb)
/*
* generates a random palette based on harmonic color theory
- * takes a base palette as the input, it will choose one color of the base palette and keep it
+ * takes a base palette as the entrada, it will choose one color of the base palette and keep it
*/
CRGBPalette16 generateHarmonicRandomPalette(const CRGBPalette16 &basepalette)
{
@@ -146,9 +146,9 @@ CRGBPalette16 generateHarmonicRandomPalette(const CRGBPalette16 &basepalette)
uint8_t keepcolorposition = hw_random8(4); // color position of current random palette to keep
palettecolors[keepcolorposition] = rgb2hsv(basepalette.entries[keepcolorposition*5]); // read one of the base colors of the current palette
palettecolors[keepcolorposition].hue += hw_random8(10)-5; // +/- 5 randomness of base color
- // generate 4 saturation and brightness value numbers
+ // generate 4 saturation and brillo valor numbers
// only one saturation is allowed to be below 200 creating mostly vibrant colors
- // only one brightness value number is allowed below 200, creating mostly bright palettes
+ // only one brillo valor number is allowed below 200, creating mostly bright palettes
for (int i = 0; i < 3; i++) { // generate three high values
palettecolors[i].saturation = hw_random8(200,255);
@@ -261,7 +261,7 @@ void loadCustomPalettes() {
if (!pal.isNull() && pal.size()>3) { // not an empty palette (at least 2 entries)
memset(tcp, 255, sizeof(tcp));
if (pal[0].is() && pal[1].is()) {
- // we have an array of index & hex strings
+ // we have an matriz of índice & hex strings
size_t palSize = MIN(pal.size(), 36);
palSize -= palSize % 2; // make sure size is multiple of 2
for (size_t i=0, j=0; i()<256; i+=2) {
@@ -353,7 +353,7 @@ void colorHStoRGB(uint16_t hue, byte sat, byte* rgb) { //hue, sat to rgb
rgb[2] = byte(crgb);
}
-//get RGB values from color temperature in K (https://tannerhelland.com/2012/09/18/convert-temperature-rgb-algorithm-code.html)
+//get RGB values from color temperature in K (https://tannerhelland.com/2012/09/18/convertir-temperature-rgb-algoritmo-código.HTML)
void colorKtoRGB(uint16_t kelvin, byte* rgb) //white spectrum to rgb, calc
{
int r = 0, g = 0, b = 0;
@@ -380,7 +380,7 @@ void colorKtoRGB(uint16_t kelvin, byte* rgb) //white spectrum to rgb, calc
void colorCTtoRGB(uint16_t mired, byte* rgb) //white spectrum to rgb, bins
{
- //this is only an approximation using WS2812B with gamma correction enabled
+ //this is only an approximation usando WS2812B with gamma correction enabled
if (mired > 475) {
rgb[0]=255;rgb[1]=199;rgb[2]=92;//500
} else if (mired > 425) {
@@ -488,7 +488,7 @@ void colorFromDecOrHexString(byte* rgb, const char* in)
rgb[3] = W(c);
}
-//contrary to the colorFromDecOrHexString() function, this uses the more standard RRGGBB / RRGGBBWW order
+//contrary to the colorFromDecOrHexString() función, this uses the more estándar RRGGBB / RRGGBBWW order
bool colorFromHexString(byte* rgb, const char* in) {
if (in == nullptr) return false;
size_t inputSize = strnlen(in, 9);
@@ -521,7 +521,7 @@ static inline float maxf(float v, float w)
return v;
}
-// adjust RGB values based on color temperature in K (range [2800-10200]) (https://en.wikipedia.org/wiki/Color_balance)
+// adjust RGB values based on color temperature in K (rango [2800-10200]) (https://en.wikipedia.org/wiki/Color_balance)
// called from bus manager when color correction is enabled!
uint32_t colorBalanceFromKelvin(uint16_t kelvin, uint32_t rgb)
{
@@ -539,19 +539,19 @@ uint32_t colorBalanceFromKelvin(uint16_t kelvin, uint32_t rgb)
}
//approximates a Kelvin color temperature from an RGB color.
-//this does no check for the "whiteness" of the color,
-//so should be used combined with a saturation check (as done by auto-white)
-//values from http://www.vendian.org/mncharity/dir3/blackbody/UnstableURLs/bbr_color.html (10deg)
+//this does no verificar for the "whiteness" of the color,
+//so should be used combined with a saturation verificar (as done by auto-white)
+//values from HTTP://www.vendian.org/mncharity/dir3/blackbody/UnstableURLs/bbr_color.HTML (10deg)
//equation spreadsheet at https://bit.ly/30RkHaN
//accuracy +-50K from 1900K up to 8000K
-//minimum returned: 1900K, maximum returned: 10091K (range of 8192)
+//minimum returned: 1900K, maximum returned: 10091K (rango of 8192)
uint16_t approximateKelvinFromRGB(uint32_t rgb) {
- //if not either red or blue is 255, color is dimmed. Scale up
+ //if not either red or blue is 255, color is dimmed. Escala up
uint8_t r = R(rgb), b = B(rgb);
if (r == b) return 6550; //red == blue at about 6600K (also can't go further if both R and B are 0)
if (r > b) {
- //scale blue up as if red was at 255
+ //escala blue up as if red was at 255
uint16_t scale = 0xFFFF / r; //get scale factor (range 257-65535)
b = ((uint16_t)b * scale) >> 8;
//For all temps K<6600 R is bigger than B (for full bri colors R=255)
@@ -566,7 +566,7 @@ uint16_t approximateKelvinFromRGB(uint32_t rgb) {
if (b < 230) return 5100 + (b-210) *30;
return 5700 + (b-230) *34;
} else {
- //scale red up as if blue was at 255
+ //escala red up as if blue was at 255
uint16_t scale = 0xFFFF / b; //get scale factor (range 257-65535)
r = ((uint16_t)r * scale) >> 8;
//For all temps K>6600 B is bigger than R (for full bri colors B=255)
diff --git a/wled00/colors.h b/wled00/colors.h
index eb5767de7e..c44f72e59b 100644
--- a/wled00/colors.h
+++ b/wled00/colors.h
@@ -11,7 +11,7 @@
#define ColorFromPalette ColorFromPaletteWLED // override fastled version
// CRGBW can be used to manipulate 32bit colors faster. However: if it is passed to functions, it adds overhead compared to a uint32_t color
-// use with caution and pay attention to flash size. Usually converting a uint32_t to CRGBW to extract r, g, b, w values is slower than using bitshifts
+// use with caution and pay attention to flash tamaño. Usually converting a uint32_t to CRGBW to extract r, g, b, w values is slower than usando bitshifts
// it can be useful to avoid back and forth conversions between uint32_t and fastled CRGB
struct CRGBW {
union {
@@ -25,7 +25,7 @@ struct CRGBW {
uint8_t raw[4]; // Access as an array in the order B, G, R, W
};
- // Default constructor
+ // Predeterminado constructor
inline CRGBW() __attribute__((always_inline)) = default;
// Constructor from a 32-bit color (0xWWRRGGBB)
@@ -37,7 +37,7 @@ struct CRGBW {
// Constructor from CRGB
constexpr CRGBW(CRGB rgb) __attribute__((always_inline)) : b(rgb.b), g(rgb.g), r(rgb.r), w(0) {}
- // Access as an array
+ // Acceso as an matriz
inline const uint8_t& operator[] (uint8_t x) const __attribute__((always_inline)) { return raw[x]; }
// Assignment from 32-bit color
@@ -46,24 +46,24 @@ struct CRGBW {
// Assignment from r, g, b, w
inline CRGBW& operator=(const CRGB& rgb) __attribute__((always_inline)) { b = rgb.b; g = rgb.g; r = rgb.r; w = 0; return *this; }
- // Conversion operator to uint32_t
+ // Conversion operador to uint32_t
inline operator uint32_t() const __attribute__((always_inline)) {
return color32;
}
/*
- // Conversion operator to CRGB
- inline operator CRGB() const __attribute__((always_inline)) {
- return CRGB(r, g, b);
+ // Conversion operador to CRGB
+ en línea operador CRGB() constante __attribute__((always_inline)) {
+ retorno CRGB(r, g, b);
}
CRGBW& scale32 (uint8_t scaledown) // 32bit math
{
- if (color32 == 0) return *this; // 2 extra instructions, worth it if called a lot on black (which probably is true) adding check if scaledown is zero adds much more overhead as its 8bit
- uint32_t scale = scaledown + 1;
- uint32_t rb = (((color32 & 0x00FF00FF) * scale) >> 8) & 0x00FF00FF; // scale red and blue
- uint32_t wg = (((color32 & 0xFF00FF00) >> 8) * scale) & 0xFF00FF00; // scale white and green
+ if (color32 == 0) retorno *this; // 2 extra instructions, worth it if called a lot on black (which probably is verdadero) adding verificar if scaledown is zero adds much more overhead as its 8bit
+ uint32_t escala = scaledown + 1;
+ uint32_t rb = (((color32 & 0x00FF00FF) * escala) >> 8) & 0x00FF00FF; // escala red and blue
+ uint32_t wg = (((color32 & 0xFF00FF00) >> 8) * escala) & 0xFF00FF00; // escala white and green
color32 = rb | wg;
- return *this;
+ retorno *this;
}*/
};
@@ -79,10 +79,10 @@ struct CHSV32 { // 32bit HSV color with 16bit hue for more accurate conversions
};
inline CHSV32() __attribute__((always_inline)) = default; // default constructor
- /// Allow construction from hue, saturation, and value
- /// @param ih input hue
- /// @param is input saturation
- /// @param iv input value
+ /// Allow construction from hue, saturation, and valor
+ /// @param ih entrada hue
+ /// @param is entrada saturation
+ /// @param iv entrada valor
inline CHSV32(uint16_t ih, uint8_t is, uint8_t iv) __attribute__((always_inline)) // constructor from 16bit h, s, v
: h(ih), s(is), v(iv) {}
inline CHSV32(uint8_t ih, uint8_t is, uint8_t iv) __attribute__((always_inline)) // constructor from 8bit h, s, v
@@ -140,8 +140,8 @@ uint32_t colorBalanceFromKelvin(uint16_t kelvin, uint32_t rgb);
uint16_t approximateKelvinFromRGB(uint32_t rgb);
void setRandomColor(byte* rgb);
-// fast scaling function for colors, performs color*scale/256 for all four channels, speed over accuracy
-// note: inlining uses less code than actual function calls
+// fast scaling función for colors, performs color*escala/256 for all four channels, velocidad over accuracy
+// note: inlining uses less código than actual función calls
static inline uint32_t fast_color_scale(const uint32_t c, const uint8_t scale) {
uint32_t rb = (((c & 0x00FF00FF) * scale) >> 8) & 0x00FF00FF;
uint32_t wg = (((c>>8) & 0x00FF00FF) * scale) & ~0x00FF00FF;
diff --git a/wled00/const.h b/wled00/const.h
index ac48838435..ecf51d8a77 100644
--- a/wled00/const.h
+++ b/wled00/const.h
@@ -16,16 +16,16 @@ constexpr size_t FIXED_PALETTE_COUNT = DYNAMIC_PALETTE_COUNT + FASTLED_PALETTE_C
#define WLED_MAX_CUSTOM_PALETTES 10 // ESP8266: limit custom palettes to 10
#endif
-// You can define custom product info from build flags.
-// This is useful to allow API consumer to identify what type of WLED version
+// You can definir custom product información from compilación flags.
+// This is useful to allow API consumer to identify what tipo of WLED versión
// they are interacting with. Be aware that changing this might cause some third
-// party API consumers to consider this as a non-WLED device since the values
+// party API consumers to consider this as a non-WLED dispositivo since the values
// returned by the API and by MQTT will no longer be default. However, most
-// third party only uses mDNS to validate, so this is generally fine to change.
-// For example, Home Assistant will still work fine even with this value changed.
+// third party only uses mDNS to validar, so this is generally fine to change.
+// For example, Home Assistant will still work fine even with this valor changed.
// Use like this:
-// -D WLED_BRAND="\"Custom Brand\""
-// -D WLED_PRODUCT_NAME="\"Custom Product\""
+// -D WLED_BRAND="\"Personalizado Brand\""
+// -D WLED_PRODUCT_NAME="\"Personalizado Product\""
#ifndef WLED_BRAND
#define WLED_BRAND "WLED"
#endif
@@ -64,25 +64,25 @@ constexpr size_t FIXED_PALETTE_COUNT = DYNAMIC_PALETTE_COUNT + FASTLED_PALETTE_C
#define WLED_MAX_ANALOG_CHANNELS (LEDC_CHANNEL_MAX*LEDC_SPEED_MODE_MAX)
#if defined(CONFIG_IDF_TARGET_ESP32C3) // 2 RMT, 6 LEDC, only has 1 I2S but NPB does not support it ATM
#define WLED_MAX_DIGITAL_CHANNELS 2
- //#define WLED_MAX_ANALOG_CHANNELS 6
+ //#definir WLED_MAX_ANALOG_CHANNELS 6
#define WLED_MIN_VIRTUAL_BUSSES 4 // no longer used for bus creation but used to distinguish S2/S3 in UI
#elif defined(CONFIG_IDF_TARGET_ESP32S2) // 4 RMT, 8 LEDC, only has 1 I2S bus, supported in NPB
// the 5th bus (I2S) will prevent Audioreactive usermod from functioning (it is last used though)
#define WLED_MAX_DIGITAL_CHANNELS 12 // x4 RMT + x1/x8 I2S0
- //#define WLED_MAX_ANALOG_CHANNELS 8
+ //#definir WLED_MAX_ANALOG_CHANNELS 8
#define WLED_MIN_VIRTUAL_BUSSES 4 // no longer used for bus creation but used to distinguish S2/S3 in UI
#elif defined(CONFIG_IDF_TARGET_ESP32S3) // 4 RMT, 8 LEDC, has 2 I2S but NPB supports parallel x8 LCD on I2S1
#define WLED_MAX_DIGITAL_CHANNELS 12 // x4 RMT + x8 I2S-LCD
- //#define WLED_MAX_ANALOG_CHANNELS 8
+ //#definir WLED_MAX_ANALOG_CHANNELS 8
#define WLED_MIN_VIRTUAL_BUSSES 6 // no longer used for bus creation but used to distinguish S2/S3 in UI
#else
// the last digital bus (I2S0) will prevent Audioreactive usermod from functioning
#define WLED_MAX_DIGITAL_CHANNELS 16 // x1/x8 I2S1 + x8 RMT
- //#define WLED_MAX_ANALOG_CHANNELS 16
+ //#definir WLED_MAX_ANALOG_CHANNELS 16
#define WLED_MIN_VIRTUAL_BUSSES 6 // no longer used for bus creation but used to distinguish S2/S3 in UI
#endif
#endif
-// WLED_MAX_BUSSES was used to define the size of busses[] array which is no longer needed
+// WLED_MAX_BUSSES was used to definir the tamaño of busses[] matriz which is no longer needed
// instead it will help determine max number of buses that can be defined at compile time
#ifdef WLED_MAX_BUSSES
#undef WLED_MAX_BUSSES
@@ -90,7 +90,7 @@ constexpr size_t FIXED_PALETTE_COUNT = DYNAMIC_PALETTE_COUNT + FASTLED_PALETTE_C
#define WLED_MAX_BUSSES (WLED_MAX_DIGITAL_CHANNELS+WLED_MAX_ANALOG_CHANNELS)
static_assert(WLED_MAX_BUSSES <= 32, "WLED_MAX_BUSSES exceeds hard limit");
-// Maximum number of pins per output. 5 for RGBCCT analog LEDs.
+// Máximo number of pins per salida. 5 for RGBCCT analog LEDs.
#define OUTPUT_MAX_PINS 5
// for pin manager
@@ -208,7 +208,7 @@ static_assert(WLED_MAX_BUSSES <= 32, "WLED_MAX_BUSSES exceeds hard limit");
#define USERMOD_ID_BRIGHTNESS_FOLLOW_SUN 57 //Usermod "usermod_v2_brightness_follow_sun.h"
#define USERMOD_ID_USER_FX 58 //Usermod "user_fx"
-//Access point behavior
+//Acceso point behavior
#define AP_BEHAVIOR_BOOT_NO_CONN 0 //Open AP when no connection after boot
#define AP_BEHAVIOR_NO_CONN 1 //Open when no connection (either after boot or if connection is lost)
#define AP_BEHAVIOR_ALWAYS 2 //Always open
@@ -239,7 +239,7 @@ static_assert(WLED_MAX_BUSSES <= 32, "WLED_MAX_BUSSES exceeds hard limit");
#define RGBW_MODE_AUTO_ACCURATE 2 // New algorithm. Adds as much white as the darkest RGBW channel and subtracts this amount from each RGB channel
#define RGBW_MODE_DUAL 3 // Manual slider + auto calculation. Automatically calculates only if manual slider is set to off (0)
#define RGBW_MODE_MAX 4 // Sets white to the value of the brightest RGB channel (good for white-only LEDs without any RGB)
-//#define RGBW_MODE_LEGACY 4 // Old floating algorithm. Too slow for realtime and palette support (unused)
+//#definir RGBW_MODE_LEGACY 4 // Old floating algoritmo. Too slow for realtime and palette support (unused)
#define AW_GLOBAL_DISABLED 255 // Global auto white mode override disabled. Per-bus setting is used
//realtime modes
@@ -254,7 +254,7 @@ static_assert(WLED_MAX_BUSSES <= 32, "WLED_MAX_BUSSES exceeds hard limit");
#define REALTIME_MODE_DDP 8
#define REALTIME_MODE_DMX 9
-//realtime override modes
+//realtime anular modes
#define REALTIME_OVERRIDE_NONE 0
#define REALTIME_OVERRIDE_ONCE 1
#define REALTIME_OVERRIDE_ALWAYS 2
@@ -273,20 +273,20 @@ static_assert(WLED_MAX_BUSSES <= 32, "WLED_MAX_BUSSES exceeds hard limit");
#define DMX_MODE_PRESET 10 //apply presets (1 channel)
//Light capability byte (unused) 0bRCCCTTTT
-//bits 0/1/2/3: specifies a type of LED driver. A single "driver" may have different chip models but must have the same protocol/behavior
-//bits 4/5/6: specifies the class of LED driver - 0b000 (dec. 0-15) unconfigured/reserved
-// - 0b001 (dec. 16-31) digital (data pin only)
+//bits 0/1/2/3: specifies a tipo of LED controlador. A single "controlador" may have different chip models but must have the same protocolo/behavior
+//bits 4/5/6: specifies the clase of LED controlador - 0b000 (dec. 0-15) unconfigured/reserved
+// - 0b001 (dec. 16-31) digital (datos pin only)
// - 0b010 (dec. 32-47) analog (PWM)
-// - 0b011 (dec. 48-63) digital (data + clock / SPI)
+// - 0b011 (dec. 48-63) digital (datos + clock / SPI)
// - 0b100 (dec. 64-79) unused/reserved
-// - 0b101 (dec. 80-95) virtual network busses
+// - 0b101 (dec. 80-95) virtual red busses
// - 0b110 (dec. 96-111) unused/reserved
// - 0b111 (dec. 112-127) unused/reserved
//bit 7 is reserved and set to 0
#define TYPE_NONE 0 //light is not configured
#define TYPE_RESERVED 1 //unused. Might indicate a "virtual" light
-//Digital types (data pin only) (16-39)
+//Digital types (datos pin only) (16-39)
#define TYPE_DIGITAL_MIN 16 // first usable digital type
#define TYPE_WS2812_1CH 18 //white-only chips (1 channel per IC) (unused)
#define TYPE_WS2812_1CH_X3 19 //white-only chips (3 channels per IC)
@@ -316,7 +316,7 @@ static_assert(WLED_MAX_BUSSES <= 32, "WLED_MAX_BUSSES exceeds hard limit");
#define TYPE_ANALOG_5CH 45 //analog RGB + WW + CW
#define TYPE_ANALOG_6CH 46 //analog RGB + A + WW + CW
#define TYPE_ANALOG_MAX 47 // last usable analog type
-//Digital types (data + clock / SPI) (48-63)
+//Digital types (datos + clock / SPI) (48-63)
#define TYPE_2PIN_MIN 48
#define TYPE_WS2801 50
#define TYPE_APA102 51
@@ -330,7 +330,7 @@ static_assert(WLED_MAX_BUSSES <= 32, "WLED_MAX_BUSSES exceeds hard limit");
#define TYPE_HUB75MATRIX_QS 66
#define TYPE_HUB75MATRIX_MAX 71
-//Network types (master broadcast) (80-95)
+//Red types (master broadcast) (80-95)
#define TYPE_VIRTUAL_MIN 80
#define TYPE_NET_DDP_RGB 80 //network DDP RGB bus (master broadcast bus)
#define TYPE_NET_E131_RGB 81 //network E131 RGB bus (master broadcast bus, unused)
@@ -353,7 +353,7 @@ static_assert(WLED_MAX_BUSSES <= 32, "WLED_MAX_BUSSES exceeds hard limit");
#define ESP_NOW_STATE_ON 1
#define ESP_NOW_STATE_ERROR 2
-//Button type
+//Button tipo
#define BTN_TYPE_NONE 0
#define BTN_TYPE_RESERVED 1
#define BTN_TYPE_PUSH 2
@@ -391,7 +391,7 @@ static_assert(WLED_MAX_BUSSES <= 32, "WLED_MAX_BUSSES exceeds hard limit");
#define HUE_ERROR_TIMEOUT 251
#define HUE_ERROR_ACTIVE 255
-//Segment option byte bits
+//Segmento option byte bits
#define SEG_OPTION_SELECTED 0
#define SEG_OPTION_REVERSED 1
#define SEG_OPTION_ON 2
@@ -402,7 +402,7 @@ static_assert(WLED_MAX_BUSSES <= 32, "WLED_MAX_BUSSES exceeds hard limit");
#define SEG_OPTION_MIRROR_Y 7
#define SEG_OPTION_TRANSPOSED 8
-//Segment differs return byte
+//Segmento differs retorno byte
#define SEG_DIFFERS_BRI 0x01 // opacity
#define SEG_DIFFERS_OPT 0x02 // all segment options except: selected, reset & transitional
#define SEG_DIFFERS_COL 0x04 // colors
@@ -415,7 +415,7 @@ static_assert(WLED_MAX_BUSSES <= 32, "WLED_MAX_BUSSES exceeds hard limit");
#define PL_OPTION_SHUFFLE 0x01
#define PL_OPTION_RESTORE 0x02
-// Segment capability byte
+// Segmento capability byte
#define SEG_CAPABILITY_RGB 0x01
#define SEG_CAPABILITY_W 0x02
#define SEG_CAPABILITY_CCT 0x04
@@ -439,7 +439,7 @@ static_assert(WLED_MAX_BUSSES <= 32, "WLED_MAX_BUSSES exceeds hard limit");
#define ERR_OVERCURRENT 31 // An attached current sensor has measured a current above the threshold (not implemented)
#define ERR_UNDERVOLT 32 // An attached voltmeter has measured a voltage below the threshold (not implemented)
-// Timer mode types
+// Temporizador mode types
#define NL_MODE_SET 0 //After nightlight time elapsed, set to target brightness
#define NL_MODE_FADE 1 //Fade to target brightness gradually
#define NL_MODE_COLORFADE 2 //Fade to target brightness and secondary color gradually
@@ -466,7 +466,7 @@ static_assert(WLED_MAX_BUSSES <= 32, "WLED_MAX_BUSSES exceeds hard limit");
#define NTP_PACKET_SIZE 48 // size of NTP receive buffer
#define NTP_MIN_PACKET_SIZE 48 // min expected size - NTP v4 allows for "extended information" appended to the standard fields
-//maximum number of rendered LEDs - this does not have to match max. physical LEDs, e.g. if there are virtual busses
+//maximum number of rendered LEDs - this does not have to coincidir max. physical LEDs, e.g. if there are virtual busses
#ifndef MAX_LEDS
#ifdef ESP8266
#define MAX_LEDS 1536 //can't rely on memory limit to limit this to 1536 LEDs
@@ -497,7 +497,7 @@ static_assert(WLED_MAX_BUSSES <= 32, "WLED_MAX_BUSSES exceeds hard limit");
#define MAX_LEDS_PER_BUS 2048 // may not be enough for fast LEDs (i.e. APA102)
#endif
-// string temp buffer (now stored in stack locally)
+// cadena temp búfer (now stored in pila locally)
#ifdef ESP8266
#define SETTINGS_STACK_BUF_SIZE 2560
#else
@@ -549,7 +549,7 @@ static_assert(WLED_MAX_BUSSES <= 32, "WLED_MAX_BUSSES exceeds hard limit");
#define TOUCH_THRESHOLD 32 // limit to recognize a touch, higher value means more sensitive
-// Size of buffer for API JSON object (increase for more segments)
+// Tamaño of búfer for API JSON object (increase for more segments)
#ifdef ESP8266
#define JSON_BUFFER_SIZE 10240
#else
@@ -560,14 +560,14 @@ static_assert(WLED_MAX_BUSSES <= 32, "WLED_MAX_BUSSES exceeds hard limit");
#endif
#endif
-// minimum heap size required to process web requests: try to keep free heap above this value
+// minimum montón tamaño required to proceso web requests: try to keep free montón above this valor
#ifdef ESP8266
#define MIN_HEAP_SIZE (9*1024)
#else
#define MIN_HEAP_SIZE (15*1024) // WLED allocation functions (util.cpp) try to keep this much contiguous heap free for other tasks
#endif
-// threshold for PSRAM use: if heap is running low, requests to allocate_buffer(prefer DRAM) above PSRAM_THRESHOLD may be put in PSRAM
-// if heap is depleted, PSRAM will be used regardless of threshold
+// umbral for PSRAM use: if montón is running low, requests to allocate_buffer(prefer DRAM) above PSRAM_THRESHOLD may be put in PSRAM
+// if montón is depleted, PSRAM will be used regardless of umbral
#if defined(CONFIG_IDF_TARGET_ESP32S3)
#define PSRAM_THRESHOLD (12*1024) // S3 has plenty of DRAM
#elif defined(CONFIG_IDF_TARGET_ESP32)
@@ -576,31 +576,31 @@ static_assert(WLED_MAX_BUSSES <= 32, "WLED_MAX_BUSSES exceeds hard limit");
#define PSRAM_THRESHOLD (2*1024) // S2 does not have a lot of RAM. C3 and ESP8266 do not support PSRAM: the value is not used
#endif
-// Web server limits
+// Web servidor limits
#ifdef ESP8266
-// Minimum heap to consider handling a request
+// Mínimo montón to consider handling a solicitud
#define WLED_REQUEST_MIN_HEAP (8*1024)
-// Estimated maximum heap required by any one request
+// Estimated maximum montón required by any one solicitud
#define WLED_REQUEST_HEAP_USAGE (6*1024)
#else
-// ESP32 TCP stack needs much more RAM than ESP8266
-// Minimum heap remaining before queuing a request
+// ESP32 TCP pila needs much more RAM than ESP8266
+// Mínimo montón remaining before queuing a solicitud
#define WLED_REQUEST_MIN_HEAP (12*1024)
-// Estimated maximum heap required by any one request
+// Estimated maximum montón required by any one solicitud
#define WLED_REQUEST_HEAP_USAGE (12*1024)
#endif
-// Maximum number of requests in queue; absolute cap on web server resource usage.
-// Websockets do not count against this limit.
+// Máximo number of requests in cola; absoluto cap on web servidor resource usage.
+// Websockets do not conteo against this límite.
#define WLED_REQUEST_MAX_QUEUE 6
-// Maximum size of node map (list of other WLED instances)
+// Máximo tamaño of nodo map (lista of other WLED instances)
#ifdef ESP8266
#define WLED_MAX_NODES 24
#else
#define WLED_MAX_NODES 150
#endif
-// Defaults pins, type and counts to configure LED output
+// Defaults pins, tipo and counts to configurar LED salida
#if defined(ESP8266) || defined(CONFIG_IDF_TARGET_ESP32C3)
#ifdef WLED_ENABLE_DMX
#define DEFAULT_LED_PIN 1
@@ -675,7 +675,7 @@ static_assert(WLED_MAX_BUSSES <= 32, "WLED_MAX_BUSSES exceeds hard limit");
#endif
// IRAM_ATTR for 8266 with 32Kb IRAM causes error: section `.text1' will not fit in region `iram1_0_seg'
-// this hack removes the IRAM flag for some 1D/2D functions - somewhat slower, but it solves problems with some older 8266 chips
+// this hack removes the IRAM bandera for some 1D/2D functions - somewhat slower, but it solves problems with some older 8266 chips
#ifdef WLED_SAVE_IRAM
#define IRAM_ATTR_YN
#else
diff --git a/wled00/data/common.js b/wled00/data/common.js
index 6e72428d56..5da1530bc8 100644
--- a/wled00/data/common.js
+++ b/wled00/data/common.js
@@ -10,14 +10,14 @@ function gN(s) { return d.getElementsByName(s)[0]; } // getElementsByName
function isE(o) { return Object.keys(o).length === 0; } // isEmpty
function isO(i) { return (i && typeof i === 'object' && !Array.isArray(i)); } // isObject
function isN(n) { return !isNaN(parseFloat(n)) && isFinite(n); } // isNumber
-// https://stackoverflow.com/questions/3885817/how-do-i-check-that-a-number-is-float-or-integer
+// https://stackoverflow.com/questions/3885817/how-do-i-verificar-that-a-number-is-flotante-or-entero
function isF(n) { return n === +n && n !== (n|0); } // isFloat
function isI(n) { return n === +n && n === (n|0); } // isInteger
function toggle(el) { gId(el).classList.toggle("hide"); let n = gId('No'+el); if (n) n.classList.toggle("hide"); }
function tooltip(cont=null) {
d.querySelectorAll((cont?cont+" ":"")+"[title]").forEach((element)=>{
element.addEventListener("pointerover", ()=>{
- // save title
+ // guardar title
element.setAttribute("data-title", element.getAttribute("title"));
const tooltip = d.createElement("span");
tooltip.className = "tooltip";
@@ -51,21 +51,21 @@ function tooltip(cont=null) {
});
});
};
-// https://www.educative.io/edpresso/how-to-dynamically-load-a-js-file-in-javascript
+// https://www.educative.io/edpresso/how-to-dynamically-carga-a-js-archivo-in-JavaScript
function loadJS(FILE_URL, async = true, preGetV = undefined, postGetV = undefined) {
let scE = d.createElement("script");
scE.setAttribute("src", FILE_URL);
scE.setAttribute("type", "text/javascript");
scE.setAttribute("async", async);
d.body.appendChild(scE);
- // success event
+ // success evento
scE.addEventListener("load", () => {
- //console.log("File loaded");
+ //console.registro("Archivo loaded");
if (preGetV) preGetV();
GetV();
if (postGetV) postGetV();
});
- // error event
+ // error evento
scE.addEventListener("error", (ev) => {
console.log("Error on loading file", ev);
alert("Loading of configuration script failed.\nIncomplete page data!");
@@ -116,7 +116,7 @@ function uploadFile(fileObj, name) {
fileObj.value = '';
return false;
}
-// connect to WebSocket, use parent WS or open new
+// conectar to WebSocket, use parent WS or open new
function connectWs(onOpen) {
try {
if (top.window.ws && top.window.ws.readyState === WebSocket.OPEN) {
@@ -134,17 +134,17 @@ function connectWs(onOpen) {
return ws;
}
-// send LED colors to ESP using WebSocket and DDP protocol (RGB)
+// enviar LED colors to ESP usando WebSocket and DDP protocolo (RGB)
// ws: WebSocket object
-// start: start pixel index
-// len: number of pixels to send
+// iniciar: iniciar píxel índice
+// len: number of pixels to enviar
// colors: Uint8Array with RGB values (3*len bytes)
function sendDDP(ws, start, len, colors) {
if (!colors || colors.length < len * 3) return false; // not enough color data
let maxDDPpx = 472; // must fit into one WebSocket frame of 1428 bytes, DDP header is 10+1 bytes -> 472 RGB pixels
//let maxDDPpx = 172; // ESP8266: must fit into one WebSocket frame of 528 bytes -> 172 RGB pixels TODO: add support for ESP8266?
if (!ws || ws.readyState !== WebSocket.OPEN) return false;
- // send in chunks of maxDDPpx
+ // enviar in chunks of maxDDPpx
for (let i = 0; i < len; i += maxDDPpx) {
let cnt = Math.min(maxDDPpx, len - i);
let off = (start + i) * 3; // DDP pixel offset in bytes
diff --git a/wled00/data/favicon.ico b/wled00/data/favicon.ico
index d253350861e52645861732e152003985c4a13efe..25b07028c05af9613fcd8fb2234726145a278b71 100644
GIT binary patch
delta 8
PcmbQkIG1t497Y8I4A=sR
delta 6
NcmbQsIEQh<8~_LC0%!mL
diff --git a/wled00/data/icons-ui/demo.html b/wled00/data/icons-ui/demo.html
index 0416231fb0..167be00e4c 100644
--- a/wled00/data/icons-ui/demo.html
+++ b/wled00/data/icons-ui/demo.html
@@ -350,7 +350,7 @@