2 Commits
Author SHA1 Message Date
Oleg Kalachev bbe753add0 Enable motor pins only for classic esp32 by default
Also simplify flix2 config code.
2026-08-16 01:26:34 +03:00
Oleg Kalachev 815ccfc08f Docs fix 2026-08-16 00:10:19 +03:00
4 changed files with 15 additions and 9 deletions
+1 -1
View File
@@ -31,7 +31,7 @@
* [`vector.h`](https://github.com/okalachev/flix/blob/master/flix/vector.h), [`quaternion.h`](https://github.com/okalachev/flix/blob/master/flix/quaternion.h) — библиотеки векторов и кватернионов. * [`vector.h`](https://github.com/okalachev/flix/blob/master/flix/vector.h), [`quaternion.h`](https://github.com/okalachev/flix/blob/master/flix/quaternion.h) — библиотеки векторов и кватернионов.
* [`pid.h`](https://github.com/okalachev/flix/blob/master/flix/pid.h) — ПИД-регулятор. * [`pid.h`](https://github.com/okalachev/flix/blob/master/flix/pid.h) — ПИД-регулятор.
* [`lpf.h`](https://github.com/okalachev/flix/blob/master/flix/lpf.h) — фильтр нижних частот. * [`filter.h`](https://github.com/okalachev/flix/blob/master/flix/filter.h) — фильтр нижних частот.
### Подсистема управления ### Подсистема управления
+1 -1
View File
@@ -34,7 +34,7 @@ Utility files:
* [`vector.h`](../flix/vector.h), [`quaternion.h`](../flix/quaternion.h) — vector and quaternion libraries. * [`vector.h`](../flix/vector.h), [`quaternion.h`](../flix/quaternion.h) — vector and quaternion libraries.
* [`pid.h`](../flix/pid.h) — generic PID controller. * [`pid.h`](../flix/pid.h) — generic PID controller.
* [`lpf.h`](../flix/lpf.h) — generic low-pass filter. * [`filter.h`](../flix/filter.h) — generic low-pass filter.
### Control subsystem ### Control subsystem
+12 -6
View File
@@ -12,16 +12,22 @@ void setDefaults() {
pwmFrequency = 38000; pwmFrequency = 38000;
#endif #endif
#ifdef CONFIG_IDF_TARGET_ESP32
// classic esp32 configuration
motorPins[0] = 12;
motorPins[1] = 13;
motorPins[2] = 14;
motorPins[3] = 15;
#endif
#ifdef FLIX2 #ifdef FLIX2
imuModel = 4; // ICM-40609-D imuModel = 4; // ICM-40609-D
imuIntPin = 10; imuIntPin = 10;
imuCsPin = 14; imuCsPin = 14;
motorPins[MOTOR_REAR_LEFT] = 41;
motorPins[MOTOR_REAR_RIGHT] = 7;
motorPins[MOTOR_FRONT_RIGHT] = 18;
motorPins[MOTOR_FRONT_LEFT] = 38;
voltagePin = 3; voltagePin = 3;
motorPins[0] = 41;
motorPins[1] = 7;
motorPins[2] = 18;
motorPins[3] = 38;
#endif #endif
} }
+1 -1
View File
@@ -7,7 +7,7 @@
float motors[4]; // normalized motor thrusts in range [0..1] float motors[4]; // normalized motor thrusts in range [0..1]
int motorPins[4] = {12, 13, 14, 15}; // default pin numbers int motorPins[4] = {-1, -1, -1, -1}; // default pin numbers
int pwmFrequency = 78000; int pwmFrequency = 78000;
int pwmResolution = 10; int pwmResolution = 10;
int pwmStop = 0; int pwmStop = 0;