Run servo movement on different core
This commit is contained in:
@@ -65,7 +65,7 @@ public:
|
||||
/**
|
||||
* @brief Update the servo state periodically
|
||||
*
|
||||
* This function should be periodically called to update the servo state,
|
||||
* This function will be periodically called to update the servo state,
|
||||
* specifically to release the button after the opening time has elapsed.
|
||||
*
|
||||
* There is no required interval to call this function, but the accuracy of
|
||||
@@ -78,16 +78,14 @@ public:
|
||||
*/
|
||||
void pressButton();
|
||||
|
||||
/**
|
||||
* Release the door opener button by moving the servo arm.
|
||||
*/
|
||||
void releaseButton();
|
||||
|
||||
private:
|
||||
|
||||
// Indicator that the door button is pushed
|
||||
bool buttonIsPressed = false;
|
||||
|
||||
// Indicate that the button should be pressed
|
||||
bool shouldPressButton = false;
|
||||
|
||||
uint32_t openDuration = 0;
|
||||
|
||||
int pressedValue = 0;
|
||||
@@ -103,4 +101,12 @@ private:
|
||||
// PWM Module needed for the servo
|
||||
ESP32PWM pwm;
|
||||
|
||||
// The task on core 1 that resets the servo
|
||||
TaskHandle_t servoResetTask;
|
||||
|
||||
/**
|
||||
* Release the door opener button by moving the servo arm.
|
||||
*/
|
||||
void releaseButton();
|
||||
|
||||
};
|
Reference in New Issue
Block a user