feat: Implement obstacle detection for valve movement
Implement obstacle detection for valve movement that stops the motor if the current exceeds a predefined threshold during opening or closing.
- :
- Added new defines and with a default value of 500 mA.
- :
- Modified function to compare the measured current with the new obstacle thresholds.
- If the threshold is exceeded, the valve movement is stopped and the status is set to .
Signed-off-by: Your Name <your.email@example.com>
This commit is contained in:
@@ -17,6 +17,9 @@
|
||||
#define VALVE_CHANNEL_CLOSE 1
|
||||
#define VALVE_ENDPOSITION_CHECK_INTERVAL K_MSEC(100)
|
||||
|
||||
#define VALVE_OBSTACLE_THRESHOLD_OPEN_MA 500
|
||||
#define VALVE_OBSTACLE_THRESHOLD_CLOSE_MA 500
|
||||
|
||||
/**
|
||||
* @brief Represents the static state of the valve (open or closed).
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user