Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usermod SbusControl #4464

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Usermod SbusControl #4464

wants to merge 6 commits into from

Conversation

tobiaseul
Copy link

Adding a usermod to control WLED via a RCRemote with a sbus receiver connected to an ESP32.

Brightness can be changed.
It can be switched between 9 Presets.

Add a SBusControl UserMod to control brightness and presets via a RC Remote with SBus receiver
Add a SBusControl UserMod to control brightness and presets via a RC Remote with SBus receiver
@netmindz
Copy link
Collaborator

Thank you for your submission. Can you please add a little more detail to your readme file so that users understand exactly what this usermod is for and how to use it please

@@ -486,4 +490,8 @@ void registerUsermods()
#ifdef USERMOD_RF433
UsermodManager::add(new RF433Usermod());
#endif

#ifdef USERMOD_SBUS_CONTROL
usermods.add(new SbusControl());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is outdated

@@ -250,6 +250,10 @@
#include "../usermods/usermod_v2_RF433/usermod_v2_RF433.h"
#endif

#ifdef USERMOD_SBUS_CONTROL
#include "../usermods/sbus_control/usermod_sbus_control.h"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation


uint8_t getSwitchPosition(int16_t ch_value)
{
Serial.println(ch_value);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use debug output

uint8_t last_mode_ = 1;
uint8_t last_bri_ = 1;

bfs::SbusRx sbus_rx_= {&Serial1, static_cast<int8_t>(sbus_pin_), 0, true};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use pin manager to reserver the pin (or it can be assigned to other functions as well, leading to conflicts)


void setup() override
{
sbus_rx_ = bfs::SbusRx(&Serial1, static_cast<int8_t>(sbus_pin_), 0, true);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will also assign GPIO0 to serial, intentional or an oversight?
also: Serial1 is used by DMX as well. @netmindz can Serial1 be used here without restrictions? If not: there is another UM doing it this way that may need updating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants