-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
base: main
Are you sure you want to change the base?
Usermod SbusControl #4464
Conversation
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
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()); |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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}; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
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.