diff --git a/src/Util.cpp b/src/Util.cpp index 0dbf963cdf08feee44d6510d598b93a1b66b4873..7f25e36d3872c118d8ef7513eda9f3c379d13b46 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