Skip to content

Commit

Permalink
Fix PAN and remove some debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
pkendall64 committed Dec 19, 2024
1 parent 3e54fc3 commit 476a6ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/HeadTracker/IMUBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ bool IMUBase::updateCalibration(FusionVector &g)
c = 0;
eSample = 0;
L++;
#ifdef DEBUG_LOG
DBGLN("Finished loop iteration %d", L);
Serial.printf("%6.2f %6.2f %6.2f\r\n", imuCalibration[0], imuCalibration[1], imuCalibration[2]);
#endif
}
return L == Loops;
}
Expand Down
4 changes: 2 additions & 2 deletions src/module_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ ModuleBase::Loop(uint32_t now)

// convert from degrees to servo positions

int pan = -map(fyaw*100, -180*100, 180*100, CRSF_CHANNEL_VALUE_1000, CRSF_CHANNEL_VALUE_2000);
int pan = map(-fyaw*100, -180*100, 180*100, CRSF_CHANNEL_VALUE_1000, CRSF_CHANNEL_VALUE_2000);
int tilt = map(fpitch*100, -180*100, 180*100, CRSF_CHANNEL_VALUE_1000, CRSF_CHANNEL_VALUE_2000);
int roll = map(froll*100, -180*100, 180*100, CRSF_CHANNEL_VALUE_1000, CRSF_CHANNEL_VALUE_2000);
mspPacket_t packet;
Expand All @@ -86,7 +86,7 @@ ModuleBase::Loop(uint32_t now)
packet.addByte(tilt >> 8);
sendMSPViaEspnow(&packet);
lastSend = now;
Serial.printf("%6.2f, %d\r\n",fpitch, tilt);
// Serial.printf("%d, %d, %d\r\n",pan, tilt, roll);
}
#endif
}
Expand Down

0 comments on commit 476a6ad

Please sign in to comment.