From 218b8c255cc53aefe81b7ca797265dd07ab950a0 Mon Sep 17 00:00:00 2001 From: Morgan Garcia Date: Tue, 17 Jun 2025 14:50:23 -0700 Subject: [PATCH] Update gameloop.c Comment out normal LED test. Added test for quicker push to the wheel for troubleshooting. --- src/monocoque/gameloop/gameloop.c | 108 ++++++++++++++++++++++++++++-- 1 file changed, 103 insertions(+), 5 deletions(-) diff --git a/src/monocoque/gameloop/gameloop.c b/src/monocoque/gameloop/gameloop.c index 8c8a4bb..29fa826 100644 --- a/src/monocoque/gameloop/gameloop.c +++ b/src/monocoque/gameloop/gameloop.c @@ -653,7 +653,7 @@ int tester(SimDevice* devices, int numdevices) simdata->gear = MONOCOQUE_GEAR_NEUTRAL; simdata->velocity = 16; simdata->rpms = 100; - simdata->maxrpm = 8000; + simdata->maxrpm = 10000; simdata->abs = 0; simdata->tyrediameter[0] = -1; simdata->tyrediameter[1] = -1; @@ -664,7 +664,7 @@ int tester(SimDevice* devices, int numdevices) simdata->Zvelocity = 0; sleep(3); - +/** fprintf(stdout, "Setting rpms to 1000\n"); simdata->rpms = 1000; for (int x = 0; x < numdevices; x++) @@ -889,10 +889,108 @@ int tester(SimDevice* devices, int numdevices) } } sleep(3); +**/ + fprintf(stdout, "Setting rpms to 1000\n"); + simdata->rpms = 1000; + for (int x = 0; x < numdevices; x++) + { + if (devices[x].initialized == true) + { + devices[x].update(&devices[x], simdata); + } + } + sleep(1); - simdata->velocity = 0; - simdata->rpms = 100; - simdata->gear = MONOCOQUE_GEAR_NEUTRAL; + fprintf(stdout, "Setting rpms to 2000\n"); + simdata->rpms = 2000; + for (int x = 0; x < numdevices; x++) + { + if (devices[x].initialized == true) + { + devices[x].update(&devices[x], simdata); + } + } + sleep(1); + + fprintf(stdout, "Setting rpms to 3000\n"); + simdata->rpms = 3000; + for (int x = 0; x < numdevices; x++) + { + if (devices[x].initialized == true) + { + devices[x].update(&devices[x], simdata); + } + } + sleep(1); + + fprintf(stdout, "Setting rpms to 4000\n"); + simdata->rpms = 4000; + for (int x = 0; x < numdevices; x++) + { + if (devices[x].initialized == true) + { + devices[x].update(&devices[x], simdata); + } + } + sleep(1); + + fprintf(stdout, "Setting rpms to 5000\n"); + simdata->rpms = 5000; + for (int x = 0; x < numdevices; x++) + { + if (devices[x].initialized == true) + { + devices[x].update(&devices[x], simdata); + } + } + sleep(1); + + fprintf(stdout, "Setting rpms to 6000\n"); + simdata->rpms = 6000; + for (int x = 0; x < numdevices; x++) + { + if (devices[x].initialized == true) + { + devices[x].update(&devices[x], simdata); + } + } + sleep(1); + + fprintf(stdout, "Setting rpms to 7000\n"); + simdata->rpms = 7000; + for (int x = 0; x < numdevices; x++) + { + if (devices[x].initialized == true) + { + devices[x].update(&devices[x], simdata); + } + } + sleep(1); + + fprintf(stdout, "Setting rpms to 8000\n"); + simdata->rpms = 8000; + for (int x = 0; x < numdevices; x++) + { + if (devices[x].initialized == true) + { + devices[x].update(&devices[x], simdata); + } + } + sleep(1); + + fprintf(stdout, "Setting rpms to 8000\n"); + simdata->rpms = 9000; + for (int x = 0; x < numdevices; x++) + { + if (devices[x].initialized == true) + { + devices[x].update(&devices[x], simdata); + } + } + sleep(1); + + fprintf(stdout, "Setting rpms to 8000\n"); + simdata->rpms = 10000; for (int x = 0; x < numdevices; x++) { if (devices[x].initialized == true)