trying to fix max and min

pull/78/head
alanbjohnston 5 years ago committed by GitHub
parent 52652e5124
commit f4155d1f0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1121,8 +1121,8 @@ void get_tlm_fox() {
printf("INFO: Reset Count: %d Uptime since Reset: %ld \n", reset_count, uptime); printf("INFO: Reset Count: %d Uptime since Reset: %ld \n", reset_count, uptime);
#endif #endif
fclose(uptime_file); fclose(uptime_file);
if (sim_mode) {
// simulated telemetry if (sim_mode) { // simulated telemetry
double time = ((long int)millis() - time_start) / 1000.0; double time = ((long int)millis() - time_start) / 1000.0;
@ -1132,11 +1132,6 @@ void get_tlm_fox() {
printf("\n\nSwitching eclipse mode! \n\n"); printf("\n\nSwitching eclipse mode! \n\n");
} }
/*
double Xi = eclipse * amps_max[0] * sin(2.0 * 3.14 * time / (46.0 * speed)) * fabs(sin(2.0 * 3.14 * time / (46.0 * speed))) + rnd_float(-2, 2);
double Yi = eclipse * amps_max[1] * sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14/2.0)) * fabs(sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14/2.0))) + rnd_float(-2, 2);
double Zi = eclipse * amps_max[2] * sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) * fabs(sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2])) + rnd_float(-2, 2);
*/
double Xi = eclipse * amps_max[0] * (float) sin(2.0 * 3.14 * time / (46.0 * speed)) + rnd_float(-2, 2); double Xi = eclipse * amps_max[0] * (float) sin(2.0 * 3.14 * time / (46.0 * speed)) + rnd_float(-2, 2);
double Yi = eclipse * amps_max[1] * (float) sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14 / 2.0)) + rnd_float(-2, 2); double Yi = eclipse * amps_max[1] * (float) sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14 / 2.0)) + rnd_float(-2, 2);
double Zi = eclipse * amps_max[2] * (float) sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) + rnd_float(-2, 2); double Zi = eclipse * amps_max[2] * (float) sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) + rnd_float(-2, 2);
@ -1193,7 +1188,6 @@ void get_tlm_fox() {
// end of simulated telemetry // end of simulated telemetry
} }
else { else {
int count1; int count1;
char * token; char * token;
@ -1226,10 +1220,8 @@ else {
} }
} }
} }
// printf("\n"); // printf("\n");
// sleep(0.5); // sleep(0.5);
// printf("Sleep over\n"); // printf("Sleep over\n");
@ -1323,9 +1315,10 @@ else {
if (sensor[count1] > sensor_max[count1]) if (sensor[count1] > sensor_max[count1])
sensor_max[count1] = sensor[count1]; sensor_max[count1] = sensor[count1];
// printf("Smin %f Smax %f \n", sensor_min[count1], sensor_max[count1]); // printf("Smin %f Smax %f \n", sensor_min[count1], sensor_max[count1]);
} // just added
} }
if (mode == FSK) { // just added }
}
if (mode == FSK) { // just moved
for (int count1 = 0; count1 < 8; count1++) { for (int count1 = 0; count1 < 8; count1++) {
if (voltage[count1] < voltage_min[count1]) if (voltage[count1] < voltage_min[count1])
voltage_min[count1] = voltage[count1]; voltage_min[count1] = voltage[count1];
@ -1339,9 +1332,6 @@ else {
printf("Vmin %f Vmax %f Imin %f Imax %f \n", voltage_min[count1], voltage_max[count1], current_min[count1], current_max[count1]); printf("Vmin %f Vmax %f Imin %f Imax %f \n", voltage_min[count1], voltage_max[count1], current_min[count1], current_max[count1]);
} }
}
}
for (int count1 = 0; count1 < 3; count1++) { for (int count1 = 0; count1 < 3; count1++) {
if (other[count1] < other_min[count1]) if (other[count1] < other_min[count1])
other_min[count1] = other[count1]; other_min[count1] = other[count1];
@ -1350,7 +1340,7 @@ else {
// printf("Other min %f max %f \n", other_min[count1], other_max[count1]); // printf("Other min %f max %f \n", other_min[count1], other_max[count1]);
} }
} // just moved again
if (mode == FSK) { if (mode == FSK) {
if (loop % 8 == 0) { if (loop % 8 == 0) {
printf("Sending MIN frame \n"); printf("Sending MIN frame \n");

Loading…
Cancel
Save

Powered by TurnKey Linux.