mirror of
https://github.com/okalachev/flix.git
synced 2026-08-16 00:38:56 +00:00
Compare commits
3
Commits
81721abf91
...
74b082957e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74b082957e | ||
|
|
4582942919 | ||
|
|
df14a5678f |
+2
-2
@@ -76,9 +76,9 @@ See other available Make commands in [Makefile](../Makefile).
|
|||||||
In case if using different IMU model than MPU9250, change `imu` variable declaration in the `imu.ino`:
|
In case if using different IMU model than MPU9250, change `imu` variable declaration in the `imu.ino`:
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
ICM20948 imu(SPI); // For ICM-20948
|
ICM20948 imu(SPI); // For ICM-20948 via SPI
|
||||||
// or
|
// or
|
||||||
MPU6050 imu(Wire); // For MPU-6050
|
MPU6050 imu(Wire); // For MPU-6050 via I2C
|
||||||
```
|
```
|
||||||
|
|
||||||
If using non-default SPI pins, pass SCK, MISO, and MOSI pin numbers to `SPI.begin` call and SS pin to `imu` constructor like that:
|
If using non-default SPI pins, pass SCK, MISO, and MOSI pin numbers to `SPI.begin` call and SS pin to `imu` constructor like that:
|
||||||
|
|||||||
+1
-1
@@ -38,7 +38,7 @@ void descend() {
|
|||||||
// Allow pilot to interrupt automatic flight
|
// Allow pilot to interrupt automatic flight
|
||||||
void autoFailsafe() {
|
void autoFailsafe() {
|
||||||
static float roll, pitch, yaw, throttle;
|
static float roll, pitch, yaw, throttle;
|
||||||
if (roll != controlRoll || pitch != controlPitch || yaw != controlYaw || abs(throttle - controlThrottle) > 0.05) {
|
if (abs(roll - controlRoll) > 0.05 || abs(pitch - controlPitch) > 0.05 || abs(yaw - controlYaw) > 0.05 || abs(throttle - controlThrottle) > 0.05) {
|
||||||
// controls changed and mode switch is not configured
|
// controls changed and mode switch is not configured
|
||||||
if (mode == AUTO && invalid(controlMode)) mode = STAB; // regain control by the pilot
|
if (mode == AUTO && invalid(controlMode)) mode = STAB; // regain control by the pilot
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -58,7 +58,7 @@ void sendWiFi(const uint8_t *buf, int len) {
|
|||||||
espnow.write(buf, len);
|
espnow.write(buf, len);
|
||||||
|
|
||||||
static Rate discovery(2);
|
static Rate discovery(2);
|
||||||
if (discovery) espnowBroadcast.write((const uint8_t *)"flix", 4); // broadcast message to help finding this device
|
if (espnow.isEncrypted() && discovery) espnowBroadcast.write((const uint8_t *)"flix", 4); // broadcast message to help finding this device
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user