mirror of
https://github.com/wled/WLED.git
synced 2025-07-25 19:56:32 +00:00
First half of usermod readme updates
Describe the new usermod enable process, and update sample platformio_override.ini stubs.
This commit is contained in:
parent
070b08a9e6
commit
b3f9983f44
@ -506,9 +506,8 @@ lib_deps = ${esp8266.lib_deps}
|
|||||||
extends = esp32 ;; use default esp32 platform
|
extends = esp32 ;; use default esp32 platform
|
||||||
board = esp32dev
|
board = esp32dev
|
||||||
upload_speed = 921600
|
upload_speed = 921600
|
||||||
|
custom_usermods = ${env:esp32dev.custom_usermods} RTC EleksTube_IPS
|
||||||
build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_DISABLE_BROWNOUT_DET -D WLED_DISABLE_INFRARED
|
build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_DISABLE_BROWNOUT_DET -D WLED_DISABLE_INFRARED
|
||||||
-D USERMOD_RTC
|
|
||||||
-D USERMOD_ELEKSTUBE_IPS
|
|
||||||
-D DATA_PINS=12
|
-D DATA_PINS=12
|
||||||
-D RLYPIN=27
|
-D RLYPIN=27
|
||||||
-D BTNPIN=34
|
-D BTNPIN=34
|
||||||
@ -526,9 +525,6 @@ build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_DISABLE_BROWNOU
|
|||||||
-D SPI_FREQUENCY=40000000
|
-D SPI_FREQUENCY=40000000
|
||||||
-D USER_SETUP_LOADED
|
-D USER_SETUP_LOADED
|
||||||
monitor_filters = esp32_exception_decoder
|
monitor_filters = esp32_exception_decoder
|
||||||
lib_deps =
|
|
||||||
${esp32.lib_deps}
|
|
||||||
TFT_eSPI @ 2.5.33 ;; this is the last version that compiles with the WLED default framework - newer versions require platform = espressif32 @ ^6.3.2
|
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Usermod examples
|
# Usermod examples
|
||||||
|
@ -6,5 +6,5 @@ Configuration is performed via the Usermod menu. There are no parameters to set
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Add the build flag `-D USERMOD_ADS1115` to your platformio environment.
|
Add 'ADS1115' to `custom_usermods` in your platformio environment.
|
||||||
Uncomment libraries with comment `#For ADS1115 sensor uncomment following`
|
|
||||||
|
@ -22,15 +22,9 @@ Dependencies, These must be added under `lib_deps` in your `platform.ini` (or `p
|
|||||||
|
|
||||||
# Compiling
|
# Compiling
|
||||||
|
|
||||||
To enable, compile with `USERMOD_AHT10` defined (e.g. in `platformio_override.ini`)
|
To enable, add 'AHT10' to `custom_usermods` in your platformio encrionment (e.g. in `platformio_override.ini`)
|
||||||
```ini
|
```ini
|
||||||
[env:aht10_example]
|
[env:aht10_example]
|
||||||
extends = env:esp32dev
|
extends = env:esp32dev
|
||||||
build_flags =
|
custom_usermods = ${env:esp32dev.custom_usermods} AHT10
|
||||||
${common.build_flags} ${esp32.build_flags}
|
|
||||||
-D USERMOD_AHT10
|
|
||||||
; -D USERMOD_AHT10_DEBUG ; -- add a debug status to the info modal
|
|
||||||
lib_deps =
|
|
||||||
${esp32.lib_deps}
|
|
||||||
enjoyneering/AHT10@~1.1.0
|
|
||||||
```
|
```
|
||||||
|
@ -15,10 +15,9 @@ To include this usermod in your WLED setup, you have to be able to [compile WLED
|
|||||||
|
|
||||||
Before compiling, you have to make the following modifications:
|
Before compiling, you have to make the following modifications:
|
||||||
|
|
||||||
Edit `usermods_list.cpp`:
|
Edit your environment in `platformio_override.ini`
|
||||||
1. Open `wled00/usermods_list.cpp`
|
1. Open `platformio_override.ini`
|
||||||
2. add `#include "../usermods/Animated_Staircase/Animated_Staircase.h"` to the top of the file
|
2. add `Animated_Staircase` to the `custom_usermods` line for your environment
|
||||||
3. add `UsermodManager::add(new Animated_Staircase());` to the end of the `void registerUsermods()` function.
|
|
||||||
|
|
||||||
You can configure usermod using the Usermods settings page.
|
You can configure usermod using the Usermods settings page.
|
||||||
Please enter GPIO pins for PIR or ultrasonic sensors (trigger and echo).
|
Please enter GPIO pins for PIR or ultrasonic sensors (trigger and echo).
|
||||||
|
@ -10,7 +10,7 @@ The luminance is displayed in both the Info section of the web UI, as well as pu
|
|||||||
|
|
||||||
## Compilation
|
## Compilation
|
||||||
|
|
||||||
To enable, compile with `USERMOD_BH1750` defined (e.g. in `platformio_override.ini`)
|
To enable, compile with `BH1750` in `custom_usermods` (e.g. in `platformio_override.ini`)
|
||||||
|
|
||||||
### Configuration Options
|
### Configuration Options
|
||||||
The following settings can be set at compile-time but are configurable on the usermod menu (except First Measurement time):
|
The following settings can be set at compile-time but are configurable on the usermod menu (except First Measurement time):
|
||||||
|
@ -23,9 +23,7 @@ Enables battery level monitoring of your project.
|
|||||||
|
|
||||||
## 🎈 Installation
|
## 🎈 Installation
|
||||||
|
|
||||||
| **Option 1** | **Option 2** |
|
In `platformio_override.ini` (or `platformio.ini`)<br>Under: `custom_usermods =`, add the line: `Battery`<br><br>[Example: platformio_override.ini](assets/installation_platformio_override_ini.png) |
|
||||||
|--------------|--------------|
|
|
||||||
| In `wled00/my_config.h`<br>Add the line: `#define USERMOD_BATTERY`<br><br>[Example: my_config.h](assets/installation_my_config_h.png) | In `platformio_override.ini` (or `platformio.ini`)<br>Under: `build_flags =`, add the line: `-D USERMOD_BATTERY`<br><br>[Example: platformio_override.ini](assets/installation_platformio_override_ini.png) |
|
|
||||||
|
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
|
@ -4,5 +4,5 @@ This usermod supports driving the Cronixie M and L clock kits by Diamex.
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Compile and upload after adding `-D USERMOD_CRONIXIE` to `build_flags` of your PlatformIO environment.
|
Compile and upload after adding `Cronixie` to `custom_usermods` of your PlatformIO environment.
|
||||||
Make sure the Auto Brightness Limiter is enabled at 420mA (!) and configure 60 WS281x LEDs.
|
Make sure the Auto Brightness Limiter is enabled at 420mA (!) and configure 60 WS281x LEDs.
|
@ -1,6 +1,5 @@
|
|||||||
; Options
|
; Options
|
||||||
; -------
|
; -------
|
||||||
; USERMOD_DHT - define this to have this user mod included wled00\usermods_list.cpp
|
|
||||||
; USERMOD_DHT_DHTTYPE - DHT model: 11, 21, 22 for DHT11, DHT21, or DHT22, defaults to 22/DHT22
|
; USERMOD_DHT_DHTTYPE - DHT model: 11, 21, 22 for DHT11, DHT21, or DHT22, defaults to 22/DHT22
|
||||||
; USERMOD_DHT_PIN - pin to which DTH is connected, defaults to Q2 pin on QuinLed Dig-Uno's board
|
; USERMOD_DHT_PIN - pin to which DTH is connected, defaults to Q2 pin on QuinLed Dig-Uno's board
|
||||||
; USERMOD_DHT_CELSIUS - define this to report temperatures in degrees celsious, otherwise fahrenheit will be reported
|
; USERMOD_DHT_CELSIUS - define this to report temperatures in degrees celsious, otherwise fahrenheit will be reported
|
||||||
@ -11,13 +10,11 @@
|
|||||||
|
|
||||||
[env:d1_mini_usermod_dht_C]
|
[env:d1_mini_usermod_dht_C]
|
||||||
extends = env:d1_mini
|
extends = env:d1_mini
|
||||||
build_flags = ${env:d1_mini.build_flags} -D USERMOD_DHT -D USERMOD_DHT_CELSIUS
|
custom_usermods = ${env:d1_mini.custom_usermods} DHT
|
||||||
lib_deps = ${env:d1_mini.lib_deps}
|
build_flags = ${env:d1_mini.build_flags} -D USERMOD_DHT_CELSIUS
|
||||||
https://github.com/alwynallan/DHT_nonblocking
|
|
||||||
|
|
||||||
[env:custom32_LEDPIN_16_usermod_dht_C]
|
[env:custom32_LEDPIN_16_usermod_dht_C]
|
||||||
extends = env:custom32_LEDPIN_16
|
extends = env:custom32_LEDPIN_16
|
||||||
build_flags = ${env:custom32_LEDPIN_16.build_flags} -D USERMOD_DHT -D USERMOD_DHT_CELSIUS -D USERMOD_DHT_STATS
|
custom_usermods = ${env:custom32_LEDPIN_16.custom_usermods} DHT
|
||||||
lib_deps = ${env.lib_deps}
|
build_flags = ${env:custom32_LEDPIN_16.build_flags} -D USERMOD_DHT_CELSIUS -D USERMOD_DHT_STATS
|
||||||
https://github.com/alwynallan/DHT_nonblocking
|
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@ Copy the example `platformio_override.ini` to the root directory. This file sho
|
|||||||
|
|
||||||
### Define Your Options
|
### Define Your Options
|
||||||
|
|
||||||
* `USERMOD_DHT` - define this to include this user mod wled00\usermods_list.cpp
|
|
||||||
* `USERMOD_DHT_DHTTYPE` - DHT model: 11, 21, 22 for DHT11, DHT21, or DHT22, defaults to 22/DHT22
|
* `USERMOD_DHT_DHTTYPE` - DHT model: 11, 21, 22 for DHT11, DHT21, or DHT22, defaults to 22/DHT22
|
||||||
* `USERMOD_DHT_PIN` - pin to which DTH is connected, defaults to Q2 pin on QuinLed Dig-Uno's board
|
* `USERMOD_DHT_PIN` - pin to which DTH is connected, defaults to Q2 pin on QuinLed Dig-Uno's board
|
||||||
* `USERMOD_DHT_CELSIUS` - define this to report temperatures in degrees Celsius, otherwise Fahrenheit will be reported
|
* `USERMOD_DHT_CELSIUS` - define this to report temperatures in degrees Celsius, otherwise Fahrenheit will be reported
|
||||||
|
4
usermods/Fix_unreachable_netservices_v2/library.json
Normal file
4
usermods/Fix_unreachable_netservices_v2/library.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"name:": "Fix_unreachable_netservices_v2",
|
||||||
|
"platforms": ["espressif8266"]
|
||||||
|
}
|
@ -30,41 +30,6 @@ The usermod supports the following state changes:
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
1. Copy the file `usermod_Fix_unreachable_netservices.h` to the `wled00` directory.
|
1. Add `Fix_unreachable_netservices` to `custom_usermods` in your PlatformIO environment.
|
||||||
2. Register the usermod by adding `#include "usermod_Fix_unreachable_netservices.h"` in the top and `registerUsermod(new FixUnreachableNetServices());` in the bottom of `usermods_list.cpp`.
|
|
||||||
|
|
||||||
Example **usermods_list.cpp**:
|
|
||||||
|
|
||||||
```cpp
|
|
||||||
#include "wled.h"
|
|
||||||
/*
|
|
||||||
* Register your v2 usermods here!
|
|
||||||
* (for v1 usermods using just usermod.cpp, you can ignore this file)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Add/uncomment your usermod filename here (and once more below)
|
|
||||||
* || || ||
|
|
||||||
* \/ \/ \/
|
|
||||||
*/
|
|
||||||
//#include "usermod_v2_example.h"
|
|
||||||
//#include "usermod_temperature.h"
|
|
||||||
//#include "usermod_v2_empty.h"
|
|
||||||
#include "usermod_Fix_unreachable_netservices.h"
|
|
||||||
|
|
||||||
void registerUsermods()
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Add your usermod class name here
|
|
||||||
* || || ||
|
|
||||||
* \/ \/ \/
|
|
||||||
*/
|
|
||||||
//UsermodManager::add(new MyExampleUsermod());
|
|
||||||
//UsermodManager::add(new UsermodTemperature());
|
|
||||||
//UsermodManager::add(new UsermodRenameMe());
|
|
||||||
UsermodManager::add(new FixUnreachableNetServices());
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Hopefully I can help someone with that - @gegu
|
Hopefully I can help someone with that - @gegu
|
||||||
|
@ -1,12 +1,4 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "wled.h"
|
#include "wled.h"
|
||||||
#if defined(ESP32)
|
|
||||||
#warning "Usermod FixUnreachableNetServices works only with ESP8266 builds"
|
|
||||||
class FixUnreachableNetServices : public Usermod
|
|
||||||
{
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(ESP8266)
|
#if defined(ESP8266)
|
||||||
#include <ping.h>
|
#include <ping.h>
|
||||||
@ -168,4 +160,11 @@ Delay <input type=\"number\" min=\"5\" max=\"300\" value=\"";
|
|||||||
return USERMOD_ID_FIXNETSERVICES;
|
return USERMOD_ID_FIXNETSERVICES;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static FixUnreachableNetServices fix_unreachable_net_services;
|
||||||
|
REGISTER_USERMOD(fix_unreachable_net_services);
|
||||||
|
|
||||||
|
#else /* !ESP8266 */
|
||||||
|
#warning "Usermod FixUnreachableNetServices works only with ESP8266 builds"
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -22,13 +22,6 @@ The following settings can be configured in the Usermod Menu:
|
|||||||
- **MqttPublishAlways**: Publish always, regardless if there is a change.
|
- **MqttPublishAlways**: Publish always, regardless if there is a change.
|
||||||
- **MqttHomeAssistantDiscovery**: Enable Home Assistant discovery.
|
- **MqttHomeAssistantDiscovery**: Enable Home Assistant discovery.
|
||||||
|
|
||||||
## Dependencies
|
|
||||||
|
|
||||||
These must be added under `lib_deps` in your `platform.ini` (or `platform_override.ini`).
|
|
||||||
|
|
||||||
- Libraries
|
|
||||||
- `wollewald/INA226_WE@~1.2.9` (by [wollewald](https://registry.platformio.org/libraries/wollewald/INA226_WE))
|
|
||||||
- `Wire`
|
|
||||||
|
|
||||||
## Understanding Samples and Conversion Times
|
## Understanding Samples and Conversion Times
|
||||||
|
|
||||||
@ -62,16 +55,12 @@ For detailed programming information and register configurations, refer to the [
|
|||||||
|
|
||||||
## Compiling
|
## Compiling
|
||||||
|
|
||||||
To enable, compile with `USERMOD_INA226` defined (e.g. in `platformio_override.ini`).
|
To enable, compile with `INA226` in `custom_usermods` (e.g. in `platformio_override.ini`).
|
||||||
|
|
||||||
```ini
|
```ini
|
||||||
[env:ina226_example]
|
[env:ina226_example]
|
||||||
extends = env:esp32dev
|
extends = env:esp32dev
|
||||||
build_flags =
|
custom_usermods = ${env:esp32dev.custom_usermods} INA226
|
||||||
${common.build_flags} ${esp32.build_flags}
|
build_flags = ${env:esp32dev.build_flags}
|
||||||
-D USERMOD_INA226
|
|
||||||
; -D USERMOD_INA226_DEBUG ; -- add a debug status to the info modal
|
; -D USERMOD_INA226_DEBUG ; -- add a debug status to the info modal
|
||||||
lib_deps =
|
|
||||||
${esp32.lib_deps}
|
|
||||||
wollewald/INA226_WE@~1.2.9
|
|
||||||
```
|
```
|
@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name:": "INA226_v2",
|
"name:": "INA226_v2",
|
||||||
"build": { "libArchive": false},
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"wollewald/INA226_WE":"~1.2.9"
|
"wollewald/INA226_WE":"~1.2.9"
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
[env:ina226_example]
|
[env:ina226_example]
|
||||||
extends = env:esp32dev
|
extends = env:esp32dev
|
||||||
|
custom_usermods = ${env:esp32dev.custom_usermods} INA226_v2
|
||||||
build_flags =
|
build_flags =
|
||||||
${common.build_flags} ${esp32.build_flags}
|
${env:esp32dev.build_flags}
|
||||||
-D USERMOD_INA226
|
|
||||||
; -D USERMOD_INA226_DEBUG ; -- add a debug status to the info modal
|
; -D USERMOD_INA226_DEBUG ; -- add a debug status to the info modal
|
||||||
lib_deps =
|
|
||||||
${esp32.lib_deps}
|
|
||||||
wollewald/INA226_WE@~1.2.9
|
|
@ -23,8 +23,7 @@
|
|||||||
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
- Add a build flag `-D USERMOD_INTERNAL_TEMPERATURE` to your `platformio.ini` (or `platformio_override.ini`).
|
- Add `Internal_Temperature` to `custom_usermods` in your `platformio.ini` (or `platformio_override.ini`).
|
||||||
|
|
||||||
|
|
||||||
## 📝 Change Log
|
## 📝 Change Log
|
||||||
|
|
||||||
|
@ -10,21 +10,15 @@ The movement and presence state are displayed in both the Info section of the we
|
|||||||
## Dependencies
|
## Dependencies
|
||||||
- Libraries
|
- Libraries
|
||||||
- `ncmreynolds/ld2410@^0.1.3`
|
- `ncmreynolds/ld2410@^0.1.3`
|
||||||
- This must be added under `lib_deps` in your `platformio.ini` (or `platformio_override.ini`).
|
|
||||||
- Data is published over MQTT - make sure you've enabled the MQTT sync interface.
|
- Data is published over MQTT - make sure you've enabled the MQTT sync interface.
|
||||||
|
|
||||||
## Compilation
|
## Compilation
|
||||||
|
|
||||||
To enable, compile with `USERMOD_LD2410` defined (e.g. in `platformio_override.ini`)
|
To enable, compile with `LD2140` in `custom_usermods` (e.g. in `platformio_override.ini`)
|
||||||
```ini
|
```ini
|
||||||
[env:usermod_USERMOD_LD2410_esp32dev]
|
[env:usermod_USERMOD_LD2410_esp32dev]
|
||||||
extends = env:esp32dev
|
extends = env:esp32dev
|
||||||
build_flags =
|
custom_usermods = ${env:esp32dev.custom_usermods} LD2140
|
||||||
${common.build_flags_esp32}
|
|
||||||
-D USERMOD_LD2410
|
|
||||||
lib_deps =
|
|
||||||
${esp32.lib_deps}
|
|
||||||
ncmreynolds/ld2410@^0.1.3
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Configuration Options
|
### Configuration Options
|
||||||
|
@ -2,13 +2,14 @@
|
|||||||
This usermod will obtain readings from a Light Dependent Resistor (LDR) and will turn on/off specific presets based on those readings. This is useful for exterior lighting situations where you want the lights to only be on when it is dark out.
|
This usermod will obtain readings from a Light Dependent Resistor (LDR) and will turn on/off specific presets based on those readings. This is useful for exterior lighting situations where you want the lights to only be on when it is dark out.
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
Add "-D USERMOD_LDR_DUSK_DAWN" to your platformio.ini [common] build_flags and build.
|
Add "LDR_Dusk_Dawn" to your platformio.ini environment's custom_usermods and build.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
```
|
```
|
||||||
[common]
|
[env:usermod_LDR_Dusk_Dawn_esp32dev]
|
||||||
build_flags =
|
extends = env:esp32dev
|
||||||
-D USERMOD_LDR_DUSK_DAWN # Enable LDR Dusk Dawn Usermod
|
custom_usermods = ${env:esp32dev.custom_usermods}
|
||||||
|
LDR_Dusk_Dawn # Enable LDR Dusk Dawn Usermod
|
||||||
```
|
```
|
||||||
|
|
||||||
# Usermod Settings
|
# Usermod Settings
|
||||||
|
@ -27,11 +27,7 @@ Currently ESP8266 is not supported, due to low speed and small RAM of this chip.
|
|||||||
There are however plans to create a lightweight audioreactive for the 8266, with reduced features.
|
There are however plans to create a lightweight audioreactive for the 8266, with reduced features.
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
### using latest _arduinoFFT_ library version 2.x
|
Add 'ADS1115_v2' to `custom_usermods` in your platformio environment.
|
||||||
The latest arduinoFFT release version should be used for audioreactive.
|
|
||||||
|
|
||||||
* `build_flags` = `-D USERMOD_AUDIOREACTIVE -D sqrt_internal=sqrtf`
|
|
||||||
* `lib_deps`= `kosme/arduinoFFT @ 2.0.1`
|
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
|
@ -20,8 +20,7 @@ The LEDs should be wired in a clockwise orientation starting in the middle of bo
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Add `-D USERMOD_BOBLIGHT` to your PlatformIO environment.
|
Add `boblight` to `custom_usermods` in your PlatformIO environment.
|
||||||
If you are not using PlatformIO (which you should) try adding `#define USERMOD_BOBLIGHT` to *my_config.h*.
|
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ To keep this usermod simple and easy to use, it is a very basic implementation o
|
|||||||
|
|
||||||
## Usermod installation
|
## Usermod installation
|
||||||
|
|
||||||
Use `#define USERMOD_DEEP_SLEEP` in wled.h or `-D USERMOD_DEEP_SLEEP` in your platformio.ini. Settings can be changed in the usermod config UI.
|
Add `deep_sleep` to `custom_usermods` in your platformio.ini. Settings can be changed in the usermod config UI.
|
||||||
|
|
||||||
### Define Settings
|
### Define Settings
|
||||||
|
|
||||||
|
@ -16,26 +16,6 @@ As a memento to a long trip I was on, I built an icosahedron globe. I put lights
|
|||||||
I wanted to integrate an IMU to allow either on-board, or off-board effects that would
|
I wanted to integrate an IMU to allow either on-board, or off-board effects that would
|
||||||
react to the globes orientation. See the blog post on building it <https://www.robopenguins.com/icosahedron-travel-globe/> or a video demo <https://youtu.be/zYjybxHBsHM> .
|
react to the globes orientation. See the blog post on building it <https://www.robopenguins.com/icosahedron-travel-globe/> or a video demo <https://youtu.be/zYjybxHBsHM> .
|
||||||
|
|
||||||
## Adding Dependencies
|
|
||||||
|
|
||||||
I2Cdev and MPU6050 must be installed.
|
|
||||||
|
|
||||||
To install them, add electroniccats/MPU6050@1.0.1 to lib_deps in the platformio.ini file.
|
|
||||||
|
|
||||||
For example:
|
|
||||||
|
|
||||||
```
|
|
||||||
lib_deps =
|
|
||||||
FastLED@3.3.2
|
|
||||||
NeoPixelBus@2.5.7
|
|
||||||
ESPAsyncTCP@1.2.0
|
|
||||||
ESPAsyncUDP@697c75a025
|
|
||||||
AsyncTCP@1.0.3
|
|
||||||
Esp Async WebServer@1.2.0
|
|
||||||
IRremoteESP8266@2.7.3
|
|
||||||
electroniccats/MPU6050@1.0.1
|
|
||||||
```
|
|
||||||
|
|
||||||
## Wiring
|
## Wiring
|
||||||
|
|
||||||
The connections needed to the MPU6050 are as follows:
|
The connections needed to the MPU6050 are as follows:
|
||||||
@ -74,18 +54,13 @@ to the info object
|
|||||||
|
|
||||||
## Usermod installation
|
## Usermod installation
|
||||||
|
|
||||||
1. Copy the file `usermod_mpu6050_imu.h` to the `wled00` directory.
|
Add `mpu6050_imu` to `custom_usermods` in your platformio_override.ini.
|
||||||
2. Register the usermod by adding `#include "usermod_mpu6050_imu.h"` in the top and `registerUsermod(new MPU6050Driver());` in the bottom of `usermods_list.cpp`.
|
|
||||||
|
|
||||||
Example **usermods_list.cpp**:
|
Example **platformio_override.ini**:
|
||||||
|
|
||||||
```cpp
|
```ini
|
||||||
#include "wled.h"
|
[env:usermod_mpu6050_imu_esp32dev]
|
||||||
|
extends = env:esp32dev
|
||||||
#include "usermod_mpu6050_imu.h"
|
custom_usermods = ${env:esp32dev.custom_usermods}
|
||||||
|
mpu6050_imu
|
||||||
void registerUsermods()
|
|
||||||
{
|
|
||||||
UsermodManager::add(new MPU6050Driver());
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
@ -41,9 +41,7 @@ When a relay is switched, a message is published:
|
|||||||
|
|
||||||
## Usermod installation
|
## Usermod installation
|
||||||
|
|
||||||
1. Register the usermod by adding `#include "../usermods/multi_relay/usermod_multi_relay.h"` at the top and `UsermodManager::add(new MultiRelay());` at the bottom of `usermods_list.cpp`.
|
Add `multi_relay` to the `custom_usermods` of your platformio.ini environment.
|
||||||
or
|
|
||||||
2. Use `#define USERMOD_MULTI_RELAY` in wled.h or `-D USERMOD_MULTI_RELAY` in your platformio.ini
|
|
||||||
|
|
||||||
You can override the default maximum number of relays (which is 4) by defining MULTI_RELAY_MAX_RELAYS.
|
You can override the default maximum number of relays (which is 4) by defining MULTI_RELAY_MAX_RELAYS.
|
||||||
|
|
||||||
@ -65,38 +63,6 @@ The following definitions should be a list of values (maximum number of entries
|
|||||||
```
|
```
|
||||||
These can be set via your `platformio_override.ini` file or as `#define` in your `my_config.h` (remember to set `WLED_USE_MY_CONFIG` in your `platformio_override.ini`)
|
These can be set via your `platformio_override.ini` file or as `#define` in your `my_config.h` (remember to set `WLED_USE_MY_CONFIG` in your `platformio_override.ini`)
|
||||||
|
|
||||||
Example **usermods_list.cpp**:
|
|
||||||
|
|
||||||
```cpp
|
|
||||||
#include "wled.h"
|
|
||||||
/*
|
|
||||||
* Register your v2 usermods here!
|
|
||||||
* (for v1 usermods using just usermod.cpp, you can ignore this file)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Add/uncomment your usermod filename here (and once more below)
|
|
||||||
* || || ||
|
|
||||||
* \/ \/ \/
|
|
||||||
*/
|
|
||||||
//#include "usermod_v2_example.h"
|
|
||||||
//#include "usermod_temperature.h"
|
|
||||||
#include "../usermods/usermod_multi_relay.h"
|
|
||||||
|
|
||||||
void registerUsermods()
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Add your usermod class name here
|
|
||||||
* || || ||
|
|
||||||
* \/ \/ \/
|
|
||||||
*/
|
|
||||||
//UsermodManager::add(new MyExampleUsermod());
|
|
||||||
//UsermodManager::add(new UsermodTemperature());
|
|
||||||
UsermodManager::add(new MultiRelay());
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
Usermod can be configured via the Usermods settings page.
|
Usermod can be configured via the Usermods settings page.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user