From 68dc012fcc17f5e5506f20faa0d0f6fa47b91ff9 Mon Sep 17 00:00:00 2001 From: jonny_l480 Date: Thu, 18 Aug 2022 15:31:46 +0200 Subject: [PATCH] Fix disabled encoder, scaling; Adjust intervals test with actual hardware encoder init was commented out scaling was off by factor 600 adjust speed intervals --- main/control.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/control.cpp b/main/control.cpp index 0b21791..93dfc97 100644 --- a/main/control.cpp +++ b/main/control.cpp @@ -126,7 +126,7 @@ void task_control(void *pvParameter) //initialize display display = init_display(); //initialize encoder -//both dispencoder_queue = init_encoder(&encoder); + encoder_queue = init_encoder(&encoder); //----------------------------------- //------- display welcome msg ------- @@ -170,7 +170,7 @@ void task_control(void *pvParameter) // Poll current position and direction rotary_encoder_get_state(&encoder, &encoderState); //--- calculate distance --- - lengthNow = (float)encoderState.position * (MEASURING_ROLL_DIAMETER * PI); //TODO dont calculate constant factor every time FIXME: ROUNDING ISSUE float-int? + lengthNow = (float)encoderState.position * (MEASURING_ROLL_DIAMETER * PI) / 600; //TODO dont calculate constant factor every time FIXME: ROUNDING ISSUE float-int? //--------------------------- @@ -244,7 +244,7 @@ void task_control(void *pvParameter) case WINDING_START: //wind slow for certain time //TODO: cancel / stay in this state when no change to lengthNow - if (esp_log_timestamp() - timestamp_motorStarted > 4000) { + if (esp_log_timestamp() - timestamp_motorStarted > 2000) { changeState(WINDING); } //TESTING: SIMULATE LENGTH INCREASE