Permalink
Browse files

Merge pull request #131 from AeroQuad/QuadUpdate_v3.0.1

Quad update v3.0.1
  • Loading branch information...
2 parents 6988141 + 289abed commit aa00184e46a7e01b91e963b4579b935c06da0288 @Carancho Carancho committed Feb 16, 2012
Showing with 18 additions and 11 deletions.
  1. +14 −8 AeroQuad/SerialCom.h
  2. +3 −3 AeroQuad/UserConfiguration.h
  3. +1 −0 Libraries/AQ_Receiver/Receiver.h
View
@@ -115,15 +115,19 @@ void readSerialCommand() {
break;
case 'G': // Receive transmitter calibration values
- for(byte channel = XAXIS; channel<LASTCHANNEL; channel++) {
- receiverSlope[channel] = readFloatSerial();
- }
+ //for(byte channel = XAXIS; channel<LASTCHANNEL; channel++) {
+ // receiverSlope[channel] = readFloatSerial();
+ //}
+ channelCal = (int)readFloatSerial();
+ receiverSlope[channelCal] = readFloatSerial();
break;
case 'H': // Receive transmitter calibration values
- for(byte channel = XAXIS; channel<LASTCHANNEL; channel++) {
- receiverOffset[channel] = readFloatSerial();
- }
+ //for(byte channel = XAXIS; channel<LASTCHANNEL; channel++) {
+ // receiverOffset[channel] = readFloatSerial();
+ //}
+ channelCal = (int)readFloatSerial();
+ receiverOffset[channelCal] = readFloatSerial();
break;
case 'I': // Initialize EEPROM with default values
@@ -368,15 +372,17 @@ void sendSerialTelemetry() {
case 'g': // Send transmitter calibration data
for (byte axis = XAXIS; axis < LASTCHANNEL; axis++) {
- PrintValueComma(receiverSlope[axis]);
+ Serial.print(receiverSlope[axis], 6);
+ Serial.print(',');
}
SERIAL_PRINTLN();
queryType = 'X';
break;
case 'h': // Send transmitter calibration data
for (byte axis = XAXIS; axis < LASTCHANNEL; axis++) {
- PrintValueComma(receiverOffset[axis]);
+ Serial.print(receiverOffset[axis], 6);
+ Serial.print(',');
}
SERIAL_PRINTLN();
queryType = 'X';
@@ -65,7 +65,7 @@
// Also check the http://www.aeroquad.com/showwiki.php "Build Instructions" for more detail on the 3.0 motor changes
// the OLD_MOTOR_NUMBERING is compatible with the 2.x versions of the AeroQuad code and will not need re-ordering to work
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-//#define OLD_MOTOR_NUMBERING // Uncomment this for old motor numbering setup, FOR QUAD +/X MODE ONLY
+#define OLD_MOTOR_NUMBERING // Uncomment this for old motor numbering setup, FOR QUAD +/X MODE ONLY
//
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -74,7 +74,7 @@
// Use FlightAngleARG if you do not have a magnetometer, use DCM if you have a magnetometer installed
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//#define FlightAngleMARG // EXPERIMENTAL! Fly at your own risk! Use this if you have a magnetometer installed and enabled HeadingMagHold above//
-#define FlightAngleARG // Use this if you do not have a magnetometer installed
+//#define FlightAngleARG // Use this if you do not have a magnetometer installed
//
// *******************************************************************************************************************************
@@ -83,7 +83,7 @@
// *******************************************************************************************************************************
#define HeadingMagHold // Enables Magnetometer, gets automatically selected if CHR6DM is defined
#define AltitudeHoldBaro // Enables BMP085 Barometer (experimental, use at your own risk)
-//#define AltitudeHoldRangeFinder // EXPERIMENTAL : Enable altitude hold with range finder
+#define AltitudeHoldRangeFinder // EXPERIMENTAL : Enable altitude hold with range finder
//#define UseGPS // EXPERIMENTAL, use GPS for position hold or navigation (Serial1 , speed 38400, 5Hz update rate, needed)
//#define RateModeOnly // Use this if you only have a gyro sensor, this will disable any attitude modes.
@@ -47,6 +47,7 @@ int receiverCommandSmooth[MAX_NB_CHANNEL] = {0,0,0,0,0,0,0,0};
float receiverSlope[MAX_NB_CHANNEL] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
float receiverOffset[MAX_NB_CHANNEL] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
float receiverSmoothFactor[MAX_NB_CHANNEL] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
+int channelCal;
void initializeReceiverParam(int nbChannel = 6) {

0 comments on commit aa00184

Please sign in to comment.