changed 20 to 14, encoded accel

pull/74/head
alanbjohnston 5 years ago committed by GitHub
parent b2fe6e2084
commit 941d71090c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1125,7 +1125,7 @@ if (firstTime != ON)
const char space[2] = " "; const char space[2] = " ";
token = strtok(cmdbuffer, space); token = strtok(cmdbuffer, space);
float voltage[9], current[9], sensor[20], other[3]; float voltage[9], current[9], sensor[14], other[3];
memset(voltage, 0, sizeof(voltage)); memset(voltage, 0, sizeof(voltage));
memset(current, 0, sizeof(current)); memset(current, 0, sizeof(current));
memset(sensor, 0, sizeof(sensor)); memset(sensor, 0, sizeof(sensor));
@ -1488,7 +1488,7 @@ if (payload == ON)
} }
*/ */
for (count1 = 0; count1 < 20; count1++) for (count1 = 0; count1 < 14; count1++)
{ {
if (token != NULL) if (token != NULL)
{ {
@ -1501,7 +1501,7 @@ if (payload == ON)
} }
printf("\n"); printf("\n");
for (count1 = 0; count1 < 20; count1++) for (count1 = 0; count1 < 14; count1++)
{ {
if (sensor[count1] < sensor_min[count1]) if (sensor[count1] < sensor_min[count1])
sensor_min[count1] = sensor[count1]; sensor_min[count1] = sensor[count1];
@ -1520,11 +1520,13 @@ if (payload == ON)
encodeB(b, 1 + head_offset, batt_b_v); encodeB(b, 1 + head_offset, batt_b_v);
encodeA(b, 3 + head_offset, batt_c_v); encodeA(b, 3 + head_offset, batt_c_v);
encodeB(b, 4 + head_offset, (int)(xAccel * 100 + 0.5) + 2048); // Xaccel // encodeB(b, 4 + head_offset, (int)(xAccel * 100 + 0.5) + 2048); // Xaccel
encodeA(b, 6 + head_offset, (int)(yAccel * 100 + 0.5) + 2048); // Yaccel // encodeA(b, 6 + head_offset, (int)(yAccel * 100 + 0.5) + 2048); // Yaccel
encodeB(b, 7 + head_offset, (int)(zAccel * 100 + 0.5) + 2048); // Zaccel // encodeB(b, 7 + head_offset, (int)(zAccel * 100 + 0.5) + 2048); // Zaccel
// encodeA(b, 6 + head_offset,yAccel); //Yaccel
// encodeB(b, 7 + head_offset,zAccel); //Zaccel encodeB(b, 4 + head_offset, (int)(sensor[ACCEL_X] * 100 + 0.5) + 2048); // Xaccel
encodeA(b, 6 + head_offset, (int)(sensor[ACCEL_Y] * 100 + 0.5) + 2048); // Yaccel
encodeB(b, 7 + head_offset, (int)(sensor[ACCEL_Z] * 100 + 0.5) + 2048); // Zaccel
encodeA(b, 9 + head_offset, battCurr); encodeA(b, 9 + head_offset, battCurr);

Loading…
Cancel
Save

Powered by TurnKey Linux.