Update main.c eclipse = 1, move seq

fc-jy
Alan Johnston 11 months ago committed by GitHub
parent a7bc18c4bb
commit a129d13449
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -413,7 +413,8 @@ int main(int argc, char * argv[]) {
batt = rnd_float(3.8, 4.3);
speed = rnd_float(1.0, 2.5);
eclipse = (rnd_float(-1, +4) > 0) ? 1.0 : 0.0;
// eclipse = (rnd_float(-1, +4) > 0) ? 1.0 : 0.0;
eclipse = 1;
period = rnd_float(150, 300);
tempS = rnd_float(20, 55);
temp_max = rnd_float(50, 70);
@ -728,12 +729,13 @@ int main(int argc, char * argv[]) {
if (sim_mode) { // simulated telemetry
double time = ((long int)millis() - time_start) / 1000.0;
/*
if ((time - eclipse_time) > period) {
eclipse = (eclipse == 1) ? 0 : 1;
eclipse_time = time;
printf("\n\nSwitching eclipse mode! \n\n");
}
*/
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);
@ -2398,9 +2400,9 @@ void get_tlm_fc() {
// source_bytes[FC_SW + 1] = 0xff & ((unsigned long int)sequence >> 8);
// source_bytes[FC_SW + 2] = 0xff & (unsigned long int)sequence++;
source_bytes[extended + 45] = 0xff & ((unsigned long int)sequence >> 16); // was 45 46
source_bytes[extended + 46] = 0xff & ((unsigned long int)sequence >> 8);
source_bytes[extended + 47] = 0xff & (unsigned long int)sequence++;
source_bytes[extended + 46] = 0xff & ((unsigned long int)sequence >> 16); // was 45 46
source_bytes[extended + 47] = 0xff & ((unsigned long int)sequence >> 8);
source_bytes[extended + 48] = 0xff & (unsigned long int)sequence++;
/**/
printf("\nsource_bytes\n");

Loading…
Cancel
Save

Powered by TurnKey Linux.