cable-length-cutter/main/guide-stepper.hpp
jonny 1dd8388769 Add task shutDownDetection, save last pos to nvs, optimize auto-home
shutdown.cpp/hpp:
    - repeatedly check supply voltage
    - save value to nvs when dropping below threshold
    - provide function to read lastPos from nvs

guide-stepper:
    - auto-home considers stored last position in nvs

main:
    - add new task shutDownDetection

config:
    - slightly increase stepper speed
2024-03-12 23:58:15 +01:00

20 lines
677 B
C++

#pragma once
//task that initializes and controls the stepper motor
//current functionality:
// - automatically auto-homes
// - moves left and right repeatedly
// - updates speed from potentiometer each cycle
void task_stepper_test(void *pvParameter);
//task that initializes and controls the stepper motor
// - moves stepper according to encoder movement
void task_stepper_ctl(void *pvParameter);
//tell stepper-control task to move cable guide to zero position
void guide_moveToZero();
// return local variable posNow that stores the current position of cable guide axis in steps
// needed by shutdown to store last axis position in nvs
int guide_getAxisPosSteps();