From 7b79c157111d283facdebe4bea16f566246f2a1f Mon Sep 17 00:00:00 2001 From: Werner Sembach <werner@rdorf.de> Date: Thu, 7 Sep 2017 14:19:20 +0200 Subject: [PATCH] Cleanup --- src/Util.cpp | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/src/Util.cpp b/src/Util.cpp index 0dbf963..7f25e36 100644 --- a/src/Util.cpp +++ b/src/Util.cpp @@ -128,7 +128,7 @@ extern "C" bool simulate_spring(struct spring springs[], int len) { uint16_t adc_value = adc_get(11); for(int i = 0; i < len; i++){ -// ezs_printf("%d\n", adc_value); + //ezs_printf("%d\n", adc_value); if (adc_value < springs[i].threshold){ if (springs[i].power < 0){ if (springs[i].direction == 'l'){ @@ -148,31 +148,12 @@ extern "C" bool simulate_spring(struct spring springs[], int len) { dc_set(0,0); } } - return springs[i].solved; } - } // in case no threshold is "reached" (e.g. the struct params are faulty) // the box shouldn't be unopenable then return true; - - /*old stuff without params: - if (adc_value < 256) { - //potty protection deadzone - dc_set(0, 0); - } - else if(adc_value > (4096 - 256)) { - //spring is "broken" - dc_set(0, 0); - return true; - } - else { - //main simulation - dc_set(DC_RIGHT, adc_value / 4096.0 * 255); - } - return false; - */ } // turns the motor real fast if above certain position -- GitLab