From 1f07352ea667fd9afb8ad489ac67a3d72b1485d5 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 7 Dec 2020 12:44:56 -0500 Subject: [PATCH] added posXi calc test --- afsk/main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/afsk/main.c b/afsk/main.c index a3a8c5c6..12554fca 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -84,6 +84,7 @@ int loop = -1, loop_count = 0; int firstTime = ON; long start; int testCount = 0; +time_t time_start; short int buffer[2336400]; // max size for 10 frames count of BPSK @@ -402,6 +403,9 @@ srand(time(0)); printf("Rnd: %f \n", rnd_float(.50, 0.6)); printf("Rnd: %f \n", rnd_float(4.0, 5.0)); + time_start = time(NULL); + + int ret; //uint8_t data[1024]; @@ -1015,6 +1019,12 @@ if (firstTime != ON) h[6] = 99; posXi = (int)(current[map[PLUS_X]] + 0.5) + 2048; + + float time = (time(NULL) - time_start); + posXi = 5.0 * SIN(1.57)*SIN(2.0 * 3.14 * time / 46.0); + + print("Time: %f Xi %f \n",time, posXi); + posYi = (int)(current[map[PLUS_Y]] + 0.5) + 2048; posZi = (int)(current[map[PLUS_Z]] + 0.5) + 2048; negXi = (int)(current[map[MINUS_X]] + 0.5) + 2048;