Skip to content

armgit / flix

Public Imported from GitHub
0

Making an ESP32-based quadcopter from scratch

Remove reboot requirement when changing RC_RX_PIN

Oleg Kalachevf8a9f1f83835
diff --git a/docs/usage.md b/docs/usage.md
index e610bde..631ac82 100644
--- a/docs/usage.md
+++ b/docs/usage.md
@@ -220,7 +220,7 @@ Before using SBUS-connected remote control you need to enable SBUS and calibrate
1. Connect to the drone using QGroundControl.
2. In parameters, set the `RC_RX_PIN` parameter to the GPIO pin number where the SBUS signal is connected, for example: 4. Negative value disables SBUS.
-3. Reboot the drone to apply changes.
+3. Check if the receiver is working using `rc` command in the console.
4. Open the console, type `cr` command and follow the instructions to calibrate the remote control.
5. Use the remote control to fly the drone!
diff --git a/flix/parameters.ino b/flix/parameters.ino
index 54e466a..75d0288 100644
--- a/flix/parameters.ino
+++ b/flix/parameters.ino
@@ -86,7 +86,7 @@ Parameter parameters[] = {
{"MOT_PWM_MIN", &pwmMin},
{"MOT_PWM_MAX", &pwmMax},
// rc
- {"RC_RX_PIN", &rcRxPin},
+ {"RC_RX_PIN", &rcRxPin, setupRC},
{"RC_ZERO_0", &channelZero[0]},
{"RC_ZERO_1", &channelZero[1]},
{"RC_ZERO_2", &channelZero[2]},
diff --git a/gazebo/flix.h b/gazebo/flix.h
index 53163e5..83a956f 100644
--- a/gazebo/flix.h
+++ b/gazebo/flix.h
@@ -43,6 +43,7 @@ void print(const char* format, ...);
void pause(float duration);
void doCommand(String str, bool echo);
void handleInput();
+void setupRC();
void normalizeRC();
void calibrateRC();
void calibrateRCChannel(int*, uint16_t[16], uint16_t[16], const char*);